2 page-spacing-result.cc -- implement Page_spacing_result
4 source file of the GNU LilyPond music typesetter
6 (c) 2007--2009 Han-Wen Nienhuys <hanwen@lilypond.org>
10 #include "page-spacing-result.hh"
13 Page_spacing_result::Page_spacing_result ()
16 demerits_
= infinity_f
;
17 system_count_status_
= SYSTEM_COUNT_OK
;
21 Page_spacing_result::system_count () const
24 for (vsize i
= 0; i
< systems_per_page_
.size(); i
++)
25 total
+= systems_per_page_
[i
];
31 Page_spacing_result::page_count () const
33 return systems_per_page_
.size();
37 Page_spacing_result::average_force () const
39 Real average_force
= 0;
40 for (vsize i
= 0; i
< page_count (); i
++)
41 average_force
+= force_
[i
];
43 average_force
/= page_count ();
48 Page_spacing_result::print () const
50 printf ("penalty %lf, demerits %lf\n" , penalty_
, demerits_
);
51 for (vsize i
= 0; i
< page_count (); i
++)
52 printf (" %d: #sys=%d, force=%lf\n", int (i
), int (systems_per_page_
[i
]),