2 break.hh -- declare Break_algorithm
4 source file of the LilyPond music typesetter
6 (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
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 struct Break_algorithm {
29 Break_algorithm(PScore&);
31 /// check if the spacing/breaking problem is well-stated
32 void problem_OK()const;
34 /// search all pcols which are breakable.
35 Line_of_cols find_breaks() const;
37 /// helper: solve for the columns in #curline#.
38 Col_hpositions solve_line(Line_of_cols) const;
40 /// does curline fit on the paper?
41 bool feasible(Line_of_cols)const;
43 virtual Array<Col_hpositions> solve()=0;
46 /// wordwrap type algorithm: move to next line if current is optimal.
47 struct Word_wrap : Break_algorithm {
48 virtual Array<Col_hpositions> solve();