// put the constraints into the LP problem
void
-Spacing_problem::make_constraints(Optimisation_problem& lp) const
+Spacing_problem::make_constraints(Mixed_qp& lp) const
{
int dim=cols.sz();
for (int j=0; j < dim; j++) {
/* optimalisatiefunctie */
- Optimisation_problem lp(cols.sz());
+ Mixed_qp lp(cols.sz());
make_matrices(lp.quad,lp.lin, lp.const_term);
make_constraints(lp);
Vector start=find_initial_solution();
Colinfo c;
c.fixed=fixed;
c.fixpos=fixpos;
+ assert(col);
c.col=col;
cols.add(c);
}
int l = col_id(id->left);
int r = col_id(id->right);
- mtor << "idealspacing { between " << l <<","<<r<<'\n';
- mtor << "distance "<<id->space<< " strength " << id->hooke << "}\n";
+ mtor << "between " << l <<","<<r<<":" ;
#endif
}
void
Spacing_problem::print() const
{
- #ifndef NPRINT
+#ifndef NPRINT
for (int i=0; i < cols.sz(); i++) {
mtor << "col " << i<<' ';
cols[i].print();
for (int i=0; i < ideals.sz(); i++) {
print_ideal(ideals[i]);
}
- #endif
+#endif
}
mtor << "column { ";
if (fixed)
mtor << "fixed at " << fixpos<<", ";
+ assert(col);
mtor << "[" << minleft() << ", " << minright() << "]";
mtor <<"}\n";
#endif
}
-
+Colinfo::Colinfo()
+{
+ fixed=false;
+ col=0;
+}