]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/interval.cc
Run `make grand-replace'.
[lilypond.git] / flower / interval.cc
index b307f4c634f5974ecf0fa12eddce38817f314218..fcfa18dbd7fcdedba4bc490278e0090fd9734783 100644 (file)
@@ -1,18 +1,42 @@
-#include <assert.h> 
+/*
+  interval.cc -- instantiate Interval_t<Real>
+
+  source file of the Flower Library
+
+  (c) 1997--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
+*/
+
 #include "interval.hh"
-#include <math.h>
 
-const Real INFTY = HUGE;
+#include "interval.tcc"
 
-void
-Interval::set_empty() {
-    min = INFTY;
-    max = -INFTY;
+template<>
+Real
+Interval_t<Real>::infinity ()
+{
+  return HUGE_VAL;
 }
 
-Real
-Interval::length() const {
-    assert(max >= min);
-    return max-min;
+template<>
+string
+Interval_t<Real>::T_to_string (Real r)
+{
+  return ::to_string (r);
+}
+
+template<>
+int
+Interval_t<int>::infinity ()
+{
+  return INT_MAX;
+}
+
+template<>
+string
+Interval_t<int>::T_to_string (int i)
+{
+  return ::to_string (i);
 }
 
+template INTERVAL__INSTANTIATE (int);
+template INTERVAL__INSTANTIATE (Real);