]> git.donarmstrong.com Git - lilypond.git/blob - lily/dot-formatting-problem.cc
init score_ in ctor
[lilypond.git] / lily / dot-formatting-problem.cc
1
2 #include "dot-formatting-problem.hh"
3 #include "dot-configuration.hh"
4 #include "skyline.hh"
5
6 Dot_formatting_problem::~Dot_formatting_problem()
7 {
8   delete best_;
9 }
10
11 void
12 Dot_formatting_problem::register_configuration (Dot_configuration const &src)
13 {
14   int b = src.badness ();
15   if (b < score_)
16     {
17       delete best_;
18       best_ = new Dot_configuration (src);
19     }
20 }
21
22 Dot_configuration *
23 Dot_formatting_problem::best () const
24 {
25   return best_;
26 }
27
28
29
30 Dot_formatting_problem::Dot_formatting_problem (vector<Box> const &boxes, Interval base_x)
31   : head_skyline_ (boxes, 0.0, Y_AXIS, RIGHT)
32 {
33   best_ = 0;
34   head_skyline_.set_minimum_height (base_x[RIGHT]);
35   score_ = 1 << 30;
36 }