2 page-turn-page-breaking.hh -- break lines and pages optimally
3 for a whole Paper_book such that page turns can only occur
6 source file of the GNU LilyPond music typesetter
8 (c) 2006 Joe Neeman <joeneeman@gmail.com>
11 #ifndef PAGE_TURN_PAGE_BREAKING_HH
12 #define PAGE_TURN_PAGE_BREAKING_HH
14 #include "constrained-breaking.hh"
15 #include "page-breaking.hh"
16 #include "lily-guile.hh"
19 A dynamic programming solution to breaking pages
21 class Page_turn_page_breaking: public Page_breaking
26 Page_turn_page_breaking (Paper_book *pb);
27 virtual ~Page_turn_page_breaking ();
33 int first_page_number_;
42 /* true if every score here is too widely spaced */
46 vsize break_pos_; /* index into breaks_ */
49 vector<vsize> system_count_; /* systems per page */
53 prev_ = break_pos_ = VPOS;
54 penalty_ = force_ = 0;
55 line_penalty_ = line_force_ = 0;
56 demerits_ = infinity_f;
57 first_page_number_ = 0;
59 too_many_lines_ = false;
63 vector<Break_node> state_;
65 vsize final_page_num (Break_node const &b);
66 Break_node put_systems_on_pages (vsize start,
68 vector<Line_details> const &lines,
69 Line_division const &div,
72 SCM make_lines (vector<Break_node> *breaks);
73 SCM make_pages (vector<Break_node> const &breaks, SCM systems);
75 Real calc_demerits (Break_node const &me);
76 void calc_subproblem (vsize i);
78 #endif /* PAGE_TURN_PAGE_BREAKING_HH */