Move logic for handling allowRedundant out of System. NFC.

This commit is contained in:
whitequark 2019-05-24 15:43:20 +00:00
parent cf2f0e5d44
commit beea4444ab
2 changed files with 3 additions and 7 deletions

View File

@ -542,7 +542,7 @@ void SolveSpaceUI::SolveGroup(hGroup hg, bool andFindFree) {
SolveResult how = sys.Solve(g, NULL,
&(g->solved.dof),
&(g->solved.remove),
/*andFindBad=*/true,
/*andFindBad=*/!g->allowRedundant,
/*andFindFree=*/andFindFree,
/*forceDofCheck=*/!g->dofCheckOk);
if(how == SolveResult::OKAY) {

View File

@ -470,9 +470,7 @@ SolveResult System::Solve(Group *g, int *rank, int *dof, List<hConstraint> *bad,
rankOk = TestRank(rank);
if(!rankOk) {
if(!g->allowRedundant) {
if(andFindBad) FindWhichToRemoveToFixJacobian(g, bad, forceDofCheck);
}
if(andFindBad) FindWhichToRemoveToFixJacobian(g, bad, forceDofCheck);
} else {
// This is not the full Jacobian, but any substitutions or single-eq
// solves removed one equation and one unknown, therefore no effect
@ -536,9 +534,7 @@ SolveResult System::SolveRank(Group *g, int *rank, int *dof, List<hConstraint> *
bool rankOk = TestRank(rank);
if(!rankOk) {
if(!g->allowRedundant) {
if(andFindBad) FindWhichToRemoveToFixJacobian(g, bad, /*forceDofCheck=*/true);
}
if(andFindBad) FindWhichToRemoveToFixJacobian(g, bad, /*forceDofCheck=*/true);
} else {
if(dof) *dof = CalculateDof();
MarkParamsFree(andFindFree);