]> git.donarmstrong.com Git - lilypond.git/blob - flower/matrix-debug.cc
release: 0.1.61
[lilypond.git] / flower / matrix-debug.cc
1 /*
2   matrix-debug.cc -- implement Matrix print routines
3
4   source file of the Flower Library
5
6   (c)  1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9
10 #include "flower-debug.hh"
11 #include "matrix.hh"
12
13 Matrix::operator String() const
14 {
15   String s;
16 #ifndef NPRINT
17   Full_storage const * stor_c_l = dat_;
18   s=String ("matrix {");
19   for (int i=0; i< rows(); i++)
20     {
21       for (int j = 0; j < cols(); j++) 
22         {
23           s+= String (stor_c_l->elem (i,j), "%6f ");
24         }
25       s+="\n";
26     }
27   s+="}\n";
28 #endif
29   return s;
30 }
31
32
33 void
34 Matrix::print() const
35 {
36 #ifndef NPRINT
37   fdebug << *this;
38 #endif
39 }
40
41 Vector::operator String() const
42 {
43   String s;
44 #ifndef NPRINT
45   s=String ("vector (") + dim () + ") [";
46   for (int i=0; i < dim(); i++) 
47     {
48       s += String (dat[i], "%6f") + String (' ');
49     }
50   s+="]\n";
51 #endif
52   return s;
53 }
54
55
56 void
57 Vector::print() const
58 {
59 #ifndef NDEBUG
60   fdebug << *this<<'\n';
61 #endif
62 }