]> www.ginac.de Git - ginac.git/blobdiff - ginac/matrix.h
- Made determinant_algo (in flags.h) really work.
[ginac.git] / ginac / matrix.h
index 65eebde91697a504f7c03f72e205cbe32cd0272c..b737a38c72fec2e74b118cf57aaf285a295bb6ce 100644 (file)
@@ -59,8 +59,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);
@@ -77,9 +77,9 @@ protected:
     
     // non-virtual functions in this class
 public:
-    unsigned rows(void) const        //! get number of rows.
+    unsigned rows(void) const        //! Get number of rows.
         { return row; }
-    unsigned cols(void) const        //! get number of columns.
+    unsigned cols(void) const        //! Get number of columns.
         { return col; }
     matrix add(const matrix & other) const;
     matrix sub(const matrix & other) const;
@@ -87,7 +87,7 @@ public:
     const ex & operator() (unsigned ro, unsigned co) const;
     matrix & set(unsigned ro, unsigned co, ex value);
     matrix transpose(void) const;
-    ex determinant(void) const;
+    ex determinant(unsigned options = determinant_algo::automatic) const;
     ex trace(void) const;
     ex charpoly(const symbol & lambda) const;
     matrix inverse(void) const;
@@ -95,18 +95,11 @@ public:
     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_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;
     
 // member variables
 protected:
@@ -116,10 +109,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)
@@ -146,8 +141,8 @@ inline unsigned cols(const matrix & m)
 inline matrix transpose(const matrix & m)
 { return m.transpose(); }
 
-inline ex determinant(const matrix & m)
-{ return m.determinant(); }
+inline ex determinant(const matrix & m, unsigned options = determinant_algo::automatic)
+{ return m.determinant(options); }
 
 inline ex trace(const matrix & m)
 { return m.trace(); }