X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=flower%2Finclude%2Finterval.tcc;h=72be6e81e92161984a74cfb6128902bb3d2ade31;hb=82e8427010b8e1a932e0642f03b0c94a8494f03a;hp=7a1440a31986b55a6bff52cd7df734f0665da8b0;hpb=8fbc1ac88d969b8ce2338fc1cefbf9708b7434f3;p=lilypond.git diff --git a/flower/include/interval.tcc b/flower/include/interval.tcc index 7a1440a319..72be6e81e9 100644 --- a/flower/include/interval.tcc +++ b/flower/include/interval.tcc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1996--2010 Han-Wen Nienhuys + Copyright (C) 1996--2015 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -70,14 +70,14 @@ void Interval_t::set_empty () { at (LEFT) = (T) infinity (); - at (RIGHT) = (T) -infinity (); + at (RIGHT) = (T) - infinity (); } template void Interval_t::set_full () { - at (LEFT) = (T) -infinity (); + at (LEFT) = (T) - infinity (); at (RIGHT) = (T) infinity (); } @@ -123,6 +123,15 @@ Interval_t::unite_disjoint (Interval_t h, T padding, Direction d) unite (h); } +template +Interval_t +Interval_t::union_disjoint (Interval_t h, T padding, Direction d) const +{ + Interval_t iv = *this; + iv.unite_disjoint (h, padding, d); + return iv; +} + template void Interval_t::intersect (Interval_t h) @@ -140,7 +149,7 @@ Interval_t::to_string () const string s ("["); return (s + T_to_string (at (LEFT)) + string (",") - + T_to_string (at (RIGHT)) + string ("]")); + + T_to_string (at (RIGHT)) + string ("]")); } template @@ -150,7 +159,7 @@ Interval_t::contains (T r) const return r >= at (LEFT) && r <= at (RIGHT); } -#define INTERVAL__INSTANTIATE(T) struct Interval_t; \ +#define INTERVAL__INSTANTIATE(T) struct Interval_t; \ template int Interval__compare (const Interval_t &, Interval_t const &) #endif // INTERVAL_TCC