/* If [START, END] does not contain an intermediate
breakpoint, we may need to consider solutions that result in a bad turn.
In this case, we won't abort if the min_page_count is too big */
- if (start < end - 1 && min_p_count + (page_number % 2) > 2)
+ if (start < end - 1 && min_p_count + (auto_first ? 0 : (page_number % 2)) > 2)
return Break_node ();
/* if PAGE-NUMBER is odd, we are starting on a right hand page. That is, we
return end - 1 + (end % 2);
}
+extern bool debug_page_breaking_scoring;
+
void
Page_turn_page_breaking::calc_subproblem (vsize ending_breakpoint)
{
bool ok_page = true;
+ if (debug_page_breaking_scoring)
+ message (_f ("page-turn-page-breaking: breaking from %d to %d", (int) start, (int) end));
+
/* heuristic: we've just added a breakpoint, we'll need at least as
many systems as before */
min_sys_count = max (min_sys_count, prev_best_system_count);
if (cur.demerits_ < this_start_best.demerits_)
{
+ if (debug_page_breaking_scoring)
+ print_break_node (cur);
+
found = true;
this_start_best = cur;
prev_best_system_count = sys_count;
scm_from_int (soln[0].first_page_number_));
return Page_breaking::make_pages (lines_per_page, systems);
}
+
+void
+Page_turn_page_breaking::print_break_node (Break_node const &node)
+{
+ int system_count = 0;
+ for (vsize i = 0; i < node.system_count_.size (); i++)
+ system_count += node.system_count_[i];
+
+ message (_f ("break starting at page %d", (int) node.first_page_number_));
+ message (_f ("\tdemerits: %f", node.demerits_));
+ message (_f ("\tsystem count: %d", system_count));
+ message (_f ("\tpage count: %d", (int) node.page_count_));
+ message (_f ("\tprevious break: %d", (int) node.prev_));
+}
bool debug_skylines;
bool debug_property_callbacks;
+bool debug_page_breaking_scoring;
/*
Backwards compatibility.
debug_property_callbacks = to_boolean (val);
val = scm_from_bool (to_boolean (val));
}
+ else if (var == ly_symbol2scm ("debug-page-breaking-scoring"))
+ {
+ debug_page_breaking_scoring = to_boolean (val);
+ val = scm_from_bool (to_boolean (val));
+ }
}
(debug-gc-assert-parsed-dead #f "for memory debugging:
ensure that all refs to parsed objects are dead. This is an internal option, and is switched on automatically for -ddebug-gc.")
(debug-lexer #f "debug the flex lexer")
+ (debug-page-breaking-scoring #f "dump scores for many different page breaking configurations")
(debug-parser #f "debug the bison parser")
(debug-property-callbacks #f "debug cyclic callback chains")
(debug-skylines #f "debug skylines")