From: Joe Neeman Date: Wed, 1 Nov 2006 05:26:57 +0000 (+0000) Subject: * lily/optimal-page-breaking.cc (try_page_spacing): don't average X-Git-Tag: release/2.10.0-2~34^2~44^2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1675830c02451406e7aee71fb76a1548ead5cfc7;p=lilypond.git * lily/optimal-page-breaking.cc (try_page_spacing): don't average page and line forces. --- diff --git a/ChangeLog b/ChangeLog index 7da215df34..a3074889e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-11-01 Joe Neeman + + * lily/optimal-page-breaking.cc (try_page_spacing): don't average + page and line forces. + 2006-11-01 Han-Wen Nienhuys * GNUmakefile.in (SUBDIRS): remove cygwin dir too. diff --git a/lily/optimal-page-breaking.cc b/lily/optimal-page-breaking.cc index 21fb841d66..90bc685f06 100644 --- a/lily/optimal-page-breaking.cc +++ b/lily/optimal-page-breaking.cc @@ -63,16 +63,14 @@ Optimal_page_breaking::try_page_spacing (Line_division const &line_count) { Real uniformity = fabs (ret.force_[i] - ret.force_[i-1]); ret.demerits_ += (ret.force_[i] * ret.force_[i] - + uniformity * uniformity) * page_weighting; + + uniformity * uniformity) * page_weighting; } - /* If ragged_last is true, the last page will have - zero force no matter what. In this case, we exclude it from the average or - we will become biased towards scores with less pages (because the force - of zero will affect the average more when there are fewer pages) */ - if (!ragged_last || ret.force_.size () > 1) - ret.demerits_ /= ret.force_.size () - (ragged_last ? 1 : 0); - line_force /= lines.size (); + /* for a while we tried averaging page and line forces instead of summing + them, but it caused the following problem. If there is a single page + with a very bad page force (for example because of a forced page break), + the page breaker will put in a _lot_ of pages so that the bad force + becomes averaged out over many pages. */ ret.demerits_ += line_force + line_penalty; return ret; }