X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fmatrix.cpp;h=8daa11db0fab78332effeec157ed16fb17b4294f;hp=3d735fe46689aa57fc0d973a0b8588e07f2049f8;hb=35287d4fef8dc61a10966091ff662eeb9444f87a;hpb=fbdd5eefb7188778ca9c04b5bee08223609b880f diff --git a/ginac/matrix.cpp b/ginac/matrix.cpp index 3d735fe4..8daa11db 100644 --- a/ginac/matrix.cpp +++ b/ginac/matrix.cpp @@ -3,7 +3,7 @@ * Implementation of symbolic matrices */ /* - * GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2002 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -147,23 +147,44 @@ void matrix::print(const print_context & c, unsigned level) const } else { - c.s << "["; - for (unsigned y=0; y(c)) + c.s << class_name() << '('; + + if (is_a(c)) + c.s << "\\left(\\begin{array}{" << std::string(col,'c') << "}"; + else c.s << "["; - for (unsigned x=0; x(c)) + c.s << "["; + for (unsigned co=0; co(c)) + c.s << "&"; + else + c.s << ","; + } else { + if (!is_a(c)) + c.s << "]"; + } + } + if (ro(c)) + c.s << "\\\\"; + else + c.s << ","; } - m[col*(y+1)-1].print(c); - c.s << "],"; - } - c.s << "["; - for (unsigned x=0; x(c)) + c.s << "\\end{array}\\right)"; + else + c.s << "]"; + + if (is_a(c)) + c.s << ')'; } } @@ -599,17 +620,19 @@ matrix matrix::pow(const ex & expn) const matrix C(row,col); for (unsigned r=0; r