iladlc.c
Go to the documentation of this file.
00001 /* iladlc.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 iladlc_(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__;
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 /*  ILADLC scans A for its last non-zero column. */
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 (*n == 0) {
00073         ret_val = *n;
00074     } else if (a[*n * a_dim1 + 1] != 0. || a[*m + *n * a_dim1] != 0.) {
00075         ret_val = *n;
00076     } else {
00077 /*     Now scan each column from the end, returning with the first non-zero. */
00078         for (ret_val = *n; ret_val >= 1; --ret_val) {
00079             i__1 = *m;
00080             for (i__ = 1; i__ <= i__1; ++i__) {
00081                 if (a[i__ + ret_val * a_dim1] != 0.) {
00082                     return ret_val;
00083                 }
00084             }
00085         }
00086     }
00087     return ret_val;
00088 } /* iladlc_ */


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