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