]> www.ginac.de Git - ginac.git/blobdiff - ginac/matrix.cpp
fixed a bug where quo() would call vector::reserve() with a negative argument
[ginac.git] / ginac / matrix.cpp
index 8afa7b58cfc928b20e716100e69a149c75749f96..0bedb6bb1a1e506fc0017ea3243d66c64ed3797a 100644 (file)
@@ -20,6 +20,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <iostream>
 #include <algorithm>
 #include <map>
 #include <stdexcept>
@@ -146,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 << "[";
@@ -164,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 << ')';
+
        }
 }
 
@@ -776,7 +783,7 @@ ex matrix::determinant(unsigned algo) const
                                                ++acc;
                                c_zeros.push_back(uintpair(acc,c));
                        }
-                       sort(c_zeros.begin(),c_zeros.end());
+                       std::sort(c_zeros.begin(),c_zeros.end());
                        std::vector<unsigned> pre_sort;
                        for (std::vector<uintpair>::const_iterator i=c_zeros.begin(); i!=c_zeros.end(); ++i)
                                pre_sort.push_back(i->second);