2 drul-array.hh -- declare Drul_array
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
12 #include "direction.hh"
16 Left/right or Up/down arrays. Drul is nicer sounding than udlr
24 assert (d == 1 || d == -1);
25 return array_[ (d + 1) / 2];
27 T const &at (Direction d) const
29 assert (d == 1 || d == -1);
30 return array_[ (d + 1) / 2];
32 T &operator [] (Direction d)
36 T const& operator [] (Direction d) const
43 Drul_array (T t1, T t2)
52 scale_drul (Drul_array<T> *dr, T x)
59 linear_combination (Drul_array<Real> const &d, Real x)
61 return ((1.0 - x) * Real (d.at (LEFT))
62 + (x + 1.0) * Real (d.at (RIGHT))) * 0.5;
65 #endif /* DRUL_ARRAY_HH */