LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
integer function ilaslr ( integer  M,
integer  N,
real, dimension( lda, * )  A,
integer  LDA 
)

ILASLR scans a matrix for its last non-zero row.

Download ILASLR + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 ILASLR scans A for its last non-zero row.
Parameters
[in]M
          M is INTEGER
          The number of rows of the matrix A.
[in]N
          N is INTEGER
          The number of columns of the matrix A.
[in]A
          A is REAL array, dimension (LDA,N)
          The m by n matrix A.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A. LDA >= max(1,M).
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
September 2012

Definition at line 80 of file ilaslr.f.

80 *
81 * -- LAPACK auxiliary routine (version 3.4.2) --
82 * -- LAPACK is a software package provided by Univ. of Tennessee, --
83 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
84 * September 2012
85 *
86 * .. Scalar Arguments ..
87  INTEGER m, n, lda
88 * ..
89 * .. Array Arguments ..
90  REAL a( lda, * )
91 * ..
92 *
93 * =====================================================================
94 *
95 * .. Parameters ..
96  REAL zero
97  parameter( zero = 0.0e+0 )
98 * ..
99 * .. Local Scalars ..
100  INTEGER i, j
101 * ..
102 * .. Executable Statements ..
103 *
104 * Quick test for the common case where one corner is non-zero.
105  IF( m.EQ.0 ) THEN
106  ilaslr = m
107  ELSEIF( a(m, 1).NE.zero .OR. a(m, n).NE.zero ) THEN
108  ilaslr = m
109  ELSE
110 * Scan up each column tracking the last zero row seen.
111  ilaslr = 0
112  DO j = 1, n
113  i=m
114  DO WHILE((a(max(i,1),j).EQ.zero).AND.(i.GE.1))
115  i=i-1
116  ENDDO
117  ilaslr = max( ilaslr, i )
118  END DO
119  END IF
120  RETURN
integer function ilaslr(M, N, A, LDA)
ILASLR scans a matrix for its last non-zero row.
Definition: ilaslr.f:80