2 break.hh -- declare Break_algorithm
4 source file of the GNU LilyPond music typesetter
6 (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
13 #include "lily-proto.hh"
16 /** Class representation of an algorithm which decides where to put
17 the column, and where to break lines.
19 TODO: a decent algorithm, based on dynamic programming or something
20 a like. A "parindent", caching of breakpoints
23 class Break_algorithm {
24 Line_spacer* generate_spacing_problem(Line_of_cols)const;
29 /// search all pcols which are breakable.
30 Line_of_cols find_breaks() const;
32 /// helper: solve for the columns in #curline#.
33 Col_hpositions solve_line(Line_of_cols) const;
35 /// does curline fit on the paper?
36 bool feasible(Line_of_cols)const;
39 /** generate a solution with no regard to idealspacings or
40 constraints. should always work */
41 Col_hpositions stupid_solution(Line_of_cols) const;
42 virtual Array<Col_hpositions> do_solve()const=0;
44 Line_spacer* (*get_line_spacer)();
46 Break_algorithm(PScore&);
48 /// check if the spacing/breaking problem is well-stated
49 void problem_OK()const;
51 Array<Col_hpositions> solve()const;