GCS: Interface to query whether the used diagnose matrix is empty

=================================================================

Diagnose constraints do not include among others driven constraints. This
function allows to know whether the solver is considering an empty matrix.
This commit is contained in:
Abdullah Tahiri
2020-12-15 19:14:38 +01:00
committed by abdullahtahiriyo
parent 229c515b72
commit 3605770b68
2 changed files with 10 additions and 0 deletions

View File

@@ -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

View File

@@ -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;}
};