]> git.donarmstrong.com Git - lilypond.git/blob - flower/matrix-debug.cc
release: 0.0.44
[lilypond.git] / flower / matrix-debug.cc
1 #include "flower-debug.hh"
2 #include "matrix.hh"
3
4
5 Matrix::operator String() const
6 {
7     String s;
8 #ifndef NPRINT
9     s="matrix {\n";
10     for (int i=0; i< rows(); i++){
11         for (int j = 0; j < cols(); j++) {
12             s+= String(dat->elem(i,j), "%6f ");
13         }
14         s+="\n";
15     }
16     s+="}\n";
17 #endif
18     return s;
19 }
20
21
22 void
23 Matrix::print() const
24 {
25 #ifndef NPRINT
26     fdebug << *this;
27 #endif
28 }
29
30 Vector::operator String() const
31 {
32     String s;
33 #ifndef NPRINT
34     s="vector [";
35     for (int i=0; i < dim(); i++) {
36         s += String(dat[i], "%6f") + String(' ');
37     }
38     s+="]";
39 #endif
40     return s;
41 }
42
43
44 void
45 Vector::print() const
46 {
47 #ifndef NDEBUG
48     fdebug << *this<<'\n';
49 #endif
50 }