2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1997--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
23 #include "direction.hh"
27 Left/right or Up/down arrays. Drul is nicer sounding than udlr
35 assert (d == 1 || d == -1);
36 return array_[ (d + 1) / 2];
38 T const &at (Direction d) const
40 assert (d == 1 || d == -1);
41 return array_[ (d + 1) / 2];
43 T &operator [] (Direction d)
47 T const &operator [] (Direction d) const
54 Drul_array (T const &t1, T const &t2)
58 void set (T const &t1, T const &t2)
67 scale_drul (Drul_array<T> *dr, T x)
74 linear_combination (Drul_array<Real> const &d, Real x)
76 return ((1.0 - x) * Real (d.at (LEFT))
77 + (x + 1.0) * Real (d.at (RIGHT))) * 0.5;
80 #endif /* DRUL_ARRAY_HH */