LEFT | RIGHT |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 2007--2020 Han-Wen Nienhuys <hanwen@lilypond.org> | 4 Copyright (C) 2007--2020 Han-Wen Nienhuys <hanwen@lilypond.org> |
5 | 5 |
6 | 6 |
7 LilyPond is free software: you can redistribute it and/or modify | 7 LilyPond is free software: you can redistribute it and/or modify |
8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
9 the Free Software Foundation, either version 3 of the License, or | 9 the Free Software Foundation, either version 3 of the License, or |
10 (at your option) any later version. | 10 (at your option) any later version. |
(...skipping 23 matching lines...) Expand all Loading... |
34 return systems_per_page_.size (); | 34 return systems_per_page_.size (); |
35 } | 35 } |
36 | 36 |
37 Real | 37 Real |
38 Page_spacing_result::average_force () const | 38 Page_spacing_result::average_force () const |
39 { | 39 { |
40 Real average_force = 0; | 40 Real average_force = 0; |
41 for (vsize i = 0; i < page_count (); i++) | 41 for (vsize i = 0; i < page_count (); i++) |
42 average_force += force_[i]; | 42 average_force += force_[i]; |
43 | 43 |
44 average_force /= Real (page_count ()); | 44 average_force /= static_cast<Real> (page_count ()); |
45 return average_force; | 45 return average_force; |
46 } | 46 } |
47 | 47 |
48 void | 48 void |
49 Page_spacing_result::print () const | 49 Page_spacing_result::print () const |
50 { | 50 { |
51 printf ("penalty %lf, demerits %lf\n", penalty_, demerits_); | 51 printf ("penalty %lf, demerits %lf\n", penalty_, demerits_); |
52 for (vsize i = 0; i < page_count (); i++) | 52 for (vsize i = 0; i < page_count (); i++) |
53 printf (" %d: #sys=%d, force=%lf\n", int (i), int (systems_per_page_[i]), | 53 printf (" %d: #sys=%d, force=%lf\n", int (i), int (systems_per_page_[i]), |
54 force_[i]); | 54 force_[i]); |
55 } | 55 } |
LEFT | RIGHT |