OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches

Functions

subroutine zheswapr (uplo, n, a, lda, i1, i2)
 ZHESWAPR applies an elementary permutation on the rows and columns of a Hermitian matrix.
double precision function zlanhe (norm, uplo, n, a, lda, work)
 ZLANHE returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex Hermitian matrix.
subroutine zlaqhe (uplo, n, a, lda, s, scond, amax, equed)
 ZLAQHE scales a Hermitian matrix.

Detailed Description

This is the group of complex16 auxiliary functions for HE matrices

Function Documentation

◆ zheswapr()

subroutine zheswapr ( character uplo,
integer n,
complex*16, dimension( lda, n ) a,
integer lda,
integer i1,
integer i2 )

ZHESWAPR applies an elementary permutation on the rows and columns of a Hermitian matrix.

Download ZHESWAPR + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> ZHESWAPR applies an elementary permutation on the rows and the columns of
!> a hermitian matrix.
!> 
Parameters
[in]UPLO
!>          UPLO is CHARACTER*1
!>          Specifies whether the details of the factorization are stored
!>          as an upper or lower triangular matrix.
!>          = 'U':  Upper triangular, form is A = U*D*U**T;
!>          = 'L':  Lower triangular, form is A = L*D*L**T.
!> 
[in]N
!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.
!> 
[in,out]A
!>          A is COMPLEX*16 array, dimension (LDA,N)
!>          On entry, the NB diagonal matrix D and the multipliers
!>          used to obtain the factor U or L as computed by CSYTRF.
!>
!>          On exit, if INFO = 0, the (symmetric) inverse of the original
!>          matrix.  If UPLO = 'U', the upper triangular part of the
!>          inverse is formed and the part of A below the diagonal is not
!>          referenced; if UPLO = 'L' the lower triangular part of the
!>          inverse is formed and the part of A above the diagonal is
!>          not referenced.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,N).
!> 
[in]I1
!>          I1 is INTEGER
!>          Index of the first row to swap
!> 
[in]I2
!>          I2 is INTEGER
!>          Index of the second row to swap
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 101 of file zheswapr.f.

102*
103* -- LAPACK auxiliary routine --
104* -- LAPACK is a software package provided by Univ. of Tennessee, --
105* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
106*
107* .. Scalar Arguments ..
108 CHARACTER UPLO
109 INTEGER I1, I2, LDA, N
110* ..
111* .. Array Arguments ..
112 COMPLEX*16 A( LDA, N )
113*
114* =====================================================================
115*
116* ..
117* .. Local Scalars ..
118 LOGICAL UPPER
119 INTEGER I
120 COMPLEX*16 TMP
121*
122* .. External Functions ..
123 LOGICAL LSAME
124 EXTERNAL lsame
125* ..
126* .. External Subroutines ..
127 EXTERNAL zswap
128* ..
129* .. Executable Statements ..
130*
131 upper = lsame( uplo, 'U' )
132 IF (upper) THEN
133*
134* UPPER
135* first swap
136* - swap column I1 and I2 from I1 to I1-1
137 CALL zswap( i1-1, a(1,i1), 1, a(1,i2), 1 )
138*
139* second swap :
140* - swap A(I1,I1) and A(I2,I2)
141* - swap row I1 from I1+1 to I2-1 with col I2 from I1+1 to I2-1
142* - swap A(I2,I1) and A(I1,I2)
143
144 tmp=a(i1,i1)
145 a(i1,i1)=a(i2,i2)
146 a(i2,i2)=tmp
147*
148 DO i=1,i2-i1-1
149 tmp=a(i1,i1+i)
150 a(i1,i1+i)=dconjg(a(i1+i,i2))
151 a(i1+i,i2)=dconjg(tmp)
152 END DO
153*
154 a(i1,i2)=dconjg(a(i1,i2))
155
156*
157* third swap
158* - swap row I1 and I2 from I2+1 to N
159 DO i=i2+1,n
160 tmp=a(i1,i)
161 a(i1,i)=a(i2,i)
162 a(i2,i)=tmp
163 END DO
164*
165 ELSE
166*
167* LOWER
168* first swap
169* - swap row I1 and I2 from 1 to I1-1
170 CALL zswap ( i1-1, a(i1,1), lda, a(i2,1), lda )
171*
172* second swap :
173* - swap A(I1,I1) and A(I2,I2)
174* - swap col I1 from I1+1 to I2-1 with row I2 from I1+1 to I2-1
175* - swap A(I2,I1) and A(I1,I2)
176
177 tmp=a(i1,i1)
178 a(i1,i1)=a(i2,i2)
179 a(i2,i2)=tmp
180*
181 DO i=1,i2-i1-1
182 tmp=a(i1+i,i1)
183 a(i1+i,i1)=dconjg(a(i2,i1+i))
184 a(i2,i1+i)=dconjg(tmp)
185 END DO
186*
187 a(i2,i1)=dconjg(a(i2,i1))
188*
189* third swap
190* - swap col I1 and I2 from I2+1 to N
191 DO i=i2+1,n
192 tmp=a(i,i1)
193 a(i,i1)=a(i,i2)
194 a(i,i2)=tmp
195 END DO
196*
197 ENDIF
198
logical function lsame(ca, cb)
LSAME
Definition lsame.f:53
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP
Definition zswap.f:81

