- for (vsize c = b+1; c < breaks.size (); c++)
- {
- vsize end = breaks[c];
- Simple_spacer spacer;
-
- for (vsize i = breaks[b]; i < end - 1; i++)
- spacer.add_spring (cols[i].ideal_, cols[i].inverse_hooke_);
- spacer.add_spring (cols[end-1].end_ideal_, cols[end-1].end_inverse_hooke_);
-
-
- for (vsize i = breaks[b]; i < end; i++)
- {
- for (vsize r = 0; r < cols[i].rods_.size (); r++)
- if (cols[i].rods_[r].r_ < end)
- spacer.add_rod (i - st, cols[i].rods_[r].r_ - st, cols[i].rods_[r].dist_);
- for (vsize r = 0; r < cols[i].end_rods_.size (); r++)
- if (cols[i].end_rods_[r].r_ == end)
- spacer.add_rod (i - st, end - st, cols[i].end_rods_[r].dist_);
- if (!cols[i].keep_inside_line_.is_empty ())
- {
- spacer.add_rod (i - st, end - st, cols[i].keep_inside_line_[RIGHT]);
- spacer.add_rod (0, i - st, -cols[i].keep_inside_line_[LEFT]);
- }
- }
- spacer.solve ((b == 0) ? line_len - indent : line_len, ragged);
- force[b * breaks.size () + c] = spacer.force_penalty (ragged);
-
- if (!spacer.fits ())
- {
- if (c == b + 1)
- force[b * breaks.size () + c] = -200000;
- else
- force[b * breaks.size () + c] = infinity_f;
- break;
- }
- if (end < cols.size () && cols[end].break_permission_ == force_break)
- break;
- }
+ for (vsize c = b + 1; c < breaks.size (); c++)
+ {
+ vsize end = breaks[c];
+ Simple_spacer spacer;
+
+ for (vsize i = breaks[b]; i < end - 1; i++)
+ spacer.add_spring (cols[i].spring_);
+ spacer.add_spring (cols[end - 1].end_spring_);
+
+ for (vsize i = breaks[b]; i < end; i++)
+ {
+ for (vsize r = 0; r < cols[i].rods_.size (); r++)
+ if (cols[i].rods_[r].r_ < end)
+ spacer.add_rod (i - st, cols[i].rods_[r].r_ - st, cols[i].rods_[r].dist_);
+ for (vsize r = 0; r < cols[i].end_rods_.size (); r++)
+ if (cols[i].end_rods_[r].r_ == end)
+ spacer.add_rod (i - st, end - st, cols[i].end_rods_[r].dist_);
+ if (!cols[i].keep_inside_line_.is_empty ())
+ {
+ spacer.add_rod (i - st, end - st, cols[i].keep_inside_line_[RIGHT]);
+ spacer.add_rod (0, i - st, -cols[i].keep_inside_line_[LEFT]);
+ }
+ }
+ spacer.solve ((b == 0) ? line_len - indent : line_len, ragged);
+ force[b * breaks.size () + c] = spacer.force_penalty (ragged);
+
+ if (!spacer.fits ())
+ {
+ if (c == b + 1)
+ force[b * breaks.size () + c] = -200000;
+ else
+ force[b * breaks.size () + c] = infinity_f;
+ break;
+ }
+ if (end < cols.size () && scm_is_eq (cols[end].break_permission_, force_break))
+ break;
+ }