From f69047c379fb1b332b8edf182b7eee8bdadb58bb Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Wed, 11 Feb 2009 19:57:58 +0000 Subject: [PATCH] better error messages fo lapack --- Numeric/GmshMatrix.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Numeric/GmshMatrix.cpp b/Numeric/GmshMatrix.cpp index dcfac6c2f1..16bf2c8de2 100644 --- a/Numeric/GmshMatrix.cpp +++ b/Numeric/GmshMatrix.cpp @@ -113,7 +113,10 @@ bool gmshMatrix<double>::lu_solve(const gmshVector<double> &rhs, gmshVector<doub dgesv_(&N, &nrhs, _data, &lda, ipiv, result._data, &ldb, &info); delete [] ipiv; if(info == 0) return true; - Msg::Error("Problem in LAPACK LU (info=%d)", info); + if(info > 0) + Msg::Error("U(%d,%d)=0 in LU decomposition", info, info); + else + Msg::Error("Wrong %d-th argument in LU decomposition", -info); return false; } @@ -134,7 +137,7 @@ double gmshMatrix<double>::determinant() const else if(info > 0) det = 0.; else - Msg::Error("Problem in LAPACK factorisation (info=%d)", info); + Msg::Error("Wrong %d-th argument in matrix factorization", -info); delete [] ipiv; return det; } @@ -150,7 +153,10 @@ bool gmshMatrix<double>::svd(gmshMatrix<double> &V, gmshVector<double> &S) VT._data, &LDVT, WORK._data, &LWORK, &info); V = VT.transpose(); if(info == 0) return true; - Msg::Error("Problem in LAPACK SVD (info=%d)", info); + if(info > 0) + Msg::Error("SVD did not converge"); + else + Msg::Error("Wrong %d-th argument in SVD decomposition", -info); return false; } -- GitLab