KrisLibrary  1.0.0
RowEchelon.h
1 #ifndef MATH_ROW_ECHELON_H
2 #define MATH_ROW_ECHELON_H
3 
4 #include "MatrixTemplate.h"
5 #include <vector>
6 
7 namespace Math {
8 
14 template <class T>
16 {
17 public:
18  typedef MatrixTemplate<T> MatrixT;
19  typedef VectorTemplate<T> VectorT;
20 
21  RowEchelon();
22  RowEchelon(const MatrixT& A);
23  RowEchelon(const MatrixT& A,const VectorT& b);
24  RowEchelon(const MatrixT& A,const MatrixT& B);
25 
26  void set(const MatrixT& A);
27  void set(const MatrixT& A,const VectorT& b);
28  void set(const MatrixT& A,const MatrixT& B);
29  void backSub(VectorT& x) const;
30  int getRank() const;
31  int getNull() const;
33  void getNullspace(MatrixT& N) const;
35  void getAllSolutions(VectorT& x0,MatrixT& N) const;
36 
37  //helpers
38  void calcFirstEntries();
39 
40  MatrixT R;
41  MatrixT EB;
42  std::vector<int> firstEntry;
43 };
44 
45 template <class T>
46 bool IsRowEchelon(const MatrixTemplate<T>& A);
47 template <class T>
48 bool IsReducedRowEchelon(const MatrixTemplate<T>& A);
49 
50 } //namespace Math
51 
52 
53 #endif
void getNullspace(MatrixT &N) const
Returns a orthonormal basis for the nullspace in the columns of N.
Definition: RowEchelon.cpp:241
Compute reduced row-eschelon form for a matrix A.
Definition: RowEchelon.h:15
std::vector< int > firstEntry
indexes the first entry in each row of r
Definition: RowEchelon.h:42
A matrix over the field T.
Definition: function.h:10
Contains all definitions in the Math package.
Definition: WorkspaceBound.h:12
A vector over the field T.
Definition: function.h:9
void getAllSolutions(VectorT &x0, MatrixT &N) const
Calculates a pseudoinverse x0 as well as a nullspace matrix N.
Definition: RowEchelon.cpp:325