◆ zlanhe()

double precision function zlanhe ( character norm,
character uplo,
integer n,
complex*16, dimension( lda, * ) a,
integer lda,
double precision, dimension( * ) work )

ZLANHE returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex Hermitian matrix.

Download ZLANHE + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> ZLANHE  returns the value of the one norm,  or the Frobenius norm, or
!> the  infinity norm,  or the  element of  largest absolute value  of a
!> complex hermitian matrix A.
!> 
Returns
ZLANHE
!>
!>    ZLANHE = ( max(abs(A(i,j))), NORM = 'M' or 'm'
!>             (
!>             ( norm1(A),         NORM = '1', 'O' or 'o'
!>             (
!>             ( normI(A),         NORM = 'I' or 'i'
!>             (
!>             ( normF(A),         NORM = 'F', 'f', 'E' or 'e'
!>
!> where  norm1  denotes the  one norm of a matrix (maximum column sum),
!> normI  denotes the  infinity norm  of a matrix  (maximum row sum) and
!> normF  denotes the  Frobenius norm of a matrix (square root of sum of
!> squares).  Note that  max(abs(A(i,j)))  is not a consistent matrix norm.
!> 
Parameters
[in]NORM
!>          NORM is CHARACTER*1
!>          Specifies the value to be returned in ZLANHE as described
!>          above.
!> 
[in]UPLO
!>          UPLO is CHARACTER*1
!>          Specifies whether the upper or lower triangular part of the
!>          hermitian matrix A is to be referenced.
!>          = 'U':  Upper triangular part of A is referenced
!>          = 'L':  Lower triangular part of A is referenced
!> 
[in]N
!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.  When N = 0, ZLANHE is
!>          set to zero.
!> 
[in]A
!>          A is COMPLEX*16 array, dimension (LDA,N)
!>          The hermitian matrix A.  If UPLO = 'U', the leading n by n
!>          upper triangular part of A contains the upper triangular part
!>          of the matrix A, and the strictly lower triangular part of A
!>          is not referenced.  If UPLO = 'L', the leading n by n lower
!>          triangular part of A contains the lower triangular part of
!>          the matrix A, and the strictly upper triangular part of A is
!>          not referenced. Note that the imaginary parts of the diagonal
!>          elements need not be set and are assumed to be zero.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(N,1).
!> 
[out]WORK
!>          WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)),
!>          where LWORK >= N when NORM = 'I' or '1' or 'O'; otherwise,
!>          WORK is not referenced.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 123 of file zlanhe.f.

124*
125* -- LAPACK auxiliary routine --
126* -- LAPACK is a software package provided by Univ. of Tennessee, --
127* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
128*
129* .. Scalar Arguments ..
130 CHARACTER NORM, UPLO
131 INTEGER LDA, N
132* ..
133* .. Array Arguments ..
134 DOUBLE PRECISION WORK( * )
135 COMPLEX*16 A( LDA, * )
136* ..
137*
138* =====================================================================
139*
140* .. Parameters ..
141 DOUBLE PRECISION ONE, ZERO
142 parameter( one = 1.0d+0, zero = 0.0d+0 )
143* ..
144* .. Local Scalars ..
145 INTEGER I, J
146 DOUBLE PRECISION ABSA, SCALE, SUM, VALUE
147* ..
148* .. External Functions ..
149 LOGICAL LSAME, DISNAN
150 EXTERNAL lsame, disnan
151* ..
152* .. External Subroutines ..
153 EXTERNAL zlassq
154* ..
155* .. Intrinsic Functions ..
156 INTRINSIC abs, dble, sqrt
157* ..
158* .. Executable Statements ..
159*
160 IF( n.EQ.0 ) THEN
161 VALUE = zero
162 ELSE IF( lsame( norm, 'M' ) ) THEN
163*
164* Find max(abs(A(i,j))).
165*
166 VALUE = zero
167 IF( lsame( uplo, 'U' ) ) THEN
168 DO 20 j = 1, n
169 DO 10 i = 1, j - 1
170 sum = abs( a( i, j ) )
171 IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
172 10 CONTINUE
173 sum = abs( dble( a( j, j ) ) )
174 IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
175 20 CONTINUE
176 ELSE
177 DO 40 j = 1, n
178 sum = abs( dble( a( j, j ) ) )
179 IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
180 DO 30 i = j + 1, n
181 sum = abs( a( i, j ) )
182 IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
183 30 CONTINUE
184 40 CONTINUE
185 END IF
186 ELSE IF( ( lsame( norm, 'I' ) ) .OR. ( lsame( norm, 'O' ) ) .OR.
187 $ ( norm.EQ.'1' ) ) THEN
188*
189* Find normI(A) ( = norm1(A), since A is hermitian).
190*
191 VALUE = zero
192 IF( lsame( uplo, 'U' ) ) THEN
193 DO 60 j = 1, n
194 sum = zero
195 DO 50 i = 1, j - 1
196 absa = abs( a( i, j ) )
197 sum = sum + absa
198 work( i ) = work( i ) + absa
199 50 CONTINUE
200 work( j ) = sum + abs( dble( a( j, j ) ) )
201 60 CONTINUE
202 DO 70 i = 1, n
203 sum = work( i )
204 IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
205 70 CONTINUE
206 ELSE
207 DO 80 i = 1, n
208 work( i ) = zero
209 80 CONTINUE
210 DO 100 j = 1, n
211 sum = work( j ) + abs( dble( a( j, j ) ) )
212 DO 90 i = j + 1, n
213 absa = abs( a( i, j ) )
214 sum = sum + absa
215 work( i ) = work( i ) + absa
216 90 CONTINUE
217 IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
218 100 CONTINUE
219 END IF
220 ELSE IF( ( lsame( norm, 'F' ) ) .OR. ( lsame( norm, 'E' ) ) ) THEN
221*
222* Find normF(A).
223*
224 scale = zero
225 sum = one
226 IF( lsame( uplo, 'U' ) ) THEN
227 DO 110 j = 2, n
228 CALL zlassq( j-1, a( 1, j ), 1, scale, sum )
229 110 CONTINUE
230 ELSE
231 DO 120 j = 1, n - 1
232 CALL zlassq( n-j, a( j+1, j ), 1, scale, sum )
233 120 CONTINUE
234 END IF
235 sum = 2*sum
236 DO 130 i = 1, n
237 IF( dble( a( i, i ) ).NE.zero ) THEN
238 absa = abs( dble( a( i, i ) ) )
239 IF( scale.LT.absa ) THEN
240 sum = one + sum*( scale / absa )**2
241 scale = absa
242 ELSE
243 sum = sum + ( absa / scale )**2
244 END IF
245 END IF
246 130 CONTINUE
247 VALUE = scale*sqrt( sum )
248 END IF
249*
250 zlanhe = VALUE
251 RETURN
252*
253* End of ZLANHE
254*
norm(diag(diag(diag(inv(mat))) -id.SOL), 2) % destroy mumps instance id.JOB
subroutine zlassq(n, x, incx, scl, sumsq)
ZLASSQ updates a sum of squares represented in scaled form.
Definition zlassq.f90:137
logical function disnan(din)
DISNAN tests input for NaN.
Definition disnan.f:59
double precision function zlanhe(norm, uplo, n, a, lda, work)
ZLANHE returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
Definition zlanhe.f:124

◆ zlaqhe()

subroutine zlaqhe ( character uplo,
integer n,
complex*16, dimension( lda, * ) a,
integer lda,
double precision, dimension( * ) s,
double precision scond,
double precision amax,
character equed )

ZLAQHE scales a Hermitian matrix.

Download ZLAQHE + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> ZLAQHE equilibrates a Hermitian matrix A using the scaling factors
!> in the vector S.
!> 
Parameters
[in]UPLO
!>          UPLO is CHARACTER*1
!>          Specifies whether the upper or lower triangular part of the
!>          Hermitian matrix A is stored.
!>          = 'U':  Upper triangular
!>          = 'L':  Lower triangular
!> 
[in]N
!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.
!> 
[in,out]A
!>          A is COMPLEX*16 array, dimension (LDA,N)
!>          On entry, the Hermitian matrix A.  If UPLO = 'U', the leading
!>          n by n upper triangular part of A contains the upper
!>          triangular part of the matrix A, and the strictly lower
!>          triangular part of A is not referenced.  If UPLO = 'L', the
!>          leading n by n lower triangular part of A contains the lower
!>          triangular part of the matrix A, and the strictly upper
!>          triangular part of A is not referenced.
!>
!>          On exit, if EQUED = 'Y', the equilibrated matrix:
!>          diag(S) * A * diag(S).
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(N,1).
!> 
[in]S
!>          S is DOUBLE PRECISION array, dimension (N)
!>          The scale factors for A.
!> 
[in]SCOND
!>          SCOND is DOUBLE PRECISION
!>          Ratio of the smallest S(i) to the largest S(i).
!> 
[in]AMAX
!>          AMAX is DOUBLE PRECISION
!>          Absolute value of largest matrix entry.
!> 
[out]EQUED
!>          EQUED is CHARACTER*1
!>          Specifies whether or not equilibration was done.
!>          = 'N':  No equilibration.
!>          = 'Y':  Equilibration was done, i.e., A has been replaced by
!>                  diag(S) * A * diag(S).
!> 
Internal Parameters:
!>  THRESH is a threshold value used to decide if scaling should be done
!>  based on the ratio of the scaling factors.  If SCOND < THRESH,
!>  scaling is done.
!>
!>  LARGE and SMALL are threshold values used to decide if scaling should
!>  be done based on the absolute size of the largest matrix element.
!>  If AMAX > LARGE or AMAX < SMALL, scaling is done.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 133 of file zlaqhe.f.

134*
135* -- LAPACK auxiliary routine --
136* -- LAPACK is a software package provided by Univ. of Tennessee, --
137* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
138*
139* .. Scalar Arguments ..
140 CHARACTER EQUED, UPLO
141 INTEGER LDA, N
142 DOUBLE PRECISION AMAX, SCOND
143* ..
144* .. Array Arguments ..
145 DOUBLE PRECISION S( * )
146 COMPLEX*16 A( LDA, * )
147* ..
148*
149* =====================================================================
150*
151* .. Parameters ..
152 DOUBLE PRECISION ONE, THRESH
153 parameter( one = 1.0d+0, thresh = 0.1d+0 )
154* ..
155* .. Local Scalars ..
156 INTEGER I, J
157 DOUBLE PRECISION CJ, LARGE, SMALL
158* ..
159* .. External Functions ..
160 LOGICAL LSAME
161 DOUBLE PRECISION DLAMCH
162 EXTERNAL lsame, dlamch
163* ..
164* .. Intrinsic Functions ..
165 INTRINSIC dble
166* ..
167* .. Executable Statements ..
168*
169* Quick return if possible
170*
171 IF( n.LE.0 ) THEN
172 equed = 'N'
173 RETURN
174 END IF
175*
176* Initialize LARGE and SMALL.
177*
178 small = dlamch( 'Safe minimum' ) / dlamch( 'Precision' )
179 large = one / small
180*
181 IF( scond.GE.thresh .AND. amax.GE.small .AND. amax.LE.large ) THEN
182*
183* No equilibration
184*
185 equed = 'N'
186 ELSE
187*
188* Replace A by diag(S) * A * diag(S).
189*
190 IF( lsame( uplo, 'U' ) ) THEN
191*
192* Upper triangle of A is stored.
193*
194 DO 20 j = 1, n
195 cj = s( j )
196 DO 10 i = 1, j - 1
197 a( i, j ) = cj*s( i )*a( i, j )
198 10 CONTINUE
199 a( j, j ) = cj*cj*dble( a( j, j ) )
200 20 CONTINUE
201 ELSE
202*
203* Lower triangle of A is stored.
204*
205 DO 40 j = 1, n
206 cj = s( j )
207 a( j, j ) = cj*cj*dble( a( j, j ) )
208 DO 30 i = j + 1, n
209 a( i, j ) = cj*s( i )*a( i, j )
210 30 CONTINUE
211 40 CONTINUE
212 END IF
213 equed = 'Y'
214 END IF
215*
216 RETURN
217*
218* End of ZLAQHE
219*
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69