]> git.donarmstrong.com Git - lilypond.git/blob - flower/vector.cc
release: 1.0.1
[lilypond.git] / flower / vector.cc
1 /*   
2   vector.cc --  implement Vector
3   
4   source file of the Flower Library
5   
6   (c) 1996-98 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #include "vector.hh"
11
12 Vector::Vector (Array<Real> d)
13      : dat (d)
14 {
15  
16 }
17 Vector::Vector (Vector const &n)
18   : dat (n.dat)
19 {
20 }    
21
22 Vector
23 Vector::operator-() const
24 {
25   Vector v (*this);
26   v*=-1;
27   return v;
28 }
29
30 void
31 Vector::set_unit (int j)
32 {
33   fill (0.0);
34   dat[j] = 1.0;
35 }