LAPACK  3.4.2
LAPACK: Linear Algebra PACKage
 All Files Functions Groups
cqrt13.f
Go to the documentation of this file.
1 *> \brief \b CQRT13
2 *
3 * =========== DOCUMENTATION ===========
4 *
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
7 *
8 * Definition:
9 * ===========
10 *
11 * SUBROUTINE CQRT13( SCALE, M, N, A, LDA, NORMA, ISEED )
12 *
13 * .. Scalar Arguments ..
14 * INTEGER LDA, M, N, SCALE
15 * REAL NORMA
16 * ..
17 * .. Array Arguments ..
18 * INTEGER ISEED( 4 )
19 * COMPLEX A( LDA, * )
20 * ..
21 *
22 *
23 *> \par Purpose:
24 * =============
25 *>
26 *> \verbatim
27 *>
28 *> CQRT13 generates a full-rank matrix that may be scaled to have large
29 *> or small norm.
30 *> \endverbatim
31 *
32 * Arguments:
33 * ==========
34 *
35 *> \param[in] SCALE
36 *> \verbatim
37 *> SCALE is INTEGER
38 *> SCALE = 1: normally scaled matrix
39 *> SCALE = 2: matrix scaled up
40 *> SCALE = 3: matrix scaled down
41 *> \endverbatim
42 *>
43 *> \param[in] M
44 *> \verbatim
45 *> M is INTEGER
46 *> The number of rows of the matrix A.
47 *> \endverbatim
48 *>
49 *> \param[in] N
50 *> \verbatim
51 *> N is INTEGER
52 *> The number of columns of A.
53 *> \endverbatim
54 *>
55 *> \param[out] A
56 *> \verbatim
57 *> A is COMPLEX array, dimension (LDA,N)
58 *> The M-by-N matrix A.
59 *> \endverbatim
60 *>
61 *> \param[in] LDA
62 *> \verbatim
63 *> LDA is INTEGER
64 *> The leading dimension of the array A.
65 *> \endverbatim
66 *>
67 *> \param[out] NORMA
68 *> \verbatim
69 *> NORMA is REAL
70 *> The one-norm of A.
71 *> \endverbatim
72 *>
73 *> \param[in,out] ISEED
74 *> \verbatim
75 *> ISEED is integer array, dimension (4)
76 *> Seed for random number generator
77 *> \endverbatim
78 *
79 * Authors:
80 * ========
81 *
82 *> \author Univ. of Tennessee
83 *> \author Univ. of California Berkeley
84 *> \author Univ. of Colorado Denver
85 *> \author NAG Ltd.
86 *
87 *> \date November 2011
88 *
89 *> \ingroup complex_lin
90 *
91 * =====================================================================
92  SUBROUTINE cqrt13( SCALE, M, N, A, LDA, NORMA, ISEED )
93 *
94 * -- LAPACK test routine (version 3.4.0) --
95 * -- LAPACK is a software package provided by Univ. of Tennessee, --
96 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
97 * November 2011
98 *
99 * .. Scalar Arguments ..
100  INTEGER lda, m, n, scale
101  REAL norma
102 * ..
103 * .. Array Arguments ..
104  INTEGER iseed( 4 )
105  COMPLEX a( lda, * )
106 * ..
107 *
108 * =====================================================================
109 *
110 * .. Parameters ..
111  REAL one
112  parameter( one = 1.0e0 )
113 * ..
114 * .. Local Scalars ..
115  INTEGER info, j
116  REAL bignum, smlnum
117 * ..
118 * .. External Functions ..
119  REAL clange, scasum, slamch
120  EXTERNAL clange, scasum, slamch
121 * ..
122 * .. External Subroutines ..
123  EXTERNAL clarnv, clascl, slabad
124 * ..
125 * .. Intrinsic Functions ..
126  INTRINSIC cmplx, REAL, sign
127 * ..
128 * .. Local Arrays ..
129  REAL dummy( 1 )
130 * ..
131 * .. Executable Statements ..
132 *
133  IF( m.LE.0 .OR. n.LE.0 )
134  $ return
135 *
136 * benign matrix
137 *
138  DO 10 j = 1, n
139  CALL clarnv( 2, iseed, m, a( 1, j ) )
140  IF( j.LE.m ) THEN
141  a( j, j ) = a( j, j ) + cmplx( sign( scasum( m, a( 1, j ),
142  $ 1 ), REAL( A( J, J ) ) ) )
143  END IF
144  10 continue
145 *
146 * scaled versions
147 *
148  IF( scale.NE.1 ) THEN
149  norma = clange( 'Max', m, n, a, lda, dummy )
150  smlnum = slamch( 'Safe minimum' )
151  bignum = one / smlnum
152  CALL slabad( smlnum, bignum )
153  smlnum = smlnum / slamch( 'Epsilon' )
154  bignum = one / smlnum
155 *
156  IF( scale.EQ.2 ) THEN
157 *
158 * matrix scaled up
159 *
160  CALL clascl( 'General', 0, 0, norma, bignum, m, n, a, lda,
161  $ info )
162  ELSE IF( scale.EQ.3 ) THEN
163 *
164 * matrix scaled down
165 *
166  CALL clascl( 'General', 0, 0, norma, smlnum, m, n, a, lda,
167  $ info )
168  END IF
169  END IF
170 *
171  norma = clange( 'One-norm', m, n, a, lda, dummy )
172  return
173 *
174 * End of CQRT13
175 *
176  END