lilypond-1.5.37
[lilypond.git] / flower / matrix-debug.cc
blob323962e2c21e61c02b1614c912551759801ef8d7
1 /*
2 matrix-debug.cc -- implement Matrix print routines
4 source file of the Flower Library
6 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
10 #include "flower-debug.hh"
11 #include "matrix.hh"
13 String
14 Matrix::str () const
16 String s;
17 #ifndef NPRINT
18 Full_storage const * stor_c_l = dat_;
19 s = String ("matrix {");
20 for (int i=0; i< rows(); i++)
22 for (int j = 0; j < cols(); j++)
24 s+= to_str (stor_c_l->elem (i,j), "%6f ");
26 s+="\n";
28 s+="}\n";
29 #endif
30 return s;
34 void
35 Matrix::print () const
37 #ifndef NPRINT
38 fdebug << *this;
39 #endif
42 String
43 Vector::str () const
45 String s;
46 #ifndef NPRINT
47 s = String ("vector (") + to_str (dim ()) + ") [";
48 for (int i=0; i < dim(); i++)
50 s += to_str (dat[i], "%6f") + to_str (' ');
52 s += "]\n";
53 #endif
54 return s;
58 void
59 Vector::print() const
61 #ifndef NDEBUG
62 fdebug << *this << '\n';
63 #endif