From 780b353f89e6b36be97a60de56e4c60b22b186fd Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Fri, 27 Mar 2009 19:34:03 +0000
Subject: [PATCH] *** empty log message ***

---
 Numeric/GmshMatrix.cpp | 24 ++++++------------------
 1 file changed, 6 insertions(+), 18 deletions(-)

diff --git a/Numeric/GmshMatrix.cpp b/Numeric/GmshMatrix.cpp
index 75ad9f134e..caa73781d6 100644
--- a/Numeric/GmshMatrix.cpp
+++ b/Numeric/GmshMatrix.cpp
@@ -127,33 +127,21 @@ bool gmshMatrix<double>::invert(gmshMatrix<double> &result)
 {
   int M = size1(), N = size2(), lda = size1(), info;
   int *ipiv = new int[std::min(M, N)];
-  bool ret = true;
   result = *this;
   dgetrf_(&M, &N, result._data, &lda, ipiv, &info);
   if(info == 0){
     int lwork = M * 4;
     double *work = new double[lwork];
     dgetri_(&M, result._data, &lda, ipiv, work, &lwork, &info);
-    if(info > 0){
-      Msg::Error("U(%d, %d)=0 in LU decomposition", info, info);
-      ret = false;
-    }
-    else if(info < 0){
-      Msg::Error("Wrong %d-th argument in matrix inversion", -info);
-      ret = false;
-    }
     delete [] work;
   }
-  else if(info > 0){
-    Msg::Error("U(%d, %d)=0 in LU decomposition", info, info);
-    ret = false;
-  }
-  else{
-    Msg::Error("Wrong %d-th argument in matrix factorization", -info);
-    ret = false;
-  }
   delete [] ipiv;
-  return ret;
+  if(info == 0) return true;
+  else if(info > 0)
+    Msg::Error("U(%d, %d)=0 in LU decomposition", info, info);
+  else
+    Msg::Error("Wrong %d-th argument in matrix inversion", -info);
+  return false;
 }
 
 template<> 
-- 
GitLab