2 drul-array.hh -- declare Drul_array
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
13 #include "direction.hh"
19 Left/right or Up/down arrays. Drul is nicer sounding than udlr
27 assert (d==1 || d== -1);
28 return array_[ (d+1)/2];
31 T &operator[] (Direction d)
35 T elem (Direction d) const
37 assert (d==1 || d== -1);
38 return array_[ (d+1)/2];
41 T operator[] (Direction d) const
47 Drul_array (T t1, T t2)
56 scale_drul (Drul_array<T> * dr, T x)
59 dr->elem (RIGHT) *= x;
63 linear_combination (Drul_array<Real> const &d, Real x)
65 return ((1.0 - x) * Real (d.elem (LEFT)) + (x + 1.0) * Real (d.elem (RIGHT))) * 0.5;
68 #endif // DRUL_ARRAY_HH