diff --git a/src/Mod/Sketcher/App/planegcs/GCS.cpp b/src/Mod/Sketcher/App/planegcs/GCS.cpp index 34b0725041..f4542bcacd 100644 --- a/src/Mod/Sketcher/App/planegcs/GCS.cpp +++ b/src/Mod/Sketcher/App/planegcs/GCS.cpp @@ -417,6 +417,7 @@ System::System() , hasUnknowns(false) , hasDiagnosis(false) , isInit(false) + , emptyDiagnoseMatrix(true) , maxIter(100) , maxIterRedundant(100) , sketchSizeMultiplier(false) @@ -533,6 +534,8 @@ void System::clear() hasUnknowns = false; hasDiagnosis = false; + emptyDiagnoseMatrix = true; + redundant.clear(); conflictingTags.clear(); redundantTags.clear(); @@ -3844,6 +3847,7 @@ SolverReportingManager::Manager().LogToFile("GCS::System::diagnose()\n"); // eventually crash. This fixes issues #0002372/#0002373. if (plist.empty() || (plist.size() - pdrivenlist.size()) == 0) { hasDiagnosis = true; + emptyDiagnoseMatrix = true; dofs = 0; return dofs; } @@ -3879,6 +3883,9 @@ SolverReportingManager::Manager().LogToFile("GCS::System::diagnose()\n"); hasDiagnosis = true; dofs = pdiagnoselist.size(); + if(J.rows() > 0) + emptyDiagnoseMatrix = false; + // There is a legacy decision to use QR decomposition. I (abdullah) do not know all the // consideration taken in that decisions. I see that: // - QR decomposition is able to provide information about the rank and redundant/conflicting constraints diff --git a/src/Mod/Sketcher/App/planegcs/GCS.h b/src/Mod/Sketcher/App/planegcs/GCS.h index 88f44e5dc2..c441252b17 100644 --- a/src/Mod/Sketcher/App/planegcs/GCS.h +++ b/src/Mod/Sketcher/App/planegcs/GCS.h @@ -127,6 +127,8 @@ namespace GCS bool hasDiagnosis; // if dofs, conflictingTags, redundantTags are up to date bool isInit; // if plists, clists, reductionmaps are up to date + bool emptyDiagnoseMatrix; // false only if there is at least one driving constraint. + int solve_BFGS(SubSystem *subsys, bool isFine=true, bool isRedundantsolving=false); int solve_LM(SubSystem *subsys, bool isRedundantsolving=false); int solve_DL(SubSystem *subsys, bool isRedundantsolving=false); @@ -354,6 +356,7 @@ namespace GCS { redundantOut = hasDiagnosis ? redundantTags : VEC_I(0); } void getDependentParams(VEC_pD &pconstraintplistOut) const { pconstraintplistOut = pdependentparameters;} + bool isEmptyDiagnoseMatrix() const {return emptyDiagnoseMatrix;} };