1. in lapack_atlas.f: recently added zgbtrf requires missing zlaswp

2. in invmat.f90: it is better to put the most common branch first
LP


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4952 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
paulatto 2008-05-29 12:15:46 +00:00
parent 42cce95773
commit 7478e02134
2 changed files with 125 additions and 3 deletions

View File

@ -36,13 +36,14 @@ subroutine invmat (n, a, a_inv, da)
call DGETRI (n, a_inv, lda, ipiv, work, lwork, info)
call errore ('invmat', 'error in DGETRI', abs (info) )
!
if (n == 3) then
if (n /= 3) then
da = 0.d0
return
else
da = a(1,1)*(a(2,2)*a(3,3)-a(2,3)*a(3,2)) + &
a(1,2)*(a(2,3)*a(3,1)-a(2,1)*a(3,3)) + &
a(1,3)*(a(2,1)*a(3,2)-a(3,1)*a(2,2))
IF (ABS(da) < 1.d-10) CALL errore(' invmat ',' singular matrix ', 1)
else
da = 0.d0
end if
return

View File

@ -53311,5 +53311,126 @@ CIBM PREFER SCALAR
*
END
SUBROUTINE ZLASWP( N, A, LDA, K1, K2, IPIV, INCX )
*
* -- LAPACK auxiliary routine (version 3.1) --
* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
* November 2006
*
* .. Scalar Arguments ..
INTEGER INCX, K1, K2, LDA, N
* ..
* .. Array Arguments ..
INTEGER IPIV( * )
COMPLEX*16 A( LDA, * )
* ..
*
* Purpose
* =======
*
* ZLASWP performs a series of row interchanges on the matrix A.
* One row interchange is initiated for each of rows K1 through K2 of A.
*
* Arguments
* =========
*
* N (input) INTEGER
* The number of columns of the matrix A.
*
* A (input/output) COMPLEX*16 array, dimension (LDA,N)
* On entry, the matrix of column dimension N to which the row
* interchanges will be applied.
* On exit, the permuted matrix.
*
* LDA (input) INTEGER
* The leading dimension of the array A.
*
* K1 (input) INTEGER
* The first element of IPIV for which a row interchange will
* be done.
*
* K2 (input) INTEGER
* The last element of IPIV for which a row interchange will
* be done.
*
* IPIV (input) INTEGER array, dimension (K2*abs(INCX))
* The vector of pivot indices. Only the elements in positions
* K1 through K2 of IPIV are accessed.
* IPIV(K) = L implies rows K and L are to be interchanged.
*
* INCX (input) INTEGER
* The increment between successive values of IPIV. If IPIV
* is negative, the pivots are applied in reverse order.
*
* Further Details
* ===============
*
* Modified by
* R. C. Whaley, Computer Science Dept., Univ. of Tenn., Knoxville, USA
*
* =====================================================================
*
* .. Local Scalars ..
INTEGER I, I1, I2, INC, IP, IX, IX0, J, K, N32
COMPLEX*16 TEMP
* ..
* .. Executable Statements ..
*
* Interchange row I with row IPIV(I) for each of rows K1 through K2.
*
IF( INCX.GT.0 ) THEN
IX0 = K1
I1 = K1
I2 = K2
INC = 1
ELSE IF( INCX.LT.0 ) THEN
IX0 = 1 + ( 1-K2 )*INCX
I1 = K2
I2 = K1
INC = -1
ELSE
RETURN
END IF
*
N32 = ( N / 32 )*32
IF( N32.NE.0 ) THEN
DO 30 J = 1, N32, 32
IX = IX0
DO 20 I = I1, I2, INC
IP = IPIV( IX )
IF( IP.NE.I ) THEN
DO 10 K = J, J + 31
TEMP = A( I, K )
A( I, K ) = A( IP, K )
A( IP, K ) = TEMP
10 CONTINUE
END IF
IX = IX + INCX
20 CONTINUE
30 CONTINUE
END IF
IF( N32.NE.N ) THEN
N32 = N32 + 1
IX = IX0
DO 50 I = I1, I2, INC
IP = IPIV( IX )
IF( IP.NE.I ) THEN
DO 40 K = N32, N
TEMP = A( I, K )
A( I, K ) = A( IP, K )
A( IP, K ) = TEMP
40 CONTINUE
END IF
IX = IX + INCX
50 CONTINUE
END IF
*
RETURN
*
* End of ZLASWP
*
END
* end these routines for w90 *