Remove forceDofCheck parameter from SolveRank(). NFC.
It makes no sense to solve by substitution (therefore weakening rank check) in SolveRank(), since that's the whole point of SolveRank(). In addition, because SolveRank() is currently always called right after AddConstraint(), forceDofCheck would always be true anyway. In addition, it makes no sense to have TestRankForGroup() dependent on the result of the previous solve. (For SolveGroup(), solving by substitution after we know that rank test succeeds makes dragging points much faster.)pull/434/head
parent
88879d352e
commit
394c1f62d8
|
@ -554,8 +554,9 @@ void SolveSpaceUI::SolveGroup(hGroup hg, bool andFindFree) {
|
|||
SolveResult SolveSpaceUI::TestRankForGroup(hGroup hg) {
|
||||
WriteEqSystemForGroup(hg);
|
||||
Group *g = SK.GetGroup(hg);
|
||||
SolveResult result = sys.SolveRank(g, NULL, NULL, false, false,
|
||||
/*forceDofCheck=*/!g->dofCheckOk);
|
||||
SolveResult result = sys.SolveRank(g, NULL, NULL,
|
||||
/*andFindBad=*/false,
|
||||
/*andFindFree=*/false);
|
||||
FreeAllTemporary();
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -312,7 +312,7 @@ public:
|
|||
bool andFindBad, bool andFindFree, bool forceDofCheck = false);
|
||||
|
||||
SolveResult SolveRank(Group *g, int *dof, List<hConstraint> *bad,
|
||||
bool andFindBad, bool andFindFree, bool forceDofCheck = false);
|
||||
bool andFindBad, bool andFindFree);
|
||||
|
||||
void Clear();
|
||||
};
|
||||
|
|
|
@ -518,7 +518,7 @@ didnt_converge:
|
|||
}
|
||||
|
||||
SolveResult System::SolveRank(Group *g, int *dof, List<hConstraint> *bad,
|
||||
bool andFindBad, bool andFindFree, bool forceDofCheck)
|
||||
bool andFindBad, bool andFindFree)
|
||||
{
|
||||
WriteEquationsExceptFor(Constraint::NO_CONSTRAINT, g);
|
||||
|
||||
|
@ -526,10 +526,6 @@ SolveResult System::SolveRank(Group *g, int *dof, List<hConstraint> *bad,
|
|||
param.ClearTags();
|
||||
eq.ClearTags();
|
||||
|
||||
if(!forceDofCheck) {
|
||||
SolveBySubstitution();
|
||||
}
|
||||
|
||||
// Now write the Jacobian, and do a rank test; that
|
||||
// tells us if the system is inconsistently constrained.
|
||||
if(!WriteJacobian(0)) {
|
||||
|
@ -539,7 +535,7 @@ SolveResult System::SolveRank(Group *g, int *dof, List<hConstraint> *bad,
|
|||
bool rankOk = TestRank();
|
||||
if(!rankOk) {
|
||||
if(!g->allowRedundant) {
|
||||
if(andFindBad) FindWhichToRemoveToFixJacobian(g, bad, forceDofCheck);
|
||||
if(andFindBad) FindWhichToRemoveToFixJacobian(g, bad, /*forceDofCheck=*/true);
|
||||
}
|
||||
} else {
|
||||
// This is not the full Jacobian, but any substitutions or single-eq
|
||||
|
|
Loading…
Reference in New Issue