25 DecompLU(std::vector<std::vector<T>> mat);
57 std::vector<std::vector<T>>
NewMatrix(
size_t m,
size_t n);
66 const std::vector<std::vector<T>>&
P() {
return _P; }
72 const std::vector<std::vector<T>>&
L() {
return _L; }
75 const std::vector<std::vector<T>>&
U() {
return _U; }
81 std::vector<std::vector<T>>
_P;
83 std::vector<std::vector<T>>
_L;
84 std::vector<std::vector<T>>
_U;
87 #include "DecompLU-inl.hh"
const bool & Complete()
Gets and returns whether the LU decomposition was successful or not.
Definition: DecompLU.hh:63
Defines the LU decomposition algorithm of a square matrix.
Definition: DecompLU.hh:19
std::vector< std::vector< T > > _L
L Matrix.
Definition: DecompLU.hh:83
std::vector< std::vector< T > > NewMatrix(size_t m, size_t n)
Returns a matrix of m rows and n columns.
Definition: DecompLU-inl.hh:122
std::vector< std::vector< T > > _P
Permutation matrix.
Definition: DecompLU.hh:81
void DecomposeCrout(std::vector< std::vector< T >> mat)
Decomposes a square matrix into a parity matrix P, a lower triangular matrix L and an upper triangula...
Definition: DecompLU-inl.hh:35
std::vector< T > _pivots
Premutation vector (IDs of the rows)
Definition: DecompLU.hh:82
const std::vector< std::vector< T > > & L()
Gets and returns the lower triangular matrix.
Definition: DecompLU.hh:72
DecompLU()
Default constructor, initilizes an empty matrix of dimension 0x0.
Definition: DecompLU-inl.hh:1
T _fact
Parity of the permutation (1 or -1)
Definition: DecompLU.hh:79
const T & Factor()
Gets and returns the parity of the permutations.
Definition: DecompLU.hh:60
~DecompLU()
Destructor.
Definition: DecompLU-inl.hh:33
const std::vector< std::vector< T > > & U()
Gets and returns the upper triangular matrix.
Definition: DecompLU.hh:75
const std::vector< T > & Pivots()
Gets and returns the permutation vector, contains the ids of the rows.
Definition: DecompLU.hh:69
std::vector< std::vector< T > > _U
U Matrix.
Definition: DecompLU.hh:84
T Determinant()
Returns the determinant of the decomposed matrix.
Definition: DecompLU-inl.hh:113
DecompLU & operator=(const DecompLU &decLU)
Equality operator.
Definition: DecompLU-inl.hh:20
bool _complete
True if the decomposition was successful.
Definition: DecompLU.hh:80
const std::vector< std::vector< T > > & P()
Gets and returns the permutation matrix.
Definition: DecompLU.hh:66