]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/interval.hh
release: 0.1.52
[lilypond.git] / flower / include / interval.hh
index d236759219e1f66887b988b4111cfb1739bda840..7a868a31ab9b92b8eac30849c01eae4c092613ac 100644 (file)
@@ -24,6 +24,7 @@ struct Interval_t {
   /* ************** */
     
   static T infinity() ;
+  static String T_to_str (T arg);
     
   T center() { return (left + right) / T(2);}
   void translate (T t) {
@@ -85,6 +86,12 @@ struct Interval_t {
   String str() const;    
   void print () const;
   bool elt_b (T r);
+  void negate () {
+    T r = -left;
+    T l = -right;
+    left = l;
+    right =r;
+  }
 };
 
 
@@ -120,6 +127,23 @@ Interval_t<T> operator +(T a,Interval_t<T> i)
   return i;
 }
 
+template<class T>
+inline
+Interval_t<T> operator - (Interval_t<T> i, T a)
+{
+  i += -a;
+  return i;
+}
+
+template<class T>
+inline
+Interval_t<T> operator - (T a,Interval_t<T> i)
+{
+  i.negate ();
+  i += a;
+  return i;
+}
+
 template<class T>
 inline
 Interval_t<T> operator +(Interval_t<T> i,T a){