#define __GINAC_MATRIX_H__
#include <vector>
-#include <ginac/basic.h>
-#include <ginac/ex.h>
+#include "basic.h"
+#include "ex.h"
-#ifndef NO_GINAC_NAMESPACE
+#ifndef NO_NAMESPACE_GINAC
namespace GiNaC {
-#endif // ndef NO_GINAC_NAMESPACE
+#endif // ndef NO_NAMESPACE_GINAC
/** Symbolic matrices. */
class matrix : public basic
GINAC_DECLARE_REGISTERED_CLASS(matrix, basic)
// friends
- friend ex determinant_numeric(const matrix & m);
- friend ex determinant_symbolic_perm(const matrix & m);
- friend ex determinant_symbolic_minor(const matrix & m);
-
+// (none)
// member functions
// default constructor, destructor, copy constructor, assignment operator
void print(ostream & os, unsigned upper_precedence=0) const;
void printraw(ostream & os) const;
unsigned nops() const;
+ ex op(int i) const;
ex & let_op(int i);
ex expand(unsigned options=0) const;
bool has(const ex & other) const;
// non-virtual functions in this class
public:
- unsigned rows() const //! get number of rows.
+ unsigned rows(void) const //! get number of rows.
{ return row; }
- unsigned cols() 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;
const ex & operator() (unsigned ro, unsigned co) const;
matrix & set(unsigned ro, unsigned co, ex value);
matrix transpose(void) const;
- ex determinant(bool normalized=true) 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 & v) const;
+ matrix solve(const matrix & vars, const matrix & rhs) const;
+ matrix old_solve(const matrix & v) const; // FIXME: may be removed
protected:
- int pivot(unsigned ro);
+ ex determinant_minor(void) const;
+ int gauss_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;
inline matrix transpose(const matrix & m)
{ return m.transpose(); }
-inline ex determinant(const matrix & m, bool normalized=true)
-{ return m.determinant(normalized); }
+inline ex determinant(const matrix & m)
+{ return m.determinant(); }
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)
return static_cast<const matrix &>(*e.bp);
}
-#ifndef NO_GINAC_NAMESPACE
+extern ex lst_to_matrix(const ex &l);
+
+#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
-#endif // ndef NO_GINAC_NAMESPACE
+#endif // ndef NO_NAMESPACE_GINAC
#endif // ndef __GINAC_MATRIX_H__