summaryrefslogtreecommitdiff
path: root/SRC/chesv.f
diff options
context:
space:
mode:
authorjulie <julielangou@users.noreply.github.com>2011-02-09 19:45:09 +0000
committerjulie <julielangou@users.noreply.github.com>2011-02-09 19:45:09 +0000
commit1653528c2b12fdd01738b55ab82ffbe47049c0ba (patch)
tree083876df2737892f51272a0eeb5aed7345a71530 /SRC/chesv.f
parent25a1c9440f7dfdbb57263f769a0fa096c78dbf18 (diff)
downloadlapack-1653528c2b12fdd01738b55ab82ffbe47049c0ba.tar.gz
lapack-1653528c2b12fdd01738b55ab82ffbe47049c0ba.tar.bz2
lapack-1653528c2b12fdd01738b55ab82ffbe47049c0ba.zip
Fix bug 0074
Post from Alexander Kobotov (INTEL) In LAPACK 3.3 ?(SY/HE)SV are updated to use TRS2. The TRS2 requires WORK(N) to operate, whereas in SV requirements for LWORK just to be >=1. There is no any check in SV if LWORK>=N, the array WORK just passed as it is to TRS2. So if LWORK<N a crash could occur while executing TRS2 due to overuse of allocated workspace. I guess for the case of LWORK<N just previsous Level2 based ?(SY/HE)TRS should be used.
Diffstat (limited to 'SRC/chesv.f')
-rw-r--r--SRC/chesv.f25
1 files changed, 20 insertions, 5 deletions
diff --git a/SRC/chesv.f b/SRC/chesv.f
index 4e41de7b..7fe3efcd 100644
--- a/SRC/chesv.f
+++ b/SRC/chesv.f
@@ -4,7 +4,8 @@
* -- LAPACK driver routine (version 3.3.0) --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
-* November 2010
+* February 2011
+* @generated c
*
* .. Scalar Arguments ..
CHARACTER UPLO
@@ -27,7 +28,7 @@
* A = U * D * U**H, if UPLO = 'U', or
* A = L * D * L**H, if UPLO = 'L',
* where U (or L) is a product of permutation and unit upper (lower)
-* triangular matrices, and D is Hermitian and block diagonal with
+* triangular matrices, and D is Hermitian and block diagonal with
* 1-by-1 and 2-by-2 diagonal blocks. The factored form of A is then
* used to solve the system of equations A * X = B.
*
@@ -88,6 +89,8 @@
* The length of WORK. LWORK >= 1, and for best performance
* LWORK >= max(1,N*NB), where NB is the optimal blocksize for
* CHETRF.
+* for LWORK < N, TRS will be done with Level BLAS 2
+* for LWORK >= N, TRS will be done with Level BLAS 3
*
* If LWORK = -1, then a workspace query is assumed; the routine
* only calculates the optimal size of the WORK array, returns
@@ -110,10 +113,10 @@
* .. External Functions ..
LOGICAL LSAME
INTEGER ILAENV
- EXTERNAL ILAENV, LSAME
+ EXTERNAL LSAME, ILAENV
* ..
* .. External Subroutines ..
- EXTERNAL CHETRF, CHETRS2, XERBLA
+ EXTERNAL XERBLA, CHETRF, ZHETRS, CHETRS2
* ..
* .. Intrinsic Functions ..
INTRINSIC MAX
@@ -162,7 +165,19 @@
*
* Solve the system A*X = B, overwriting B with X.
*
- CALL CHETRS2( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, INFO )
+ IF ( LWORK.LT.N ) THEN
+*
+* Solve with TRS ( Use Level BLAS 2)
+*
+ CALL ZHETRS( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO )
+*
+ ELSE
+*
+* Solve with TRS2 ( Use Level BLAS 3)
+*
+ CALL CHETRS2( UPLO,N,NRHS,A,LDA,IPIV,B,LDB,WORK,INFO )
+*
+ END IF
*
END IF
*