LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
ilaslr.f
Go to the documentation of this file.
00001 *> \brief \b ILASLR
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *> \htmlonly
00009 *> Download ILASLR + dependencies 
00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ilaslr.f"> 
00011 *> [TGZ]</a> 
00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ilaslr.f"> 
00013 *> [ZIP]</a> 
00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ilaslr.f"> 
00015 *> [TXT]</a>
00016 *> \endhtmlonly 
00017 *
00018 *  Definition:
00019 *  ===========
00020 *
00021 *       INTEGER FUNCTION ILASLR( M, N, A, LDA )
00022 * 
00023 *       .. Scalar Arguments ..
00024 *       INTEGER            M, N, LDA
00025 *       ..
00026 *       .. Array Arguments ..
00027 *       REAL               A( LDA, * )
00028 *       ..
00029 *  
00030 *
00031 *> \par Purpose:
00032 *  =============
00033 *>
00034 *> \verbatim
00035 *>
00036 *> ILASLR scans A for its last non-zero row.
00037 *> \endverbatim
00038 *
00039 *  Arguments:
00040 *  ==========
00041 *
00042 *> \param[in] M
00043 *> \verbatim
00044 *>          M is INTEGER
00045 *>          The number of rows of the matrix A.
00046 *> \endverbatim
00047 *>
00048 *> \param[in] N
00049 *> \verbatim
00050 *>          N is INTEGER
00051 *>          The number of columns of the matrix A.
00052 *> \endverbatim
00053 *>
00054 *> \param[in] A
00055 *> \verbatim
00056 *>          A is REAL array, dimension (LDA,N)
00057 *>          The m by n matrix A.
00058 *> \endverbatim
00059 *>
00060 *> \param[in] LDA
00061 *> \verbatim
00062 *>          LDA is INTEGER
00063 *>          The leading dimension of the array A. LDA >= max(1,M).
00064 *> \endverbatim
00065 *
00066 *  Authors:
00067 *  ========
00068 *
00069 *> \author Univ. of Tennessee 
00070 *> \author Univ. of California Berkeley 
00071 *> \author Univ. of Colorado Denver 
00072 *> \author NAG Ltd. 
00073 *
00074 *> \date April 2012
00075 *
00076 *> \ingroup realOTHERauxiliary
00077 *
00078 *  =====================================================================
00079       INTEGER FUNCTION ILASLR( M, N, A, LDA )
00080 *
00081 *  -- LAPACK auxiliary routine (version 3.4.1) --
00082 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00083 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00084 *     April 2012
00085 *
00086 *     .. Scalar Arguments ..
00087       INTEGER            M, N, LDA
00088 *     ..
00089 *     .. Array Arguments ..
00090       REAL               A( LDA, * )
00091 *     ..
00092 *
00093 *  =====================================================================
00094 *
00095 *     .. Parameters ..
00096       REAL             ZERO
00097       PARAMETER ( ZERO = 0.0E+0 )
00098 *     ..
00099 *     .. Local Scalars ..
00100       INTEGER I, J
00101 *     ..
00102 *     .. Executable Statements ..
00103 *
00104 *     Quick test for the common case where one corner is non-zero.
00105       IF( M.EQ.0 ) THEN
00106          ILASLR = M
00107       ELSEIF( A(M, 1).NE.ZERO .OR. A(M, N).NE.ZERO ) THEN
00108          ILASLR = M
00109       ELSE
00110 *     Scan up each column tracking the last zero row seen.
00111          ILASLR = 0
00112          DO J = 1, N
00113             I=M
00114             DO WHILE((A(MAX(I,1),J).EQ.ZERO).AND.(I.GE.1))
00115                I=I-1
00116             ENDDO
00117             ILASLR = MAX( ILASLR, I )
00118          END DO
00119       END IF
00120       RETURN
00121       END
 All Files Functions