LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ cqrt13()

subroutine cqrt13 ( integer  SCALE,
integer  M,
integer  N,
complex, dimension( lda, * )  A,
integer  LDA,
real  NORMA,
integer, dimension( 4 )  ISEED 
)

CQRT13

Purpose:
 CQRT13 generates a full-rank matrix that may be scaled to have large
 or small norm.
Parameters
[in]SCALE
          SCALE is INTEGER
          SCALE = 1: normally scaled matrix
          SCALE = 2: matrix scaled up
          SCALE = 3: matrix scaled down
[in]M
          M is INTEGER
          The number of rows of the matrix A.
[in]N
          N is INTEGER
          The number of columns of A.
[out]A
          A is COMPLEX array, dimension (LDA,N)
          The M-by-N matrix A.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.
[out]NORMA
          NORMA is REAL
          The one-norm of A.
[in,out]ISEED
          ISEED is integer array, dimension (4)
          Seed for random number generator
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 93 of file cqrt13.f.

93 *
94 * -- LAPACK test routine (version 3.7.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 * December 2016
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 *
real function scasum(N, CX, INCX)
SCASUM
Definition: scasum.f:74
subroutine clarnv(IDIST, ISEED, N, X)
CLARNV returns a vector of random numbers from a uniform or normal distribution.
Definition: clarnv.f:101
subroutine clascl(TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)
CLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
Definition: clascl.f:145
real function clange(NORM, M, N, A, LDA, WORK)
CLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: clange.f:117
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
subroutine slabad(SMALL, LARGE)
SLABAD
Definition: slabad.f:76
Here is the call graph for this function:
Here is the caller graph for this function: