]> www.ginac.de Git - ginac.git/blobdiff - ginac/matrix.h
- Fixed the bug that broke xloop's po_redux.
[ginac.git] / ginac / matrix.h
index 60931cc54a3e5d71d8ce6077cbfaae538c5b628b..cef3dc36667b3c08d5b4c2c4a7525f5a6efcec0e 100644 (file)
 #include "basic.h"
 #include "ex.h"
 
+namespace std {
+    // forward declaration, so <stdexcept> need not be included:
+    class range_error;
+}
+
 #ifndef NO_NAMESPACE_GINAC
 namespace GiNaC {
 #endif // ndef NO_NAMESPACE_GINAC
@@ -59,8 +64,8 @@ public:
     // functions overriding virtual functions from bases classes
 public:
     basic * duplicate() const;
-    void print(ostream & os, unsigned upper_precedence=0) const;
-    void printraw(ostream & os) const;
+    void print(std::ostream & os, unsigned upper_precedence=0) const;
+    void printraw(std::ostream & os) const;
     unsigned nops() const;
     ex op(int i) const;
     ex & let_op(int i);
@@ -89,25 +94,18 @@ public:
     matrix transpose(void) const;
     ex determinant(void) const;
     ex trace(void) const;
-    ex charpoly(const ex & lambda) const;
+    ex charpoly(const symbol & lambda) const;
     matrix inverse(void) const;
     matrix fraction_free_elim(const matrix & vars, const matrix & v) const;
     matrix solve(const matrix & vars, const matrix & rhs) const;
     matrix old_solve(const matrix & v) const;  // FIXME: may be removed
 protected:
-    ex determinant_numeric(void) const;
-    ex determinant_minor_sparse(void) const;
-    ex determinant_minor_dense(void) const;
-    ex determinant_bareiss(void) const;
-    ex determinant_perm(void) const;
+    ex determinant_minor(void) const;
     int gauss_elimination(void);
-    int fraction_free_elimination(void);
     int division_free_elimination(void);
+    int fraction_free_elimination(bool det = false);
     int pivot(unsigned ro, bool symbolic=true);
-private:  // FIXME: these should be obsoleted
-    void ffe_swap(unsigned r1, unsigned c1, unsigned r2 ,unsigned c2);
-    void ffe_set(unsigned r, unsigned c, ex e);
-    ex ffe_get(unsigned r, unsigned c) const;
+    void swap(unsigned r1, unsigned c1, unsigned r2 ,unsigned c2);
     
 // member variables
 protected:
@@ -117,10 +115,12 @@ protected:
     static unsigned precedence;
 };
 
+
 // global constants
 extern const matrix some_matrix;
 extern const type_info & typeid_matrix;
 
+
 // wrapper functions around member functions
 
 inline unsigned nops(const matrix & m)
@@ -153,7 +153,7 @@ inline ex determinant(const matrix & m)
 inline ex trace(const matrix & m)
 { return m.trace(); }
 
-inline ex charpoly(const matrix & m, const ex & lambda)
+inline ex charpoly(const matrix & m, const symbol & lambda)
 { return m.charpoly(lambda); }
 
 inline matrix inverse(const matrix & m)