LEFT | RIGHT |
(no file at all) | |
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) 2005--2019 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 2005--2019 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 6 LilyPond is free software: you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation, either version 3 of the License, or | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 double log_2 (double x); | 29 double log_2 (double x); |
30 | 30 |
31 /* | 31 /* |
32 Return the 2-log, rounded down | 32 Return the 2-log, rounded down |
33 */ | 33 */ |
34 template <class T> | 34 template <class T> |
35 int | 35 int |
36 intlog2 (T d) | 36 intlog2 (T d) |
37 { | 37 { |
| 38 // TODO: To support user-defined types, use namespace std and call |
| 39 // unqualified to_string(). |
38 if (d <= 0) | 40 if (d <= 0) |
39 error ("intlog2 with negative argument: " + ::to_string (d)); | 41 error ("intlog2 with negative argument: " + std::to_string (d)); |
40 int i = 0; | 42 int i = 0; |
41 while ((d != 1)) | 43 while ((d != 1)) |
42 { | 44 { |
43 d /= 2; | 45 d /= 2; |
44 i++; | 46 i++; |
45 } | 47 } |
46 | 48 |
47 assert (! (d / 2)); | 49 assert (! (d / 2)); |
48 return i; | 50 return i; |
49 } | 51 } |
(...skipping 29 matching lines...) Expand all Loading... |
79 } | 81 } |
80 | 82 |
81 Real directed_round (Real f, Direction d); | 83 Real directed_round (Real f, Direction d); |
82 | 84 |
83 Real peak_around (Real epsilon, Real threshold, Real x); | 85 Real peak_around (Real epsilon, Real threshold, Real x); |
84 Real convex_amplifier (Real standard_x, Real increase_factor, Real x); | 86 Real convex_amplifier (Real standard_x, Real increase_factor, Real x); |
85 string camel_case_to_lisp_identifier (const string &in); | 87 string camel_case_to_lisp_identifier (const string &in); |
86 | 88 |
87 #endif | 89 #endif |
88 | 90 |
LEFT | RIGHT |