From 7f006e2c75fdd4ce3d8c7ed67f9d29f0b459e1e3 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sat, 19 Dec 2020 07:58:49 +0100 Subject: [PATCH] GCS: Augment information provided by GCS with groups of dependent parameters --- src/Mod/Sketcher/App/planegcs/GCS.cpp | 7 ++++--- src/Mod/Sketcher/App/planegcs/GCS.h | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Mod/Sketcher/App/planegcs/GCS.cpp b/src/Mod/Sketcher/App/planegcs/GCS.cpp index f4542bcacd..aab3eea25f 100644 --- a/src/Mod/Sketcher/App/planegcs/GCS.cpp +++ b/src/Mod/Sketcher/App/planegcs/GCS.cpp @@ -531,6 +531,7 @@ void System::clear() pdrivenlist.clear(); pIndex.clear(); pdependentparameters.clear(); + pdependentelementgroups.clear(); hasUnknowns = false; hasDiagnosis = false; @@ -4228,19 +4229,19 @@ void System::identifyDependentParameters( T & qrJ, if(!silent) SolverReportingManager::Manager().LogMatrix("Rparams", Rparams); #endif - //std::vector< std::vector > dependencyGroups(SqrJ.cols()-rank); + pdependentelementgroups.resize(qrJ.cols()-rank); for (int j=rank; j < qrJ.cols(); j++) { for (int row=0; row < rank; row++) { if (fabs(Rparams(row,j)) > 1e-10) { int origCol = qrJ.colsPermutation().indices()[row]; - //dependencyGroups[j-rank].push_back(pdiagnoselist[origCol]); + pdependentelementgroups[j-rank].push_back(pdiagnoselist[origCol]); pdependentparameters.push_back(pdiagnoselist[origCol]); } } int origCol = qrJ.colsPermutation().indices()[j]; - //dependencyGroups[j-rank].push_back(pdiagnoselist[origCol]); + pdependentelementgroups[j-rank].push_back(pdiagnoselist[origCol]); pdependentparameters.push_back(pdiagnoselist[origCol]); } } diff --git a/src/Mod/Sketcher/App/planegcs/GCS.h b/src/Mod/Sketcher/App/planegcs/GCS.h index c441252b17..8b6b82e34c 100644 --- a/src/Mod/Sketcher/App/planegcs/GCS.h +++ b/src/Mod/Sketcher/App/planegcs/GCS.h @@ -104,6 +104,10 @@ namespace GCS VEC_pD pdependentparameters; // list of dependent parameters by the system + // This is a map of primary and secondary identifiers that are found dependent by the solver + // GCS ignores from a type point + std::vector< std::vector > pdependentelementgroups; + std::vector clist; std::map c2p; // constraint to parameter adjacency list std::map > p2c; // parameter to constraint adjacency list