2 drul-array.hh -- declare Drul_array
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2008 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 const &t1, T const &t2)
47 void set (T const &t1, T const &t2)
56 scale_drul (Drul_array<T> *dr, T x)
63 linear_combination (Drul_array<Real> const &d, Real x)
65 return ((1.0 - x) * Real (d.at (LEFT))
66 + (x + 1.0) * Real (d.at (RIGHT))) * 0.5;
69 #endif /* DRUL_ARRAY_HH */