2 page-spacing.hh -- routines for spacing systems
3 vertically across pages
5 source file of the GNU LilyPond music typesetter
7 (c) 2006--2007 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.
38 Page_spacer (vector<Line_details> const &lines, vsize first_page_num, Page_breaking const*);
39 Spacing_result solve (vsize page_count);
42 struct Page_spacing_node
46 demerits_ = infinity_f;
48 penalty_ = infinity_f;
58 Page_breaking const *breaker_;
59 vsize first_page_num_;
60 vector<Line_details> lines_;
61 Matrix<Page_spacing_node> state_;
62 vsize max_page_count_;
67 void resize (vsize page_count);
68 bool calc_subproblem (vsize page, vsize lines);
77 Real inverse_spring_k_;
79 Line_details last_line_;
81 Page_spacing (Real page_height)
83 page_height_ = page_height;
89 void append_system (const Line_details &line);
90 void prepend_system (const Line_details &line);
94 Real line_space (Line_details const &line);
95 #endif /* PAGE_SPACING_HH */