LAPACK 3.3.1
Linear Algebra PACKage

ilazlr.f

Go to the documentation of this file.
00001       INTEGER FUNCTION ILAZLR( M, N, A, LDA )
00002       IMPLICIT NONE
00003 *
00004 *  -- LAPACK auxiliary routine (version 3.3.1)                        --
00005 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00006 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00007 *  -- April 2011                                                      --
00008 *     .. Scalar Arguments ..
00009       INTEGER            M, N, LDA
00010 *     ..
00011 *     .. Array Arguments ..
00012       COMPLEX*16         A( LDA, * )
00013 *     ..
00014 *
00015 *  Purpose
00016 *  =======
00017 *
00018 *  ILAZLR scans A for its last non-zero row.
00019 *
00020 *  Arguments
00021 *  =========
00022 *
00023 *  M       (input) INTEGER
00024 *          The number of rows of the matrix A.
00025 *
00026 *  N       (input) INTEGER
00027 *          The number of columns of the matrix A.
00028 *
00029 *  A       (input) COMPLEX*16 array, dimension (LDA,N)
00030 *          The m by n matrix A.
00031 *
00032 *  LDA     (input) INTEGER
00033 *          The leading dimension of the array A. LDA >= max(1,M).
00034 *
00035 *  =====================================================================
00036 *
00037 *     .. Parameters ..
00038       COMPLEX*16       ZERO
00039       PARAMETER ( ZERO = (0.0D+0, 0.0D+0) )
00040 *     ..
00041 *     .. Local Scalars ..
00042       INTEGER I, J
00043 *     ..
00044 *     .. Executable Statements ..
00045 *
00046 *     Quick test for the common case where one corner is non-zero.
00047       IF( M.EQ.0 ) THEN
00048          ILAZLR = M
00049       ELSE IF( A(M, 1).NE.ZERO .OR. A(M, N).NE.ZERO ) THEN
00050          ILAZLR = M
00051       ELSE
00052 *     Scan up each column tracking the last zero row seen.
00053          ILAZLR = 0
00054          DO J = 1, N
00055             I=M
00056             DO WHILE ((A(I,J).NE.ZERO).AND.(I.GE.1))
00057               I=I-1
00058             ENDDO         
00059             ILAZLR = MAX( ILAZLR, I )
00060          END DO
00061       END IF
00062       RETURN
00063       END
 All Files Functions