Statistiques
| Révision :

root / src / lapack / util / iladlc.f @ 10

Historique | Voir | Annoter | Télécharger (1,45 ko)

1
      INTEGER FUNCTION ILADLC(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
!  ILADLC scans A for its last non-zero column.
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
43
!     ..
44
!     .. Executable Statements ..
45
!
46
!     Quick test for the common case where one corner is non-zero.
47
      IF( N.EQ.0 .OR. A(1, N).NE.ZERO .OR. A(M, N).NE.ZERO ) THEN
48
         ILADLC = N
49
      ELSE
50
!     Now scan each column from the end, returning with the first non-zero.
51
         DO ILADLC = N, 1, -1
52
            DO I = 1, M
53
               IF( A(I, ILADLC).NE.ZERO ) RETURN
54
            END DO
55
         END DO
56
      END IF
57
      RETURN
58
      END FUNCTION