00001 /* ilazlr.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 ilazlr_(integer *m, integer *n, doublecomplex *a, integer *lda) 00017 { 00018 /* System generated locals */ 00019 integer a_dim1, a_offset, ret_val, i__1, i__2; 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 /* ILAZLR 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) COMPLEX*16 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(complicated condition) */ { 00075 i__1 = *m + a_dim1; 00076 i__2 = *m + *n * a_dim1; 00077 if (a[i__1].r != 0. || a[i__1].i != 0. || (a[i__2].r != 0. || a[i__2] 00078 .i != 0.)) { 00079 ret_val = *m; 00080 } else { 00081 /* Scan up each column tracking the last zero row seen. */ 00082 ret_val = 0; 00083 i__1 = *n; 00084 for (j = 1; j <= i__1; ++j) { 00085 for (i__ = *m; i__ >= 1; --i__) { 00086 i__2 = i__ + j * a_dim1; 00087 if (a[i__2].r != 0. || a[i__2].i != 0.) { 00088 break; 00089 } 00090 } 00091 ret_val = max(ret_val,i__); 00092 } 00093 } 00094 } 00095 return ret_val; 00096 } /* ilazlr_ */