5 /* el stupido. This should be done more accurately:
7 It would be nice to have a Dynamic Programming type of algorithm
12 Array<Col_configuration>
16 iter_top(pscore_.cols,curcol);
17 Array<Col_configuration> breaking;
18 Array<PCol *> breakpoints(find_breaks());
19 assert(breakpoints.size()>=2);
20 for (int i=0 ; i < breakpoints.size() -1; ) {
21 Col_configuration minimum;
22 Col_configuration current;
25 PCol *post = breakpoints[i]->postbreak_p_;
27 curcol++; // skip the breakable.
30 while (i < breakpoints.size()) {
32 // add another measure.
33 while (breakpoints[i] != curcol.ptr()){
38 current.add(breakpoints[i]->prebreak_p_ );
39 if (!feasible(current.cols)) {
40 if (!minimum.cols.size())
41 error("sorry, this measure is too long");
44 current.setsol(solve_line(current.cols));
47 if (current.energy < minimum.energy) {
49 } else { // we're one col too far.
51 while (curcol.ptr() != breakpoints[i])
57 current.cols.last()=breakpoints[i];
61 mtor << "Adding cols~, next breakpoint " << i << '\n';
62 breaking.add(minimum);
68 Word_wrap::Word_wrap(PScore&ps)