2 page-spacing-result.cc -- implement Page_spacing_result
4 source file of the GNU LilyPond music typesetter
6 (c) 2007 Han-Wen Nienhuys <hanwen@lilypond.org>
10 #include "page-spacing-result.hh"
12 Page_spacing_result::Page_spacing_result ()
15 demerits_
= infinity_f
;
19 Page_spacing_result::system_count () const
22 for (vsize i
= 0; i
< systems_per_page_
.size(); i
++)
23 total
+= systems_per_page_
[i
];
29 Page_spacing_result::page_count () const
31 return systems_per_page_
.size();
35 Page_spacing_result::average_force () const
37 Real average_force
= 0;
38 for (vsize i
= 0; i
< page_count (); i
++)
39 average_force
+= force_
[i
];
41 average_force
/= page_count ();
46 Page_spacing_result::print () const
48 printf ("penalty %lf, demerits %lf\n" , penalty_
, demerits_
);
49 for (vsize i
= 0; i
< page_count (); i
++)
50 printf (" %d: #sys=%d, force=%lf\n", int (i
), int (systems_per_page_
[i
]),