]> git.donarmstrong.com Git - lilypond.git/blob - lily/template5.cc
Run `make grand-replace'.
[lilypond.git] / lily / template5.cc
1 /*
2   template5.cc -- instantiate Intervals
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #include "moment.hh"
10 #include "real.hh"
11 #include "interval.hh"
12
13 #include "interval.tcc"
14
15 template<>
16 Rational
17 Interval_t<Rational>::infinity ()
18 {
19   Rational infty;
20   infty.set_infinite (1);
21   return infty;
22 }
23
24
25 template<>
26 string
27 Interval_t<Rational>::T_to_string (Rational a)
28 {
29   return a.to_string ();
30 }
31
32 template INTERVAL__INSTANTIATE (Rational);
33
34
35 template<>
36 Moment
37 Interval_t<Moment>::infinity ()
38 {
39   Moment infty;
40   
41   infty.main_part_.set_infinite (1);
42   return infty;
43 }
44
45
46 template<>
47 string
48 Interval_t<Moment>::T_to_string (Moment a)
49 {
50   return a.to_string ();
51 }
52
53 template INTERVAL__INSTANTIATE (Moment);
54
55 template<>
56 Real
57 Interval_t<Real>::linear_combination (Real x) const
58 {
59   Drul_array<Real> da (at (LEFT), at (RIGHT));
60   return ::linear_combination (da, x);
61 }