LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
dlag2s.f
Go to the documentation of this file.
1 *> \brief \b DLAG2S converts a double precision matrix to a single precision matrix.
2 *
3 * =========== DOCUMENTATION ===========
4 *
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
7 *
8 *> \htmlonly
9 *> Download DLAG2S + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlag2s.f">
11 *> [TGZ]</a>
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlag2s.f">
13 *> [ZIP]</a>
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlag2s.f">
15 *> [TXT]</a>
16 *> \endhtmlonly
17 *
18 * Definition:
19 * ===========
20 *
21 * SUBROUTINE DLAG2S( M, N, A, LDA, SA, LDSA, INFO )
22 *
23 * .. Scalar Arguments ..
24 * INTEGER INFO, LDA, LDSA, M, N
25 * ..
26 * .. Array Arguments ..
27 * REAL SA( LDSA, * )
28 * DOUBLE PRECISION A( LDA, * )
29 * ..
30 *
31 *
32 *> \par Purpose:
33 * =============
34 *>
35 *> \verbatim
36 *>
37 *> DLAG2S converts a DOUBLE PRECISION matrix, SA, to a SINGLE
38 *> PRECISION matrix, A.
39 *>
40 *> RMAX is the overflow for the SINGLE PRECISION arithmetic
41 *> DLAG2S checks that all the entries of A are between -RMAX and
42 *> RMAX. If not the convertion is aborted and a flag is raised.
43 *>
44 *> This is an auxiliary routine so there is no argument checking.
45 *> \endverbatim
46 *
47 * Arguments:
48 * ==========
49 *
50 *> \param[in] M
51 *> \verbatim
52 *> M is INTEGER
53 *> The number of lines of the matrix A. M >= 0.
54 *> \endverbatim
55 *>
56 *> \param[in] N
57 *> \verbatim
58 *> N is INTEGER
59 *> The number of columns of the matrix A. N >= 0.
60 *> \endverbatim
61 *>
62 *> \param[in] A
63 *> \verbatim
64 *> A is DOUBLE PRECISION array, dimension (LDA,N)
65 *> On entry, the M-by-N coefficient matrix A.
66 *> \endverbatim
67 *>
68 *> \param[in] LDA
69 *> \verbatim
70 *> LDA is INTEGER
71 *> The leading dimension of the array A. LDA >= max(1,M).
72 *> \endverbatim
73 *>
74 *> \param[out] SA
75 *> \verbatim
76 *> SA is REAL array, dimension (LDSA,N)
77 *> On exit, if INFO=0, the M-by-N coefficient matrix SA; if
78 *> INFO>0, the content of SA is unspecified.
79 *> \endverbatim
80 *>
81 *> \param[in] LDSA
82 *> \verbatim
83 *> LDSA is INTEGER
84 *> The leading dimension of the array SA. LDSA >= max(1,M).
85 *> \endverbatim
86 *>
87 *> \param[out] INFO
88 *> \verbatim
89 *> INFO is INTEGER
90 *> = 0: successful exit.
91 *> = 1: an entry of the matrix A is greater than the SINGLE
92 *> PRECISION overflow threshold, in this case, the content
93 *> of SA in exit is unspecified.
94 *> \endverbatim
95 *
96 * Authors:
97 * ========
98 *
99 *> \author Univ. of Tennessee
100 *> \author Univ. of California Berkeley
101 *> \author Univ. of Colorado Denver
102 *> \author NAG Ltd.
103 *
104 *> \date September 2012
105 *
106 *> \ingroup doubleOTHERauxiliary
107 *
108 * =====================================================================
109  SUBROUTINE dlag2s( M, N, A, LDA, SA, LDSA, INFO )
110 *
111 * -- LAPACK auxiliary routine (version 3.4.2) --
112 * -- LAPACK is a software package provided by Univ. of Tennessee, --
113 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
114 * September 2012
115 *
116 * .. Scalar Arguments ..
117  INTEGER INFO, LDA, LDSA, M, N
118 * ..
119 * .. Array Arguments ..
120  REAL SA( ldsa, * )
121  DOUBLE PRECISION A( lda, * )
122 * ..
123 *
124 * =====================================================================
125 *
126 * .. Local Scalars ..
127  INTEGER I, J
128  DOUBLE PRECISION RMAX
129 * ..
130 * .. External Functions ..
131  REAL SLAMCH
132  EXTERNAL slamch
133 * ..
134 * .. Executable Statements ..
135 *
136  rmax = slamch( 'O' )
137  DO 20 j = 1, n
138  DO 10 i = 1, m
139  IF( ( a( i, j ).LT.-rmax ) .OR. ( a( i, j ).GT.rmax ) ) THEN
140  info = 1
141  GO TO 30
142  END IF
143  sa( i, j ) = a( i, j )
144  10 CONTINUE
145  20 CONTINUE
146  info = 0
147  30 CONTINUE
148  RETURN
149 *
150 * End of DLAG2S
151 *
152  END
subroutine dlag2s(M, N, A, LDA, SA, LDSA, INFO)
DLAG2S converts a double precision matrix to a single precision matrix.
Definition: dlag2s.f:110