root / src / lapack / util / iladlr.f @ 2
Historique | Voir | Annoter | Télécharger (1,47 ko)
1 |
INTEGER FUNCTION ILADLR(M, N, A, LDA) |
---|---|
2 |
IMPLICIT NONE |
3 |
! |
4 |
! -- LAPACK auxiliary routine (version 3.2) -- |
5 |
! Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. |
6 |
! December 2007 |
7 |
! |
8 |
! .. Scalar Arguments .. |
9 |
INTEGER M, N, LDA |
10 |
! .. |
11 |
! .. Array Arguments .. |
12 |
DOUBLE PRECISION A( LDA, * ) |
13 |
! .. |
14 |
! |
15 |
! Purpose |
16 |
! ======= |
17 |
! |
18 |
! ILADLR scans A for its last non-zero row. |
19 |
! |
20 |
! Arguments |
21 |
! ========= |
22 |
! |
23 |
! M (input) INTEGER |
24 |
! The number of rows of the matrix A. |
25 |
! |
26 |
! N (input) INTEGER |
27 |
! The number of columns of the matrix A. |
28 |
! |
29 |
! A (input) DOUBLE PRECISION array, dimension (LDA,N) |
30 |
! The m by n matrix A. |
31 |
! |
32 |
! LDA (input) INTEGER |
33 |
! The leading dimension of the array A. LDA >= max(1,M). |
34 |
! |
35 |
! ===================================================================== |
36 |
! |
37 |
! .. Parameters .. |
38 |
DOUBLE PRECISION ZERO |
39 |
PARAMETER ( ZERO = 0.0D+0 ) |
40 |
! .. |
41 |
! .. Local Scalars .. |
42 |
INTEGER I, J |
43 |
! .. |
44 |
! .. Executable Statements .. |
45 |
! |
46 |
! Quick test for the common case where one corner is non-zero. |
47 |
IF( M.EQ.0 .OR. A(M, 1).NE.ZERO .OR. A(M, N).NE.ZERO ) THEN |
48 |
ILADLR = M |
49 |
ELSE |
50 |
! Scan up each column tracking the last zero row seen. |
51 |
ILADLR = 0 |
52 |
DO J = 1, N |
53 |
DO I = M, 1, -1 |
54 |
IF( A(I, J).NE.ZERO ) EXIT |
55 |
END DO |
56 |
ILADLR = MAX( ILADLR, I ) |
57 |
END DO |
58 |
END IF |
59 |
RETURN |
60 |
END FUNCTION |