zlag2c.c
Go to the documentation of this file.
00001 /* zlag2c.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 /* Subroutine */ int zlag2c_(integer *m, integer *n, doublecomplex *a, 
00017         integer *lda, complex *sa, integer *ldsa, integer *info)
00018 {
00019     /* System generated locals */
00020     integer sa_dim1, sa_offset, a_dim1, a_offset, i__1, i__2, i__3, i__4;
00021 
00022     /* Builtin functions */
00023     double d_imag(doublecomplex *);
00024 
00025     /* Local variables */
00026     integer i__, j;
00027     doublereal rmax;
00028     extern doublereal slamch_(char *);
00029 
00030 
00031 /*  -- LAPACK PROTOTYPE auxiliary routine (version 3.1.2) -- */
00032 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00033 /*     August 2007 */
00034 
00035 /*     .. */
00036 /*     .. Scalar Arguments .. */
00037 /*     .. */
00038 /*     .. Array Arguments .. */
00039 /*     .. */
00040 
00041 /*  Purpose */
00042 /*  ======= */
00043 
00044 /*  ZLAG2C converts a COMPLEX*16 matrix, SA, to a COMPLEX matrix, A. */
00045 
00046 /*  RMAX is the overflow for the SINGLE PRECISION arithmetic */
00047 /*  ZLAG2C checks that all the entries of A are between -RMAX and */
00048 /*  RMAX. If not the convertion is aborted and a flag is raised. */
00049 
00050 /*  This is an auxiliary routine so there is no argument checking. */
00051 
00052 /*  Arguments */
00053 /*  ========= */
00054 
00055 /*  M       (input) INTEGER */
00056 /*          The number of lines of the matrix A.  M >= 0. */
00057 
00058 /*  N       (input) INTEGER */
00059 /*          The number of columns of the matrix A.  N >= 0. */
00060 
00061 /*  A       (input) COMPLEX*16 array, dimension (LDA,N) */
00062 /*          On entry, the M-by-N coefficient matrix A. */
00063 
00064 /*  LDA     (input) INTEGER */
00065 /*          The leading dimension of the array A.  LDA >= max(1,M). */
00066 
00067 /*  SA      (output) COMPLEX array, dimension (LDSA,N) */
00068 /*          On exit, if INFO=0, the M-by-N coefficient matrix SA; if */
00069 /*          INFO>0, the content of SA is unspecified. */
00070 
00071 /*  LDSA    (input) INTEGER */
00072 /*          The leading dimension of the array SA.  LDSA >= max(1,M). */
00073 
00074 /*  INFO    (output) INTEGER */
00075 /*          = 0:  successful exit. */
00076 /*          = 1:  an entry of the matrix A is greater than the SINGLE */
00077 /*                PRECISION overflow threshold, in this case, the content */
00078 /*                of SA in exit is unspecified. */
00079 
00080 /*  ========= */
00081 
00082 /*     .. Local Scalars .. */
00083 /*     .. */
00084 /*     .. Intrinsic Functions .. */
00085 /*     .. */
00086 /*     .. External Functions .. */
00087 /*     .. */
00088 /*     .. Executable Statements .. */
00089 
00090     /* Parameter adjustments */
00091     a_dim1 = *lda;
00092     a_offset = 1 + a_dim1;
00093     a -= a_offset;
00094     sa_dim1 = *ldsa;
00095     sa_offset = 1 + sa_dim1;
00096     sa -= sa_offset;
00097 
00098     /* Function Body */
00099     rmax = slamch_("O");
00100     i__1 = *n;
00101     for (j = 1; j <= i__1; ++j) {
00102         i__2 = *m;
00103         for (i__ = 1; i__ <= i__2; ++i__) {
00104             i__3 = i__ + j * a_dim1;
00105             i__4 = i__ + j * a_dim1;
00106             if (a[i__3].r < -rmax || a[i__4].r > rmax || d_imag(&a[i__ + j * 
00107                     a_dim1]) < -rmax || d_imag(&a[i__ + j * a_dim1]) > rmax) {
00108                 *info = 1;
00109                 goto L30;
00110             }
00111             i__3 = i__ + j * sa_dim1;
00112             i__4 = i__ + j * a_dim1;
00113             sa[i__3].r = a[i__4].r, sa[i__3].i = a[i__4].i;
00114 /* L10: */
00115         }
00116 /* L20: */
00117     }
00118     *info = 0;
00119 L30:
00120     return 0;
00121 
00122 /*     End of ZLAG2C */
00123 
00124 } /* zlag2c_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:40