std::ostream & operator<<(std::ostream &os, const HouseholderQR &qr)
Print the Q and R matrices of a HouseholderQR object.
Class that represents matrices that permute the rows or columns of other matrices.
@ RowPermutation
Can be used for permuting rows only.
LU factorization with row pivoting.
SquareMatrix LU
Result of a LU factorization: stores the upper-triangular matrix U and the strict lower-triangular pa...
void get_U_inplace(Matrix &U) const
Copy the upper-triangular matrix U to the given matrix.
SquareMatrix && steal_LU()
Get the internal storage of the upper-triangular matrix U and the strict lower-triangular part of mat...
const SquareMatrix & get_LU() const &
Get a copy of the internal storage of the upper-triangular matrix U and the strict lower-triangular p...
bool has_LU() const
Check if this object contains valid L and U factors.
RowPivotLU()=default
Default constructor.
PermutationMatrix && get_P() &&
Get the permutation matrix P.
Matrix solve(const Matrix &B) const
Solve the system AX = B or LUX = B.
void get_L_inplace(Matrix &L) const
Copy the lower-triangular matrix L to the given matrix.
void compute(SquareMatrix &&matrix)
Perform the LU factorization of the given matrix.
SquareMatrix && steal_L()
Get the lower-triangular matrix L, reusing the internal storage.
void back_subs(const Matrix &B, Matrix &X) const
Back substitution algorithm for solving upper-triangular systems UX = B.
void solve_inplace(Matrix &B) const
Solve the system AX = B or LUX = B.
bool is_factored() const
Check if this object contains a factorization.
void forward_subs(const Matrix &B, Matrix &X) const
Forward substitution algorithm for solving lower-triangular systems LX = B.
void compute_factorization()
The actual LU factorization algorithm.
SquareMatrix get_L() const &
Get a copy of the lower-triangular matrix L.
PermutationMatrix get_P() const &
Get a copy of the permutation matrix P.
SquareMatrix get_U() const &
Get a copy of the upper-triangular matrix U.
SquareMatrix && get_LU() &&
Get the internal storage of the upper-triangular matrix U and the strict lower-triangular part of mat...
PermutationMatrix && steal_P()
Get the permutation matrix P, reusing the internal storage.
RowPivotLU(SquareMatrix &&matrix)
Factorize the given matrix.
SquareMatrix && steal_U()
Get the upper-triangular matrix U, reusing the internal storage.
PermutationMatrix P
The permutation of A that maximizes pivot size.
RowPivotLU(const SquareMatrix &matrix)
Factorize the given matrix.
enum RowPivotLU::State state
bool has_P() const
Check if this object contains a valid permutation matrix P.
A column vector (nĂ—1 matrix).