From: fred Date: Fri, 11 Oct 1996 22:46:53 +0000 (+0000) Subject: flower-1.0.2 X-Git-Tag: release/1.5.59~7084 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0dd5f17a771e86d88548a06e6dd268075c89f123;p=lilypond.git flower-1.0.2 --- diff --git a/flower/matdebug.cc b/flower/matdebug.cc new file mode 100644 index 0000000000..5a31312386 --- /dev/null +++ b/flower/matdebug.cc @@ -0,0 +1,55 @@ +#include "dstream.hh" +#include "matrix.hh" + +static Dstream *dout = new Dstream(0,0); + +void set_matrix_debug(Dstream&ds) +{ + dout = &ds; +} + +Matrix::operator String() const +{ + String s("matrix {\n"); +#ifndef NPRINT + for (int i=0; i< rows(); i++){ + for (int j = 0; j < cols(); j++) { + s+= String(dat->elem(i,j), "%6f "); + } + s+="\n"; + } + s+="}\n"; +#endif + return s; +} + + +void +Matrix::print() const +{ +#ifndef NPRINT + *dout << *this; +#endif +} + +Vector::operator String() const +{ + int i=0; + String s("vector ["); +#ifndef NDEBUG + for (; i < dim(); i++) { + s += String(dat[i], "%6f") + ' '; + } +#endif + s+="]"; + return s; +} + + +void +Vector::print() const +{ +#ifndef NDEBUG + *dout << *this<<'\n'; +#endif +}