]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/misc.hh
release: 1.0.1
[lilypond.git] / lily / include / misc.hh
1 #ifndef MISC_HH
2 #define MISC_HH
3
4 #include <stdlib.h>
5
6 #include "real.hh"
7 #include "array.hh"
8 #include "interval.hh"
9
10 double log_2(double x) ;
11 int intlog2(int d);
12
13 #if 0
14                                 // defined in real.hh
15 inline int
16 abs (int i){
17     return (i < 0)?-i:i;
18 }
19 #endif
20
21 inline int
22 sign (int i) {
23     if (i<0) return -1;
24     else if (i) return 1;
25     else return 0;
26 }
27
28 #ifndef STANDALONE
29 #include "lily-proto.hh"
30 Interval itemlist_width (const Array<Item*> &its);
31 #endif
32
33 void set_frobnify (void*, size_t);
34 int get_lower_bound (Array<Real> const& positions, Real x);
35 Slice get_bounds_slice (Array<Real> const& positions, Real x);
36 Interval get_bounds_iv (Array<Real> const& positions, Real x);
37 Interval quantise_iv (Array<Real> const& positions, Real period, Real x);
38
39 #endif
40