lilypond-0.1.47
[lilypond.git] / flower / matrix-debug.cc
blob81aa05f39ce1109c2e55a3931d6b86e564285815
1 /*
2 matrix-debug.cc -- implement Matrix print routines
4 source file of the Flower Library
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
10 #include "flower-debug.hh"
11 #include "matrix.hh"
12 #include "matrix-storage.hh"
15 Matrix::operator String() const
17 String s;
18 #ifndef NPRINT
19 Matrix_storage const * stor_c_l = dat;
20 s=String ("matrix { (") + dat->name() + ")\n";
21 for (int i=0; i< rows(); i++)
23 for (int j = 0; j < cols(); j++)
25 s+= String (stor_c_l->elem (i,j), "%6f ");
27 s+="\n";
29 s+="}\n";
30 #endif
31 return s;
35 void
36 Matrix::print() const
38 #ifndef NPRINT
39 fdebug << *this;
40 #endif
43 Vector::operator String() const
45 String s;
46 #ifndef NPRINT
47 s="vector [";
48 for (int i=0; i < dim(); i++)
50 s += String (dat[i], "%6f") + String (' ');
52 s+="]";
53 #endif
54 return s;
58 void
59 Vector::print() const
61 #ifndef NDEBUG
62 fdebug << *this<<'\n';
63 #endif