KrisLibrary  1.0.0
LUDecomposition.h
1 #ifndef MATH_LU_DECOMPOSITION_H
2 #define MATH_LU_DECOMPOSITION_H
3 
4 #include "MatrixTemplate.h"
5 #include <vector>
6 
7 namespace Math {
8 
17 template <class T>
19 {
20 public:
21  typedef MatrixTemplate<T> MatrixT;
22  typedef VectorTemplate<T> VectorT;
23 
25  LUDecomposition(const MatrixT& A);
26 
27  bool set(const MatrixT& A);
28  void backSub(const VectorT& b, VectorT& x) const;
29  void PBackSub(const VectorT& b, VectorT& x) const;
30  void LBackSub(const VectorT& b, VectorT& x) const;
31  void UBackSub(const VectorT& b, VectorT& x) const;
32  void getInverse(MatrixT& Ainv) const;
33 
34  void getL(MatrixT& L) const;
35  void getU(MatrixT& U) const;
36 
37  MatrixT LU;
38  std::vector<int> P;
39  T zeroTolerance;
40 };
41 
42 }
43 #endif
Forms the LU decomposition A=PLU.
Definition: LUDecomposition.h:18
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