-/* The algorithm is as follows:
- 1) break everything into its preferred number of lines
- 2) decrease the number of lines until we've decreased
- the number of pages
- 3) increase the number of lines until we've increased
- the number of pages
- Take the best score we've found
-*/
-SCM
-Optimal_page_breaking::solve ()
-{
- vector<vsize> ideal_line_count;
- vector<vsize> max_line_count;
- vector<vsize> min_line_count;
- vector<vsize> last_best_line_count;
- vector<vsize> best_line_count;
- vsize last_line_total = 0;
-
- calc_system_count_bounds (0, breaks_.size () - 1, &min_line_count, &max_line_count);
- ideal_line_count.resize (all_.size (), 1);
- for (vsize i = 0; i < all_.size (); i++)
+ if (page_count == 1)
+ message (_ ("Fitting music on 1 page..."));
+ else if (scm_is_integer (forced_page_count))
+ message (_f ("Fitting music on %d pages...", (int)page_count));
+ else
+ message (_f ("Fitting music on %d or %d pages...", (int)page_count-1, (int)page_count));
+
+ /* try a smaller number of systems than the ideal number for line breaking */
+ Line_division bound = ideal_line_division;
+ for (vsize sys_count = ideal_sys_count; --sys_count >= min_sys_count;)