Coverage Report

Created: 2023-06-07 06:06

/src/igraph/vendor/lapack/iladlr.c
Line
Count
Source (jump to first uncovered line)
1
/*  -- translated by f2c (version 20191129).
2
   You must link the resulting object file with libf2c:
3
  on Microsoft Windows system, link with libf2c.lib;
4
  on Linux or Unix systems, link with .../path/to/libf2c.a -lm
5
  or, if you install libf2c.a in a standard place, with -lf2c -lm
6
  -- in that order, at the end of the command line, as in
7
    cc *.o -lf2c -lm
8
  Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
9
10
    http://www.netlib.org/f2c/libf2c.zip
11
*/
12
13
#include "f2c.h"
14
15
/* > \brief \b ILADLR scans a matrix for its last non-zero row.   
16
17
    =========== DOCUMENTATION ===========   
18
19
   Online html documentation available at   
20
              http://www.netlib.org/lapack/explore-html/   
21
22
   > \htmlonly   
23
   > Download ILADLR + dependencies   
24
   > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/iladlr.
25
f">   
26
   > [TGZ]</a>   
27
   > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/iladlr.
28
f">   
29
   > [ZIP]</a>   
30
   > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/iladlr.
31
f">   
32
   > [TXT]</a>   
33
   > \endhtmlonly   
34
35
    Definition:   
36
    ===========   
37
38
         INTEGER FUNCTION ILADLR( M, N, A, LDA )   
39
40
         INTEGER            M, N, LDA   
41
         DOUBLE PRECISION   A( LDA, * )   
42
43
44
   > \par Purpose:   
45
    =============   
46
   >   
47
   > \verbatim   
48
   >   
49
   > ILADLR scans A for its last non-zero row.   
50
   > \endverbatim   
51
52
    Arguments:   
53
    ==========   
54
55
   > \param[in] M   
56
   > \verbatim   
57
   >          M is INTEGER   
58
   >          The number of rows of the matrix A.   
59
   > \endverbatim   
60
   >   
61
   > \param[in] N   
62
   > \verbatim   
63
   >          N is INTEGER   
64
   >          The number of columns of the matrix A.   
65
   > \endverbatim   
66
   >   
67
   > \param[in] A   
68
   > \verbatim   
69
   >          A is DOUBLE PRECISION array, dimension (LDA,N)   
70
   >          The m by n matrix A.   
71
   > \endverbatim   
72
   >   
73
   > \param[in] LDA   
74
   > \verbatim   
75
   >          LDA is INTEGER   
76
   >          The leading dimension of the array A. LDA >= max(1,M).   
77
   > \endverbatim   
78
79
    Authors:   
80
    ========   
81
82
   > \author Univ. of Tennessee   
83
   > \author Univ. of California Berkeley   
84
   > \author Univ. of Colorado Denver   
85
   > \author NAG Ltd.   
86
87
   > \date September 2012   
88
89
   > \ingroup auxOTHERauxiliary   
90
91
    ===================================================================== */
92
integer igraphiladlr_(integer *m, integer *n, doublereal *a, integer *lda)
93
0
{
94
    /* System generated locals */
95
0
    integer a_dim1, a_offset, ret_val, i__1;
96
97
    /* Local variables */
98
0
    integer i__, j;
99
100
101
/*  -- LAPACK auxiliary routine (version 3.4.2) --   
102
    -- LAPACK is a software package provided by Univ. of Tennessee,    --   
103
    -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--   
104
       September 2012   
105
106
107
    =====================================================================   
108
109
110
       Quick test for the common case where one corner is non-zero.   
111
       Parameter adjustments */
112
0
    a_dim1 = *lda;
113
0
    a_offset = 1 + a_dim1;
114
0
    a -= a_offset;
115
116
    /* Function Body */
117
0
    if (*m == 0) {
118
0
  ret_val = *m;
119
0
    } else if (a[*m + a_dim1] != 0. || a[*m + *n * a_dim1] != 0.) {
120
0
  ret_val = *m;
121
0
    } else {
122
/*     Scan up each column tracking the last zero row seen. */
123
0
  ret_val = 0;
124
0
  i__1 = *n;
125
0
  for (j = 1; j <= i__1; ++j) {
126
0
      i__ = *m;
127
0
      while(a[max(i__,1) + j * a_dim1] == 0. && i__ >= 1) {
128
0
    --i__;
129
0
      }
130
0
      ret_val = max(ret_val,i__);
131
0
  }
132
0
    }
133
0
    return ret_val;
134
0
} /* igraphiladlr_ */
135