class
SushiDSP::dk::DenseLu
template <std::size_t N>Factorises a dense N x N system by LU with partial pivoting, in fixed storage.
- Declared in
include/SushiDSP/math/dk/DenseLu.hpp
factorise() and solve() allocate nothing, and the factors persist after factorise(), so one factorisation serves several right-hand sides. The size-aware overloads work on the leading order x order block of a compile-time-maximum array (include/SushiDSP/README.md).
Template parameters
NSystem dimension.
Static public attributes
static constexpr double kMinimumPivot = 1e-300Smallest pivot magnitude accepted as non-singular.
Public member functions
bool factorise(const std::array< std::array< double, N >, N > &matrix)Factorises the matrix into the internal L/U storage.
Parameters
matrixThe system matrix; not modified.
Returns
False when a pivot is numerically zero; solve() must not be called after that.
bool factorise(const std::array< std::array< double, N >, N > &matrix, std::size_t order)Factorises only the leading order x order block of the matrix.
Parameters
matrixThe system matrix; only its leading block is read, and it is not modified.
orderActive dimension, at most N. An order of zero always succeeds.
Returns
False when a pivot is numerically zero; solve() must not be called after that.
void solve(const std::array< double, N > &right_hand_side, std::array< double, N > &solution) constSolves A x = b using the factors from the last successful factorise().
Parameters
right_hand_sideb.
solutionx, overwritten.
void solve(const std::array< double, N > &right_hand_side, std::array< double, N > &solution, std::size_t order) constSolves the leading order x order block using the factors from the last successful factorise() of the same order.
Parameters
right_hand_sideb; only its leading order entries are read.
solutionx; only its leading order entries are written.
orderActive dimension, at most N and matching the last factorise().

