- debugmsg("matrix print",LOGLEVEL_PRINT);
- os << "[[ ";
- for (unsigned r=0; r<row-1; ++r) {
- os << "[[";
- for (unsigned c=0; c<col-1; ++c)
- os << m[r*col+c] << ",";
- os << m[col*(r+1)-1] << "]], ";
- }
- os << "[[";
- for (unsigned c=0; c<col-1; ++c)
- os << m[(row-1)*col+c] << ",";
- os << m[row*col-1] << "]] ]]";
-}
+ debugmsg("matrix print", LOGLEVEL_PRINT);
+
+ if (is_of_type(c, print_tree)) {
+
+ inherited::print(c, level);
+
+ } else {
+
+ c.s << "[[ ";
+ for (unsigned y=0; y<row-1; ++y) {
+ c.s << "[[";
+ for (unsigned x=0; x<col-1; ++x) {
+ m[y*col+x].print(c);
+ c.s << ",";
+ }
+ m[col*(y+1)-1].print(c);
+ c.s << "]], ";
+ }
+ c.s << "[[";
+ for (unsigned x=0; x<col-1; ++x) {
+ m[(row-1)*col+x].print(c);
+ c.s << ",";
+ }
+ m[row*col-1].print(c);
+ c.s << "]] ]]";