LAPACK 3.3.0

dlag2s.f

Go to the documentation of this file.
00001       SUBROUTINE DLAG2S( M, N, A, LDA, SA, LDSA, INFO )
00002 *
00003 *  -- LAPACK PROTOTYPE auxiliary routine (version 3.1.2) --
00004 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00005 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00006 *     August 2007
00007 *
00008 *     ..
00009 *     .. Scalar Arguments ..
00010       INTEGER            INFO, LDA, LDSA, M, N
00011 *     ..
00012 *     .. Array Arguments ..
00013       REAL               SA( LDSA, * )
00014       DOUBLE PRECISION   A( LDA, * )
00015 *     ..
00016 *
00017 *  Purpose
00018 *  =======
00019 *
00020 *  DLAG2S converts a DOUBLE PRECISION matrix, SA, to a SINGLE
00021 *  PRECISION matrix, A.
00022 *
00023 *  RMAX is the overflow for the SINGLE PRECISION arithmetic
00024 *  DLAG2S checks that all the entries of A are between -RMAX and
00025 *  RMAX. If not the convertion is aborted and a flag is raised.
00026 *
00027 *  This is an auxiliary routine so there is no argument checking.
00028 *
00029 *  Arguments
00030 *  =========
00031 *
00032 *  M       (input) INTEGER
00033 *          The number of lines of the matrix A.  M >= 0.
00034 *
00035 *  N       (input) INTEGER
00036 *          The number of columns of the matrix A.  N >= 0.
00037 *
00038 *  A       (input) DOUBLE PRECISION array, dimension (LDA,N)
00039 *          On entry, the M-by-N coefficient matrix A.
00040 *
00041 *  LDA     (input) INTEGER
00042 *          The leading dimension of the array A.  LDA >= max(1,M).
00043 *
00044 *  SA      (output) REAL array, dimension (LDSA,N)
00045 *          On exit, if INFO=0, the M-by-N coefficient matrix SA; if
00046 *          INFO>0, the content of SA is unspecified.
00047 *
00048 *  LDSA    (input) INTEGER
00049 *          The leading dimension of the array SA.  LDSA >= max(1,M).
00050 *
00051 *  INFO    (output) INTEGER
00052 *          = 0:  successful exit.
00053 *          = 1:  an entry of the matrix A is greater than the SINGLE
00054 *                PRECISION overflow threshold, in this case, the content
00055 *                of SA in exit is unspecified.
00056 *
00057 *  =========
00058 *
00059 *     .. Local Scalars ..
00060       INTEGER            I, J
00061       DOUBLE PRECISION   RMAX
00062 *     ..
00063 *     .. External Functions ..
00064       REAL               SLAMCH
00065       EXTERNAL           SLAMCH
00066 *     ..
00067 *     .. Executable Statements ..
00068 *
00069       RMAX = SLAMCH( 'O' )
00070       DO 20 J = 1, N
00071          DO 10 I = 1, M
00072             IF( ( A( I, J ).LT.-RMAX ) .OR. ( A( I, J ).GT.RMAX ) ) THEN
00073                INFO = 1
00074                GO TO 30
00075             END IF
00076             SA( I, J ) = A( I, J )
00077    10    CONTINUE
00078    20 CONTINUE
00079       INFO = 0
00080    30 CONTINUE
00081       RETURN
00082 *
00083 *     End of DLAG2S
00084 *
00085       END
 All Files Functions