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"
14 #include "page-spacing-result.hh"
17 /* for page_count > 2, we use a dynamic algorithm similar to
18 constrained-breaking -- we have a class that stores the intermediate
19 calculations so they can be reused for querying different page counts.
24 Page_spacer (vector<Line_details> const &lines, vsize first_page_num, Page_breaking const*);
25 Page_spacing_result solve (vsize page_count);
28 struct Page_spacing_node
32 demerits_ = infinity_f;
34 penalty_ = infinity_f;
44 Page_breaking const *breaker_;
45 vsize first_page_num_;
46 vector<Line_details> lines_;
47 Matrix<Page_spacing_node> state_;
48 vsize max_page_count_;
53 void resize (vsize page_count);
54 bool calc_subproblem (vsize page, vsize lines);
63 Real inverse_spring_k_;
65 Line_details last_line_;
67 Page_spacing (Real page_height)
69 page_height_ = page_height;
74 void resize (Real new_height);
75 void append_system (const Line_details &line);
76 void prepend_system (const Line_details &line);
80 #endif /* PAGE_SPACING_HH */