diff options
author | Han-Wen Nienhuys <hanwen@xs4all.nl> | 2007-01-24 02:26:17 +0100 |
---|---|---|
committer | Han-Wen Nienhuys <hanwen@xs4all.nl> | 2007-01-24 02:26:17 +0100 |
commit | 94fdd3f7932666ac1b3169854ea0a9964b5d32f3 (patch) | |
tree | d22763abd419d6d1b48302692b801138c242516d /lily | |
parent | 276a9e6cfdc0ff7a6b4734b15a673a7c6b16d7fb (diff) |
interval template and offset tweaks.
Diffstat (limited to 'lily')
-rw-r--r-- | lily/template5.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lily/template5.cc b/lily/template5.cc index cbf4f3bfa7..b669abb899 100644 --- a/lily/template5.cc +++ b/lily/template5.cc @@ -7,6 +7,8 @@ */ #include "moment.hh" +#include "real.hh" +#include "interval.hh" #include "interval.tcc" @@ -19,6 +21,7 @@ Interval_t<Rational>::infinity () return infty; } + template<> string Interval_t<Rational>::T_to_string (Rational a) @@ -27,3 +30,32 @@ Interval_t<Rational>::T_to_string (Rational a) } template INTERVAL__INSTANTIATE (Rational); + + +template<> +Moment +Interval_t<Moment>::infinity () +{ + Moment infty; + + infty.main_part_.set_infinite (1); + return infty; +} + + +template<> +string +Interval_t<Moment>::T_to_string (Moment a) +{ + return a.to_string (); +} + +template INTERVAL__INSTANTIATE (Moment); + +template<> +Real +Interval_t<Real>::linear_combination (Real x) const +{ + Drul_array<Real> da (at (LEFT), at (RIGHT)); + return ::linear_combination (da, x); +} |