summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriyamazaki <ic.yamazaki@gmail.com>2017-05-01 18:26:41 (GMT)
committeriyamazaki <ic.yamazaki@gmail.com>2017-05-01 18:26:41 (GMT)
commitb3eb65b2ccabe571411c4bb0c0bc515d1c930812 (patch)
tree360fc2f71aade3f2e65e12d7ba34b5ab791ec450
parentaefe75153596de43210057558301efbebcb3793c (diff)
downloadlapack-b3eb65b2ccabe571411c4bb0c0bc515d1c930812.zip
lapack-b3eb65b2ccabe571411c4bb0c0bc515d1c930812.tar.gz
lapack-b3eb65b2ccabe571411c4bb0c0bc515d1c930812.tar.bz2
fix for issue #141 (how to detect singularity in T).
-rw-r--r--SRC/clahef_aa.f23
-rw-r--r--SRC/clasyf_aa.f22
-rw-r--r--SRC/dlasyf_aa.f22
-rw-r--r--SRC/slasyf_aa.f22
-rw-r--r--SRC/zlahef_aa.f23
-rw-r--r--SRC/zlasyf_aa.f22
6 files changed, 86 insertions, 48 deletions
diff --git a/SRC/clahef_aa.f b/SRC/clahef_aa.f
index f3a9add..1fbe9a4 100644
--- a/SRC/clahef_aa.f
+++ b/SRC/clahef_aa.f
@@ -319,8 +319,8 @@
* Set A(J, J+1) = T(J, J+1)
*
A( K, J+1 ) = WORK( 2 )
- IF( (A( K, J ).EQ.ZERO ) .AND.
- $ ( (J.EQ.M) .OR. (A( K, J+1 ).EQ.ZERO))) THEN
+ IF( (A( K, J ).EQ.ZERO ) .AND. (A( K, J+1 ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( K-1, J ).EQ.ZERO)) ) THEN
IF(INFO .EQ. 0) THEN
INFO = J
END IF
@@ -346,8 +346,11 @@
$ A( K, J+2 ), LDA)
END IF
ELSE
- IF( (A( K, J ).EQ.ZERO) .AND. (INFO.EQ.0) ) THEN
- INFO = J
+ IF( (A( K, J ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J-1, J ).EQ.ZERO)) ) THEN
+ IF (INFO.EQ.0) THEN
+ INFO = J
+ END IF
END IF
END IF
J = J + 1
@@ -473,8 +476,8 @@
* Set A(J+1, J) = T(J+1, J)
*
A( J+1, K ) = WORK( 2 )
- IF( (A( J, K ).EQ.ZERO) .AND.
- $ ( (J.EQ.M) .OR. (A( J+1, K ).EQ.ZERO)) ) THEN
+ IF( (A( J, K ).EQ.ZERO) .AND. (A( J+1, K ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J, K-1 ).EQ.ZERO)) ) THEN
IF (INFO .EQ. 0)
$ INFO = J
END IF
@@ -499,8 +502,12 @@
$ A( J+2, K ), LDA )
END IF
ELSE
- IF( (A( J, K ).EQ.ZERO) .AND. (J.EQ.M)
- $ .AND. (INFO.EQ.0) ) INFO = J
+ IF( (A( J, K ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J, K-1 ).EQ.ZERO)) ) THEN
+ IF (INFO.EQ.0) THEN
+ INFO = J
+ END IF
+ END IF
END IF
J = J + 1
GO TO 30
diff --git a/SRC/clasyf_aa.f b/SRC/clasyf_aa.f
index 860a023..c58cd85 100644
--- a/SRC/clasyf_aa.f
+++ b/SRC/clasyf_aa.f
@@ -315,8 +315,8 @@
* Set A(J, J+1) = T(J, J+1)
*
A( K, J+1 ) = WORK( 2 )
- IF( (A( K, J ).EQ.ZERO ) .AND.
- $ ( (J.EQ.M) .OR. (A( K, J+1 ).EQ.ZERO))) THEN
+ IF( (A( K, J ).EQ.ZERO ) .AND. (A( K, J+1 ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( K-1, J ).EQ.ZERO)) ) THEN
IF(INFO .EQ. 0) THEN
INFO = J
ENDIF
@@ -342,8 +342,11 @@
$ A( K, J+2 ), LDA)
END IF
ELSE
- IF( (A( K, J ).EQ.ZERO) .AND. (INFO.EQ.0) ) THEN
- INFO = J
+ IF( (A( K, J ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J-1, J ).EQ.ZERO)) ) THEN
+ IF (INFO.EQ.0) THEN
+ INFO = J
+ END IF
END IF
END IF
J = J + 1
@@ -465,8 +468,8 @@
* Set A(J+1, J) = T(J+1, J)
*
A( J+1, K ) = WORK( 2 )
- IF( (A( J, K ).EQ.ZERO) .AND.
- $ ( (J.EQ.M) .OR. (A( J+1, K ).EQ.ZERO)) ) THEN
+ IF( (A( J, K ).EQ.ZERO) .AND. (A( J+1, K ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J, K-1 ).EQ.ZERO)) ) THEN
IF (INFO .EQ. 0)
$ INFO = J
END IF
@@ -491,8 +494,11 @@
$ A( J+2, K ), LDA )
END IF
ELSE
- IF( (A( J, K ).EQ.ZERO) .AND. (INFO.EQ.0) ) THEN
- INFO = J
+ IF( (A( J, K ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J, K-1 ).EQ.ZERO)) ) THEN
+ IF (INFO.EQ.0) THEN
+ INFO = J
+ END IF
END IF
END IF
J = J + 1
diff --git a/SRC/dlasyf_aa.f b/SRC/dlasyf_aa.f
index d9550e1..08d7520 100644
--- a/SRC/dlasyf_aa.f
+++ b/SRC/dlasyf_aa.f
@@ -315,8 +315,8 @@
* Set A(J, J+1) = T(J, J+1)
*
A( K, J+1 ) = WORK( 2 )
- IF( (A( K, J ).EQ.ZERO ) .AND.
- $ ( (J.EQ.M) .OR. (A( K, J+1 ).EQ.ZERO))) THEN
+ IF( (A( K, J ).EQ.ZERO ) .AND. (A( K, J+1 ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( K-1, J ).EQ.ZERO)) ) THEN
IF(INFO .EQ. 0) THEN
INFO = J
ENDIF
@@ -342,8 +342,11 @@
$ A( K, J+2 ), LDA)
END IF
ELSE
- IF( (A( K, J ).EQ.ZERO) .AND. (INFO.EQ.0) ) THEN
- INFO = J
+ IF( (A( K, J ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J-1, J ).EQ.ZERO)) ) THEN
+ IF (INFO.EQ.0) THEN
+ INFO = J
+ END IF
END IF
END IF
J = J + 1
@@ -465,8 +468,8 @@
* Set A(J+1, J) = T(J+1, J)
*
A( J+1, K ) = WORK( 2 )
- IF( (A( J, K ).EQ.ZERO) .AND.
- $ ( (J.EQ.M) .OR. (A( J+1, K ).EQ.ZERO)) ) THEN
+ IF( (A( J, K ).EQ.ZERO) .AND. (A( J+1, K ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J, K-1 ).EQ.ZERO)) ) THEN
IF (INFO .EQ. 0)
$ INFO = J
END IF
@@ -491,8 +494,11 @@
$ A( J+2, K ), LDA )
END IF
ELSE
- IF( (A( J, K ).EQ.ZERO) .AND. (INFO.EQ.0) ) THEN
- INFO = J
+ IF( (A( J, K ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J, K-1 ).EQ.ZERO)) ) THEN
+ IF (INFO.EQ.0) THEN
+ INFO = J
+ END IF
END IF
END IF
J = J + 1
diff --git a/SRC/slasyf_aa.f b/SRC/slasyf_aa.f
index 3b4bc4b..5391cef 100644
--- a/SRC/slasyf_aa.f
+++ b/SRC/slasyf_aa.f
@@ -315,8 +315,8 @@
* Set A(J, J+1) = T(J, J+1)
*
A( K, J+1 ) = WORK( 2 )
- IF( (A( K, J ).EQ.ZERO ) .AND.
- $ ( (J.EQ.M) .OR. (A( K, J+1 ).EQ.ZERO))) THEN
+ IF( (A( K, J ).EQ.ZERO ) .AND. (A( K, J+1 ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( K-1, J ).EQ.ZERO)) ) THEN
IF(INFO .EQ. 0) THEN
INFO = J
ENDIF
@@ -342,8 +342,11 @@
$ A( K, J+2 ), LDA)
END IF
ELSE
- IF( (A( K, J ).EQ.ZERO) .AND. (INFO.EQ.0) ) THEN
- INFO = J
+ IF( (A( K, J ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J-1, J ).EQ.ZERO)) ) THEN
+ IF (INFO.EQ.0) THEN
+ INFO = J
+ END IF
END IF
END IF
J = J + 1
@@ -465,8 +468,8 @@
* Set A(J+1, J) = T(J+1, J)
*
A( J+1, K ) = WORK( 2 )
- IF( (A( J, K ).EQ.ZERO) .AND.
- $ ( (J.EQ.M) .OR. (A( J+1, K ).EQ.ZERO)) ) THEN
+ IF( (A( J, K ).EQ.ZERO) .AND. (A( J+1, K ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J, K-1 ).EQ.ZERO)) ) THEN
IF (INFO .EQ. 0)
$ INFO = J
END IF
@@ -491,8 +494,11 @@
$ A( J+2, K ), LDA )
END IF
ELSE
- IF( (A( J, K ).EQ.ZERO) .AND. (INFO.EQ.0) ) THEN
- INFO = J
+ IF( (A( J, K ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J, K-1 ).EQ.ZERO)) ) THEN
+ IF (INFO.EQ.0) THEN
+ INFO = J
+ END IF
END IF
END IF
J = J + 1
diff --git a/SRC/zlahef_aa.f b/SRC/zlahef_aa.f
index 5698ba0..4646233 100644
--- a/SRC/zlahef_aa.f
+++ b/SRC/zlahef_aa.f
@@ -319,8 +319,8 @@
* Set A(J, J+1) = T(J, J+1)
*
A( K, J+1 ) = WORK( 2 )
- IF( (A( K, J ).EQ.ZERO ) .AND.
- $ ( (J.EQ.M) .OR. (A( K, J+1 ).EQ.ZERO))) THEN
+ IF( (A( K, J ).EQ.ZERO ) .AND. (A( K, J+1 ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( K-1, J ).EQ.ZERO)) ) THEN
IF(INFO .EQ. 0) THEN
INFO = J
END IF
@@ -346,8 +346,11 @@
$ A( K, J+2 ), LDA)
END IF
ELSE
- IF( (A( K, J ).EQ.ZERO) .AND. (INFO.EQ.0) ) THEN
- INFO = J
+ IF( (A( K, J ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J-1, J ).EQ.ZERO)) ) THEN
+ IF (INFO.EQ.0) THEN
+ INFO = J
+ END IF
END IF
END IF
J = J + 1
@@ -473,8 +476,8 @@
* Set A(J+1, J) = T(J+1, J)
*
A( J+1, K ) = WORK( 2 )
- IF( (A( J, K ).EQ.ZERO) .AND.
- $ ( (J.EQ.M) .OR. (A( J+1, K ).EQ.ZERO)) ) THEN
+ IF( (A( J, K ).EQ.ZERO) .AND. (A( J+1, K ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J, K-1 ).EQ.ZERO)) ) THEN
IF (INFO .EQ. 0)
$ INFO = J
END IF
@@ -499,8 +502,12 @@
$ A( J+2, K ), LDA )
END IF
ELSE
- IF( (A( J, K ).EQ.ZERO) .AND. (J.EQ.M)
- $ .AND. (INFO.EQ.0) ) INFO = J
+ IF( (A( J, K ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J, K-1 ).EQ.ZERO)) ) THEN
+ IF (INFO.EQ.0) THEN
+ INFO = J
+ END IF
+ END IF
END IF
J = J + 1
GO TO 30
diff --git a/SRC/zlasyf_aa.f b/SRC/zlasyf_aa.f
index dff7104..8e28d4f 100644
--- a/SRC/zlasyf_aa.f
+++ b/SRC/zlasyf_aa.f
@@ -315,8 +315,8 @@
* Set A(J, J+1) = T(J, J+1)
*
A( K, J+1 ) = WORK( 2 )
- IF( (A( K, J ).EQ.ZERO ) .AND.
- $ ( (J.EQ.M) .OR. (A( K, J+1 ).EQ.ZERO))) THEN
+ IF( (A( K, J ).EQ.ZERO ) .AND. (A( K, J+1 ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( K-1, J ).EQ.ZERO)) ) THEN
IF(INFO .EQ. 0) THEN
INFO = J
ENDIF
@@ -342,8 +342,11 @@
$ A( K, J+2 ), LDA)
END IF
ELSE
- IF( (A( K, J ).EQ.ZERO) .AND. (INFO.EQ.0) ) THEN
- INFO = J
+ IF( (A( K, J ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J-1, J ).EQ.ZERO)) ) THEN
+ IF (INFO.EQ.0) THEN
+ INFO = J
+ END IF
END IF
END IF
J = J + 1
@@ -465,8 +468,8 @@
* Set A(J+1, J) = T(J+1, J)
*
A( J+1, K ) = WORK( 2 )
- IF( (A( J, K ).EQ.ZERO) .AND.
- $ ( (J.EQ.M) .OR. (A( J+1, K ).EQ.ZERO)) ) THEN
+ IF( (A( J, K ).EQ.ZERO) .AND. (A( J+1, K ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J, K-1 ).EQ.ZERO)) ) THEN
IF (INFO .EQ. 0)
$ INFO = J
END IF
@@ -491,8 +494,11 @@
$ A( J+2, K ), LDA )
END IF
ELSE
- IF( (A( J, K ).EQ.ZERO) .AND. (INFO.EQ.0) ) THEN
- INFO = J
+ IF( (A( J, K ).EQ.ZERO) .AND.
+ $ ((K.EQ.1) .OR. (A( J, K-1 ).EQ.ZERO)) ) THEN
+ IF (INFO.EQ.0) THEN
+ INFO = J
+ END IF
END IF
END IF
J = J + 1