Report the number of degrees of freedom for each group.

[git-p4: depot-paths = "//depot/solvespace/": change = 1834]
solver
Jonathan Westhues 2008-07-09 23:42:35 -08:00
parent cdeeb67d83
commit 6269d702fb
4 changed files with 8 additions and 1 deletions

View File

@ -476,6 +476,7 @@ void GraphicsWindow::MenuEdit(int id) {
case MNU_REGEN_ALL: case MNU_REGEN_ALL:
SS.ReloadAllImported(); SS.ReloadAllImported();
SS.GenerateAll(0, INT_MAX); SS.GenerateAll(0, INT_MAX);
SS.later.showTW = true;
break; break;
default: oops(); default: oops();

View File

@ -104,6 +104,7 @@ public:
static const int SINGULAR_JACOBIAN = 11; static const int SINGULAR_JACOBIAN = 11;
struct { struct {
int how; int how;
int dof;
SList<hConstraint> remove; SList<hConstraint> remove;
} solved; } solved;

View File

@ -440,9 +440,14 @@ void System::Solve(Group *g) {
if(rank != mat.m) { if(rank != mat.m) {
FindWhichToRemoveToFixJacobian(g); FindWhichToRemoveToFixJacobian(g);
g->solved.how = Group::SINGULAR_JACOBIAN; g->solved.how = Group::SINGULAR_JACOBIAN;
g->solved.dof = 0;
TextWindow::ReportHowGroupSolved(g->h); TextWindow::ReportHowGroupSolved(g->h);
return; return;
} }
// This is not the full Jacobian, but any substitutions or single-eq
// solves removed one equation and one unknown, therefore no effect
// on the number of DOF.
g->solved.dof = mat.n - mat.m;
// And do the leftovers as one big system // And do the leftovers as one big system
if(!NewtonSolve(0)) { if(!NewtonSolve(0)) {

View File

@ -439,7 +439,7 @@ void TextWindow::ShowGroupInfo(void) {
if(a == 0) Printf(false, "%Ba (none)"); if(a == 0) Printf(false, "%Ba (none)");
a = 0; a = 0;
Printf(true, "%Ftconstraints in group"); Printf(true, "%Ftconstraints in group (%d DOF)", g->solved.dof);
for(i = 0; i < SS.constraint.n; i++) { for(i = 0; i < SS.constraint.n; i++) {
Constraint *c = &(SS.constraint.elem[i]); Constraint *c = &(SS.constraint.elem[i]);