* Added output-support for Python bindings and LaTeX printing for
[ginac.git] / ginac / matrix.cpp
index 3d735fe46689aa57fc0d973a0b8588e07f2049f8..0bedb6bb1a1e506fc0017ea3243d66c64ed3797a 100644 (file)
@@ -147,6 +147,9 @@ void matrix::print(const print_context & c, unsigned level) const
 
        } else {
 
+               if (is_a<print_python_repr>(c))
+                       c.s << class_name() << '(';
+
                c.s << "[";
                for (unsigned y=0; y<row-1; ++y) {
                        c.s << "[";
@@ -165,6 +168,9 @@ void matrix::print(const print_context & c, unsigned level) const
                m[row*col-1].print(c);
                c.s << "]]";
 
+               if (is_a<print_python_repr>(c))
+                       c.s << ')';
+
        }
 }