2 break-algorithm.hh -- declare Break_algorithm
4 source file of the GNU LilyPond music typesetter
6 (c) 1996--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
14 #include "interval.hh"
15 #include "lily-proto.hh"
16 #include "column-x-positions.hh"
19 /** Class representation of an algorithm which decides where to put
20 the column, and where to break lines.
23 class Break_algorithm {
25 Paper_score *pscore_l_;
28 /// search all pcols which are breakable.
29 Link_array<Paper_column> find_breaks() const;
31 Array<int> find_break_indices() const;
34 /// helper: solve for the columns in #curline#.
35 void solve_line (Column_x_positions*) const;
37 /// helper: approximate the energyv
38 void approximate_solve_line (Column_x_positions*) const;
40 /// does curline fit on the paper?
41 bool feasible (Link_array<Paper_column>) const;
44 Simple_spacer* generate_spacing_problem (Link_array<Paper_column>, Interval) const;
46 virtual Array<Column_x_positions> do_solve() const=0;
47 virtual void do_set_pscore();
50 Simple_spacer* (*get_line_spacer)();
52 void set_pscore (Paper_score*);
54 /// check if the spacing/breaking problem is well-stated
55 void problem_OK() const;
57 Array<Column_x_positions> solve() const;