From 66abc19ef18db8d18e783fb1846cd0ee3f078aff Mon Sep 17 00:00:00 2001 From: Jonathan Westhues Date: Mon, 18 Jan 2010 02:28:47 -0800 Subject: [PATCH] Reduce the solver convergence tolerance by a factor of 100, to just LENGTH_EPS/1e2. At least in theory, that should still be more than enough; all we need is for equal things to be equal afterward, and even LENGTH_EPS/2 would guarantee that. [git-p4: depot-paths = "//depot/solvespace/": change = 2110] --- system.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/system.cpp b/system.cpp index aa18dd3..9a9accc 100644 --- a/system.cpp +++ b/system.cpp @@ -1,7 +1,15 @@ #include "solvespace.h" +// This tolerance is used to determine whether two (linearized) constraints +// are linearly dependent. If this is too small, then we will attempt to +// solve truly inconsistent systems and fail. But if it's too large, then +// we will give up on legitimate systems like a skinny right angle triangle by +// its hypotenuse and long side. const double System::RANK_MAG_TOLERANCE = 1e-4; -const double System::CONVERGE_TOLERANCE = 1e-10; + +// The solver will converge all unknowns to within this tolerance. This must +// always be much less than LENGTH_EPS, and in practice should be much less. +const double System::CONVERGE_TOLERANCE = (LENGTH_EPS/(1e2)); bool System::WriteJacobian(int tag) { int a, i, j;