zlat2c.c
Go to the documentation of this file.
00001 /* zlat2c.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 zlat2c_(char *uplo, 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 logical lsame_(char *, char *);
00029     logical upper;
00030     extern doublereal slamch_(char *);
00031 
00032 
00033 /*  -- LAPACK PROTOTYPE auxiliary routine (version 3.1.2) -- */
00034 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00035 /*     May 2007 */
00036 
00037 /*     .. Scalar Arguments .. */
00038 /*     .. */
00039 /*     .. Array Arguments .. */
00040 /*     .. */
00041 
00042 /*  Purpose */
00043 /*  ======= */
00044 
00045 /*  ZLAT2C converts a COMPLEX*16 triangular matrix, SA, to a COMPLEX */
00046 /*  triangular matrix, A. */
00047 
00048 /*  RMAX is the overflow for the SINGLE PRECISION arithmetic */
00049 /*  ZLAT2C checks that all the entries of A are between -RMAX and */
00050 /*  RMAX. If not the convertion is aborted and a flag is raised. */
00051 
00052 /*  This is an auxiliary routine so there is no argument checking. */
00053 
00054 /*  Arguments */
00055 /*  ========= */
00056 
00057 /*  UPLO    (input) CHARACTER*1 */
00058 /*          = 'U':  A is upper triangular; */
00059 /*          = 'L':  A is lower triangular. */
00060 
00061 /*  N       (input) INTEGER */
00062 /*          The number of rows and columns of the matrix A.  N >= 0. */
00063 
00064 /*  A       (input) COMPLEX*16 array, dimension (LDA,N) */
00065 /*          On entry, the N-by-N triangular coefficient matrix A. */
00066 
00067 /*  LDA     (input) INTEGER */
00068 /*          The leading dimension of the array A.  LDA >= max(1,N). */
00069 
00070 /*  SA      (output) COMPLEX array, dimension (LDSA,N) */
00071 /*          Only the UPLO part of SA is referenced.  On exit, if INFO=0, */
00072 /*          the N-by-N coefficient matrix SA; if INFO>0, the content of */
00073 /*          the UPLO part of SA is unspecified. */
00074 
00075 /*  LDSA    (input) INTEGER */
00076 /*          The leading dimension of the array SA.  LDSA >= max(1,M). */
00077 
00078 /*  INFO    (output) INTEGER */
00079 /*          = 0:  successful exit. */
00080 /*          = 1:  an entry of the matrix A is greater than the SINGLE */
00081 /*                PRECISION overflow threshold, in this case, the content */
00082 /*                of the UPLO part of SA in exit is unspecified. */
00083 
00084 /*  ========= */
00085 
00086 /*     .. Local Scalars .. */
00087 /*     .. */
00088 /*     .. Intrinsic Functions .. */
00089 /*     .. */
00090 /*     .. External Functions .. */
00091 /*     .. */
00092 /*     .. Executable Statements .. */
00093 
00094     /* Parameter adjustments */
00095     a_dim1 = *lda;
00096     a_offset = 1 + a_dim1;
00097     a -= a_offset;
00098     sa_dim1 = *ldsa;
00099     sa_offset = 1 + sa_dim1;
00100     sa -= sa_offset;
00101 
00102     /* Function Body */
00103     rmax = slamch_("O");
00104     upper = lsame_(uplo, "U");
00105     if (upper) {
00106         i__1 = *n;
00107         for (j = 1; j <= i__1; ++j) {
00108             i__2 = j;
00109             for (i__ = 1; i__ <= i__2; ++i__) {
00110                 i__3 = i__ + j * a_dim1;
00111                 i__4 = i__ + j * a_dim1;
00112                 if (a[i__3].r < -rmax || a[i__4].r > rmax || d_imag(&a[i__ + 
00113                         j * a_dim1]) < -rmax || d_imag(&a[i__ + j * a_dim1]) 
00114                         > rmax) {
00115                     *info = 1;
00116                     goto L50;
00117                 }
00118                 i__3 = i__ + j * sa_dim1;
00119                 i__4 = i__ + j * a_dim1;
00120                 sa[i__3].r = a[i__4].r, sa[i__3].i = a[i__4].i;
00121 /* L10: */
00122             }
00123 /* L20: */
00124         }
00125     } else {
00126         i__1 = *n;
00127         for (j = 1; j <= i__1; ++j) {
00128             i__2 = *n;
00129             for (i__ = j; i__ <= i__2; ++i__) {
00130                 i__3 = i__ + j * a_dim1;
00131                 i__4 = i__ + j * a_dim1;
00132                 if (a[i__3].r < -rmax || a[i__4].r > rmax || d_imag(&a[i__ + 
00133                         j * a_dim1]) < -rmax || d_imag(&a[i__ + j * a_dim1]) 
00134                         > rmax) {
00135                     *info = 1;
00136                     goto L50;
00137                 }
00138                 i__3 = i__ + j * sa_dim1;
00139                 i__4 = i__ + j * a_dim1;
00140                 sa[i__3].r = a[i__4].r, sa[i__3].i = a[i__4].i;
00141 /* L30: */
00142             }
00143 /* L40: */
00144         }
00145     }
00146 L50:
00147 
00148     return 0;
00149 
00150 /*     End of ZLAT2C */
00151 
00152 } /* zlat2c_ */


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