LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ sqrt13()

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

SQRT13

Purpose:
 SQRT13 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 REAL 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 sqrt13.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  REAL 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 sasum, slamch, slange
120  EXTERNAL sasum, slamch, slange
121 * ..
122 * .. External Subroutines ..
123  EXTERNAL slabad, slarnv, slascl
124 * ..
125 * .. Intrinsic Functions ..
126  INTRINSIC 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 slarnv( 2, iseed, m, a( 1, j ) )
140  IF( j.LE.m ) THEN
141  a( j, j ) = a( j, j ) + sign( sasum( m, a( 1, j ), 1 ),
142  $ a( j, j ) )
143  END IF
144  10 CONTINUE
145 *
146 * scaled versions
147 *
148  IF( scale.NE.1 ) THEN
149  norma = slange( '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 slascl( '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 slascl( 'General', 0, 0, norma, smlnum, m, n, a, lda,
167  $ info )
168  END IF
169  END IF
170 *
171  norma = slange( 'One-norm', m, n, a, lda, dummy )
172  RETURN
173 *
174 * End of SQRT13
175 *
real function slange(NORM, M, N, A, LDA, WORK)
SLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: slange.f:116
real function sasum(N, SX, INCX)
SASUM
Definition: sasum.f:74
subroutine slascl(TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)
SLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
Definition: slascl.f:145
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
subroutine slabad(SMALL, LARGE)
SLABAD
Definition: slabad.f:76
subroutine slarnv(IDIST, ISEED, N, X)
SLARNV returns a vector of random numbers from a uniform or normal distribution.
Definition: slarnv.f:99
Here is the call graph for this function:
Here is the caller graph for this function: