2 page-spacing.hh -- routines for spacing systems
3 vertically across pages
5 source file of the GNU LilyPond music typesetter
7 (c) 2006 Joe Neeman <joeneeman@gmail.com>
10 #ifndef PAGE_SPACING_HH
11 #define PAGE_SPACING_HH
13 #include "constrained-breaking.hh"
15 struct Spacing_result {
16 vector<vsize> systems_per_page_;
24 demerits_ = infinity_f;
28 /* for page_count > 2, we use a dynamic algorithm similar to
29 constrained-breaking -- we have a class that stores the intermediate
30 calculations so they can be reused for querying different page counts.
36 Page_spacer (vector<Line_details> const &lines, Real page_height, bool ragged, bool ragged_last);
37 Spacing_result solve (vsize page_count);
40 struct Page_spacing_node
44 demerits_ = infinity_f;
46 penalty_ = infinity_f;
57 vector<Line_details> lines_;
58 Matrix<Page_spacing_node> state_;
59 vsize max_page_count_;
64 void resize (vsize page_count);
65 bool calc_subproblem (vsize page, vsize lines);
69 min_page_count (vector<Line_details> const &lines,
70 Real page_height, bool ragged, bool ragged_last);
73 space_systems_on_n_pages (vector<Line_details> const&,
80 space_systems_on_n_or_one_more_pages (vector<Line_details> const&,
83 Real odd_pages_penalty,
87 space_systems_on_best_pages (vector<Line_details> const&,
89 Real odd_pages_penalty,
93 #endif /* PAGE_SPACING_HH */