#include "prob.hh"
#include "system.hh"
-static bool
-is_break (Grob *)
-{
- return false;
-}
-
Optimal_page_breaking::Optimal_page_breaking (Paper_book *pb)
- : Page_breaking (pb, is_break)
+ : Page_breaking (pb, 0, 0)
{
}
/* find out the ideal number of pages */
message (_ ("Finding the ideal number of pages..."));
- if (systems_per_page () > 0)
- best = space_systems_with_fixed_number_per_page (0, first_page_num);
- else
- best = space_systems_on_best_pages (0, first_page_num);
+ best = space_systems_on_best_pages (0, first_page_num);
page_count = best.systems_per_page_.size ();
ideal_sys_count = best.system_count ();
for (vsize i = 0; i < current_configuration_count (); i++)
{
- vsize min_p_count = min_page_count (i, first_page_num);
Page_spacing_result cur;
- if (min_p_count == page_count || scm_is_integer (forced_page_count))
+ if (scm_is_integer (forced_page_count))
cur = space_systems_on_n_pages (i, page_count, first_page_num);
else
- cur = space_systems_on_n_or_one_more_pages (i, page_count-1, first_page_num, 0);
+ cur = space_systems_on_best_pages (i, first_page_num);
if (cur.demerits_ < best_for_this_sys_count.demerits_)
{
if (min_p_count > page_count)
continue;
- else
+ else if (scm_is_integer (forced_page_count))
cur = space_systems_on_n_pages (i, page_count, first_page_num);
+ else
+ cur = space_systems_on_best_pages (i, first_page_num);
if (cur.demerits_ < best.demerits_)
{