aboutsummaryrefslogtreecommitdiff
path: root/src/elliptic
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2003-06-02 18:10:34 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2003-06-02 18:10:34 +0000
commit91892c701f095ea2425df6c35b4fb8bf54a79cc0 (patch)
treefdb5264791d5213de72ef3f72ab75ea05b9adc2d /src/elliptic
parent938dbe318a6d7f6608bc5c62f41823b7a5bd15f2 (diff)
solve_linear_system() now returns *reciprocal* condition number
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@1083 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/elliptic')
-rw-r--r--src/elliptic/dense_Jacobian.cc11
-rw-r--r--src/elliptic/dense_Jacobian.hh8
2 files changed, 10 insertions, 9 deletions
diff --git a/src/elliptic/dense_Jacobian.cc b/src/elliptic/dense_Jacobian.cc
index 4fd9e66..e5cec64 100644
--- a/src/elliptic/dense_Jacobian.cc
+++ b/src/elliptic/dense_Jacobian.cc
@@ -199,8 +199,9 @@ delete[] pivot_;
//
// This function solves the linear system J.x = rhs, with rhs and x
// being nominal-grid gridfns, using LAPACK LU-decomposition routines.
-// It returns the estimated infinity-norm condition number of the linear
-// system, or 0.0 if the matrix is numerically singular
+//
+// It returns the (infinity-norm) estimated reciprocal condition number
+// of the linear system.
//
fp dense_Jacobian__LAPACK::solve_linear_system
(int rhs_gfn, int x_gfn,
@@ -272,9 +273,7 @@ fp rcond;
#else
#error "don't know fp datatype!"
#endif
-if (rcond == 0.0)
- then return 0.0; // *** ERROR RETURN ***
- // *** (singular matrix)
-return 1.0/rcond;
+
+return rcond;
}
#endif // HAVE_DENSE_JACOBIAN__LAPACK
diff --git a/src/elliptic/dense_Jacobian.hh b/src/elliptic/dense_Jacobian.hh
index 6946993..cf0b8ba 100644
--- a/src/elliptic/dense_Jacobian.hh
+++ b/src/elliptic/dense_Jacobian.hh
@@ -87,9 +87,11 @@ public:
// solve linear system J.x = rhs via LAPACK
// ... rhs and x are nominal-grid gridfns
// ... overwrites Jacobian matrix with its LU decomposition
- // ... returns condition number if known,
- // 0.0 if matrix is numerically singular,
- // -1.0 if condition number is unknown
+ // ... returns estimated reciprocal condition number if known,
+ // -1.0 if condition number is unknown
+ // ... rcond = 0.0 ==> exactly singular
+ // rcond < DBL_EPSILON ==> numerically singular
+ // rcond = 1.0 ==> orthogonal matrix
fp solve_linear_system(int rhs_gfn, int x_gfn,
const struct linear_solver_pars& pars,
bool print_msg_flag);