PLASMA  2.4.5
PLASMA - Parallel Linear Algebra for Scalable Multi-core Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
ilaclr.f
Go to the documentation of this file.
1  INTEGER FUNCTION ilaclr(M, N, A, LDA)
2  IMPLICIT NONE
3 *
4 * -- LAPACK auxiliary routine (version 3.2.1) --
5 *
6 * -- April 2009 --
7 *
8 * -- LAPACK is a software package provided by Univ. of Tennessee, --
9 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
10 *
11 * .. Scalar Arguments ..
12  INTEGER m, n, lda
13 * ..
14 * .. Array Arguments ..
15  COMPLEX a( lda, * )
16 * ..
17 *
18 * Purpose
19 * =======
20 *
21 * ILACLR scans A for its last non-zero row.
22 *
23 * Arguments
24 * =========
25 *
26 * M (input) INTEGER
27 * The number of rows of the matrix A.
28 *
29 * N (input) INTEGER
30 * The number of columns of the matrix A.
31 *
32 * A (input) COMPLEX array, dimension (LDA,N)
33 * The m by n matrix A.
34 *
35 * LDA (input) INTEGER
36 * The leading dimension of the array A. LDA >= max(1,M).
37 *
38 * =====================================================================
39 *
40 * .. Parameters ..
41  COMPLEX zero
42  parameter( zero = (0.0e+0, 0.0e+0) )
43 * ..
44 * .. Local Scalars ..
45  INTEGER i, j
46 * ..
47 * .. Executable Statements ..
48 *
49 * Quick test for the common case where one corner is non-zero.
50  IF( m.EQ.0 ) THEN
51  ilaclr = m
52  ELSE IF( a(m, 1).NE.zero .OR. a(m, n).NE.zero ) THEN
53  ilaclr = m
54  ELSE
55 * Scan up each column tracking the last zero row seen.
56  ilaclr = 0
57  DO j = 1, n
58  DO i = m, 1, -1
59  IF( a(i, j).NE.zero ) goto 10
60  END DO
61  10 continue
62  ilaclr = max( ilaclr, i )
63  END DO
64  END IF
65  return
66  END FUNCTION