iladlr.c
Go to the documentation of this file.
00001 /* iladlr.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 integer iladlr_(integer *m, integer *n, doublereal *a, integer *lda)
00017 {
00018     /* System generated locals */
00019     integer a_dim1, a_offset, ret_val, i__1;
00020 
00021     /* Local variables */
00022     integer i__, j;
00023 
00024 
00025 /*  -- LAPACK auxiliary routine (version 3.2.1)                        -- */
00026 
00027 /*  -- April 2009                                                      -- */
00028 
00029 /*  -- LAPACK is a software package provided by Univ. of Tennessee,    -- */
00030 /*  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
00031 
00032 /*     .. Scalar Arguments .. */
00033 /*     .. */
00034 /*     .. Array Arguments .. */
00035 /*     .. */
00036 
00037 /*  Purpose */
00038 /*  ======= */
00039 
00040 /*  ILADLR scans A for its last non-zero row. */
00041 
00042 /*  Arguments */
00043 /*  ========= */
00044 
00045 /*  M       (input) INTEGER */
00046 /*          The number of rows of the matrix A. */
00047 
00048 /*  N       (input) INTEGER */
00049 /*          The number of columns of the matrix A. */
00050 
00051 /*  A       (input) DOUBLE PRECISION array, dimension (LDA,N) */
00052 /*          The m by n matrix A. */
00053 
00054 /*  LDA     (input) INTEGER */
00055 /*          The leading dimension of the array A. LDA >= max(1,M). */
00056 
00057 /*  ===================================================================== */
00058 
00059 /*     .. Parameters .. */
00060 /*     .. */
00061 /*     .. Local Scalars .. */
00062 /*     .. */
00063 /*     .. Executable Statements .. */
00064 
00065 /*     Quick test for the common case where one corner is non-zero. */
00066     /* Parameter adjustments */
00067     a_dim1 = *lda;
00068     a_offset = 1 + a_dim1;
00069     a -= a_offset;
00070 
00071     /* Function Body */
00072     if (*m == 0) {
00073         ret_val = *m;
00074     } else if (a[*m + a_dim1] != 0. || a[*m + *n * a_dim1] != 0.) {
00075         ret_val = *m;
00076     } else {
00077 /*     Scan up each column tracking the last zero row seen. */
00078         ret_val = 0;
00079         i__1 = *n;
00080         for (j = 1; j <= i__1; ++j) {
00081             for (i__ = *m; i__ >= 1; --i__) {
00082                 if (a[i__ + j * a_dim1] != 0.) {
00083                     break;
00084                 }
00085             }
00086             ret_val = max(ret_val,i__);
00087         }
00088     }
00089     return ret_val;
00090 } /* iladlr_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:50