aboutsummaryrefslogtreecommitdiff
path: root/src/lapack.cpp
diff options
context:
space:
mode:
authorPjotr Prins2018-08-25 09:48:03 +0000
committerPjotr Prins2018-08-25 09:48:03 +0000
commit4d1a44cb90affbe9c73a27767bae4a4b69c72402 (patch)
tree2ef95ca1df733f1d048f4d0a7eac56651fba3614 /src/lapack.cpp
parent3ebaa0718d92e9de9c85c9e462d8fff22ff65d1a (diff)
downloadpangemma-4d1a44cb90affbe9c73a27767bae4a4b69c72402.tar.gz
segfpe handling
Diffstat (limited to 'src/lapack.cpp')
-rw-r--r--src/lapack.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/lapack.cpp b/src/lapack.cpp
index 187daa8..b309a1b 100644
--- a/src/lapack.cpp
+++ b/src/lapack.cpp
@@ -193,6 +193,8 @@ void lapack_eigen_symmv(gsl_matrix *A, gsl_vector *eval, gsl_matrix *evec,
double WORK_temp[1];
int IWORK_temp[1];
+ if (is_check_mode()) disable_segfpe(); // disable fast NaN checking for now
+
// DSYEVR - computes selected eigenvalues and, optionally,
// eigenvectors of a real symmetric matrix
// Here compute both (JOBZ is V), all eigenvalues (RANGE is A)
@@ -200,7 +202,12 @@ void lapack_eigen_symmv(gsl_matrix *A, gsl_vector *eval, gsl_matrix *evec,
dsyevr_(&JOBZ, &RANGE, &UPLO, &N, A->data, &LDA, &VL, &VU, &IL, &IU,
&ABSTOL, &M, eval->data, evec->data, &LDZ, ISUPPZ, WORK_temp,
&LWORK, IWORK_temp, &LIWORK, &INFO);
- enforce_msg(INFO != 0, "lapack_eigen_symmv failed");
+ // If info = 0, the execution is successful.
+ // If info = -i, the i-th parameter had an illegal value.
+ // If info = i, an internal error has occurred.
+
+ if (INFO != 0) cerr << "ERROR: value of INFO is " << INFO;
+ enforce_msg(INFO == 0, "lapack_eigen_symmv failed");
LWORK = (int)WORK_temp[0];
LIWORK = (int)IWORK_temp[0];
@@ -210,7 +217,10 @@ void lapack_eigen_symmv(gsl_matrix *A, gsl_vector *eval, gsl_matrix *evec,
dsyevr_(&JOBZ, &RANGE, &UPLO, &N, A->data, &LDA, &VL, &VU, &IL, &IU,
&ABSTOL, &M, eval->data, evec->data, &LDZ, ISUPPZ, WORK, &LWORK,
IWORK, &LIWORK, &INFO);
- enforce_msg(INFO != 0, "lapack_eigen_symmv failed");
+ if (INFO != 0) cerr << "ERROR: value of INFO is " << INFO;
+ enforce_msg(INFO == 0, "lapack_eigen_symmv failed");
+
+ if (is_check_mode()) disable_segfpe(); // reinstate fast NaN checking
gsl_matrix_transpose(evec);