Move logic for handling allowRedundant out of System. NFC.
This commit is contained in:
parent
cf2f0e5d44
commit
beea4444ab
@ -542,7 +542,7 @@ void SolveSpaceUI::SolveGroup(hGroup hg, bool andFindFree) {
|
|||||||
SolveResult how = sys.Solve(g, NULL,
|
SolveResult how = sys.Solve(g, NULL,
|
||||||
&(g->solved.dof),
|
&(g->solved.dof),
|
||||||
&(g->solved.remove),
|
&(g->solved.remove),
|
||||||
/*andFindBad=*/true,
|
/*andFindBad=*/!g->allowRedundant,
|
||||||
/*andFindFree=*/andFindFree,
|
/*andFindFree=*/andFindFree,
|
||||||
/*forceDofCheck=*/!g->dofCheckOk);
|
/*forceDofCheck=*/!g->dofCheckOk);
|
||||||
if(how == SolveResult::OKAY) {
|
if(how == SolveResult::OKAY) {
|
||||||
|
@ -470,9 +470,7 @@ SolveResult System::Solve(Group *g, int *rank, int *dof, List<hConstraint> *bad,
|
|||||||
|
|
||||||
rankOk = TestRank(rank);
|
rankOk = TestRank(rank);
|
||||||
if(!rankOk) {
|
if(!rankOk) {
|
||||||
if(!g->allowRedundant) {
|
if(andFindBad) FindWhichToRemoveToFixJacobian(g, bad, forceDofCheck);
|
||||||
if(andFindBad) FindWhichToRemoveToFixJacobian(g, bad, forceDofCheck);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// This is not the full Jacobian, but any substitutions or single-eq
|
// This is not the full Jacobian, but any substitutions or single-eq
|
||||||
// solves removed one equation and one unknown, therefore no effect
|
// 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);
|
bool rankOk = TestRank(rank);
|
||||||
if(!rankOk) {
|
if(!rankOk) {
|
||||||
if(!g->allowRedundant) {
|
if(andFindBad) FindWhichToRemoveToFixJacobian(g, bad, /*forceDofCheck=*/true);
|
||||||
if(andFindBad) FindWhichToRemoveToFixJacobian(g, bad, /*forceDofCheck=*/true);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if(dof) *dof = CalculateDof();
|
if(dof) *dof = CalculateDof();
|
||||||
MarkParamsFree(andFindFree);
|
MarkParamsFree(andFindFree);
|
||||||
|
Loading…
Reference in New Issue
Block a user