From 55cde18c5a483ba69bc509717a1f515626871c77 Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 21 Jan 2016 08:05:21 +0000 Subject: [PATCH] Reword error messages that are displayed when a group fails to solve. The current messages accurately reflect what happens to the system of equations that represents the sketch, but can be quite confusing to users that only think in terms of the constraints. We use "unsolvable" and not "impossible" because while most of the cases that result in this error message will indeed stem from mutually exclusive sets of constraints, it is still possible that there is some solution that our solver is unable to find using numeric methods. --- src/lib.cpp | 2 +- src/solvespace.h | 8 ++++---- src/system.cpp | 2 +- src/textscreens.cpp | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lib.cpp b/src/lib.cpp index 2c2b949..ac179d8 100644 --- a/src/lib.cpp +++ b/src/lib.cpp @@ -220,7 +220,7 @@ default: dbp("bad constraint type %d", sc->type); return; ssys->result = SLVS_RESULT_DIDNT_CONVERGE; break; - case System::SINGULAR_JACOBIAN: + case System::REDUNDANT: ssys->result = SLVS_RESULT_INCONSISTENT; break; diff --git a/src/solvespace.h b/src/solvespace.h index 7bede6c..38c671e 100644 --- a/src/solvespace.h +++ b/src/solvespace.h @@ -433,10 +433,10 @@ public: bool NewtonSolve(int tag); enum { - SOLVED_OKAY = 0, - DIDNT_CONVERGE = 10, - SINGULAR_JACOBIAN = 11, - TOO_MANY_UNKNOWNS = 20 + SOLVED_OKAY = 0, + DIDNT_CONVERGE = 10, + REDUNDANT = 11, + TOO_MANY_UNKNOWNS = 20 }; int Solve(Group *g, int *dof, List *bad, bool andFindBad, bool andFindFree); diff --git a/src/system.cpp b/src/system.cpp index 5f1e633..ae82cf0 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -453,7 +453,7 @@ int System::Solve(Group *g, int *dof, List *bad, if(andFindBad) { FindWhichToRemoveToFixJacobian(g, bad); } - return System::SINGULAR_JACOBIAN; + return System::REDUNDANT; } // This is not the full Jacobian, but any substitutions or single-eq // solves removed one equation and one unknown, therefore no effect diff --git a/src/textscreens.cpp b/src/textscreens.cpp index fe46cac..9e811f5 100644 --- a/src/textscreens.cpp +++ b/src/textscreens.cpp @@ -471,12 +471,12 @@ void TextWindow::ShowGroupSolveInfo(void) { Printf(true, "%FtGROUP %E%s", g->DescriptionString().c_str()); switch(g->solved.how) { case System::DIDNT_CONVERGE: - Printf(true, "%FxSOLVE FAILED!%Fd no convergence"); + Printf(true, "%FxSOLVE FAILED!%Fd unsolvable constraints"); Printf(true, "the following constraints are unsatisfied"); break; - case System::SINGULAR_JACOBIAN: - Printf(true, "%FxSOLVE FAILED!%Fd inconsistent system"); + case System::REDUNDANT: + Printf(true, "%FxSOLVE FAILED!%Fd redundant constraints"); Printf(true, "remove any one of these to fix it"); break;