]> git.donarmstrong.com Git - lilypond.git/blob - lily/column-x-positions.cc
release: 1.2.8
[lilypond.git] / lily / column-x-positions.cc
1 /*
2   colhpos.cc -- implement Column_x_positions
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "column-x-positions.hh"
10 #include "real.hh"
11 #include "debug.hh"
12 #include "vector.hh"
13 #include "line-spacer.hh"
14
15 Column_x_positions::Column_x_positions()
16 {
17   energy_f_ = infinity_f;
18   satisfies_constraints_b_ = false;
19   spacer_l_ =0;
20 }
21
22 Column_x_positions::~Column_x_positions()
23 {
24
25 }
26
27 void
28 Column_x_positions::add_paper_column (Paper_column*c)
29 {
30   cols_.push (c);
31 }
32
33 void
34 Column_x_positions::print() const
35 {
36 #ifndef NPRINT
37   DOUT << "energy : " << energy_f_ << '\n';
38   DOUT << "line of " << config_.size() << " cols\n";
39   Vector v (config_);
40   DOUT << v;
41 #endif
42 }
43
44 void
45 Column_x_positions::OK() const
46 {
47 #ifndef NDEBUG
48   assert (config_.size() == cols_.size ());
49 #endif
50 }
51
52 void
53 Column_x_positions::set_stupid_solution(Vector v)
54 {
55   energy_f_ = infinity_f;
56   config_ = v;
57 }
58
59 void
60 Column_x_positions::stupid_solution()
61 {
62   //  set_stupid_solution (spacer_l_->default_solution());
63 }
64
65 void
66 Column_x_positions::solve_line() 
67 {
68   spacer_l_->solve (this);
69 }
70
71
72 void
73 Column_x_positions::approximate_solve_line() 
74 {
75   spacer_l_->lower_bound_solution (this);
76 }
77
78