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:
SS.ReloadAllImported();
SS.GenerateAll(0, INT_MAX);
SS.later.showTW = true;
break;
default: oops();

View File

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

View File

@ -440,9 +440,14 @@ void System::Solve(Group *g) {
if(rank != mat.m) {
FindWhichToRemoveToFixJacobian(g);
g->solved.how = Group::SINGULAR_JACOBIAN;
g->solved.dof = 0;
TextWindow::ReportHowGroupSolved(g->h);
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
if(!NewtonSolve(0)) {

View File

@ -439,7 +439,7 @@ void TextWindow::ShowGroupInfo(void) {
if(a == 0) Printf(false, "%Ba (none)");
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++) {
Constraint *c = &(SS.constraint.elem[i]);