X-Git-Url: https://ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Fmatrix.h;h=b1ee32814b926f15d4a90b6387770394d01214ae;hb=b16d5b34f40c9dcd6bd4f9e1fdeeb65cb1612db3;hp=02748413837452a84a50fd42da9162e4791514d9;hpb=1be7026a705dfefedcd838e6b60795ca6d469bf9;p=ginac.git diff --git a/ginac/matrix.h b/ginac/matrix.h index 02748413..b1ee3281 100644 --- a/ginac/matrix.h +++ b/ginac/matrix.h @@ -3,7 +3,7 @@ * Interface to symbolic matrices */ /* - * GiNaC Copyright (C) 1999-2018 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2019 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 @@ -148,17 +148,20 @@ public: ex determinant(unsigned algo = determinant_algo::automatic) const; ex trace() const; ex charpoly(const ex & lambda) const; - matrix inverse() const { return inverse(solve_algo::automatic); } + 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 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 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; @@ -218,6 +221,8 @@ inline matrix inverse(const matrix & m, unsigned 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