]> www.ginac.de Git - ginac.git/blobdiff - ginac/matrix.h
Add optional matrix::rank() algorighm selection.
[ginac.git] / ginac / matrix.h
index 2b0934e821631774fe4d2e76ef4e7f254a148658..44351d65885f6f11b755fa08b4476302c05fc087 100644 (file)
@@ -3,7 +3,7 @@
  *  Interface to symbolic matrices */
 
 /*
- *  GiNaC Copyright (C) 1999-2017 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2018 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
@@ -149,15 +149,19 @@ public:
        ex trace() const;
        ex charpoly(const ex & lambda) const;
        matrix inverse() const;
+       matrix inverse(unsigned algo) const;
        matrix solve(const matrix & vars, const matrix & rhs,
                     unsigned algo = solve_algo::automatic) const;
        unsigned rank() const;
+       unsigned rank(unsigned solve_algo) const;
        bool is_zero_matrix() const;
 protected:
        ex determinant_minor() const;
+       std::vector<unsigned> echelon_form(unsigned algo, int n);
        int gauss_elimination(const bool det = false);
        int division_free_elimination(const bool det = false);
        int fraction_free_elimination(const bool det = false);
+       std::vector<unsigned> markowitz_elimination(unsigned n);
        int pivot(unsigned ro, unsigned co, bool symbolic = true);
 
        void print_elements(const print_context & c, const char *row_start, const char *row_end, const char *row_sep, const char *col_sep) const;
@@ -211,10 +215,14 @@ inline ex charpoly(const matrix & m, const ex & lambda)
 { return m.charpoly(lambda); }
 
 inline matrix inverse(const matrix & m)
-{ return m.inverse(); }
+{ return m.inverse(solve_algo::automatic); }
+inline matrix inverse(const matrix & m, unsigned algo)
+{ return m.inverse(algo); }
 
 inline unsigned rank(const matrix & m)
 { return m.rank(); }
+inline unsigned rank(const matrix & m, unsigned solve_algo)
+{ return m.rank(solve_algo); }
 
 // utility functions