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


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