LAPACK 3.3.1
Linear Algebra PACKage
|
00001 INTEGER FUNCTION ILASLR( 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 * 00009 * .. Scalar Arguments .. 00010 INTEGER M, N, LDA 00011 * .. 00012 * .. Array Arguments .. 00013 REAL A( LDA, * ) 00014 * .. 00015 * 00016 * Purpose 00017 * ======= 00018 * 00019 * ILASLR scans A for its last non-zero row. 00020 * 00021 * Arguments 00022 * ========= 00023 * 00024 * M (input) INTEGER 00025 * The number of rows of the matrix A. 00026 * 00027 * N (input) INTEGER 00028 * The number of columns of the matrix A. 00029 * 00030 * A (input) REAL array, dimension (LDA,N) 00031 * The m by n matrix A. 00032 * 00033 * LDA (input) INTEGER 00034 * The leading dimension of the array A. LDA >= max(1,M). 00035 * 00036 * ===================================================================== 00037 * 00038 * .. Parameters .. 00039 REAL ZERO 00040 PARAMETER ( ZERO = 0.0E+0 ) 00041 * .. 00042 * .. Local Scalars .. 00043 INTEGER I, J 00044 * .. 00045 * .. Executable Statements .. 00046 * 00047 * Quick test for the common case where one corner is non-zero. 00048 IF( M.EQ.0 ) THEN 00049 ILASLR = M 00050 ELSEIF( A(M, 1).NE.ZERO .OR. A(M, N).NE.ZERO ) THEN 00051 ILASLR = M 00052 ELSE 00053 * Scan up each column tracking the last zero row seen. 00054 ILASLR = 0 00055 DO J = 1, N 00056 I=M 00057 DO WHILE ((A(I,J).NE.ZERO).AND.(I.GE.1)) 00058 I=I-1 00059 ENDDO 00060 ILASLR = MAX( ILASLR, I ) 00061 END DO 00062 END IF 00063 RETURN 00064 END