svMultiPhysics
Loading...
Searching...
No Matches
svmp::math::DenseLUSolver Struct Reference

LU factorization of a dense square matrix with a cached pivot summary. More...

#include <DenseLinearAlgebra.h>

Classes

struct  Impl

Public Member Functions

 DenseLUSolver (DenseLUSolver &&) noexcept
DenseLUSolver & operator= (DenseLUSolver &&) noexcept
 DenseLUSolver (const DenseLUSolver &)=delete
DenseLUSolver & operator= (const DenseLUSolver &)=delete
bool empty () const noexcept
 Whether the factorization is empty (n == 0).
void solve_in_place (std::span< double > rhs) const
 Solve A x = rhs in place for a single right-hand side.
void solve_in_place (std::span< double > rhs, std::size_t rhs_count) const
 Solve A X = RHS in place for several right-hand sides.
std::vector< double > solve (std::span< const double > rhs) const
 Solve A x = rhs and return the solution.

Public Attributes

std::size_t n {0}
 Matrix dimension.
DenseMatrixDiagnostics diagnostics
 Pivot-derived diagnostics (rank, tolerance).
double pivot_tolerance {0}
 Scale-aware pivot tolerance used.
double min_pivot {0}
 Smallest pivot magnitude.
double max_pivot {0}
 Largest pivot magnitude.
std::string error_message_label
 Prefix for solve-time exception messages.
std::unique_ptr< Impl > impl
 Eigen factorization (pimpl).

Detailed Description

LU factorization of a dense square matrix with a cached pivot summary.

Produced by factor_dense_matrix(); move-only because it owns the Eigen factorization. error_message_label prefixes the messages of exceptions thrown by the solve methods.

Member Function Documentation

◆ empty()

bool svmp::math::DenseLUSolver::empty ( ) const
inlinenodiscardnoexcept

Whether the factorization is empty (n == 0).

Returns
True when no matrix has been factored.

◆ solve()

std::vector< double > svmp::math::DenseLUSolver::solve ( std::span< const double > rhs) const
nodiscard

Solve A x = rhs and return the solution.

Parameters
rhsRight-hand side of size n.
Returns
Solution vector of size n.

◆ solve_in_place() [1/2]

void svmp::math::DenseLUSolver::solve_in_place ( std::span< double > rhs) const

Solve A x = rhs in place for a single right-hand side.

Parameters
rhsOn entry the right-hand side; on return the solution (size n).

◆ solve_in_place() [2/2]

void svmp::math::DenseLUSolver::solve_in_place ( std::span< double > rhs,
std::size_t rhs_count ) const

Solve A X = RHS in place for several right-hand sides.

Parameters
rhsRow-major block of size n * rhs_count (solutions on return).
rhs_countNumber of right-hand sides.

Member Data Documentation

◆ diagnostics

DenseMatrixDiagnostics svmp::math::DenseLUSolver::diagnostics

Pivot-derived diagnostics (rank, tolerance).

◆ error_message_label

std::string svmp::math::DenseLUSolver::error_message_label

Prefix for solve-time exception messages.

◆ impl

std::unique_ptr<Impl> svmp::math::DenseLUSolver::impl

Eigen factorization (pimpl).

◆ max_pivot

double svmp::math::DenseLUSolver::max_pivot {0}

Largest pivot magnitude.

◆ min_pivot

double svmp::math::DenseLUSolver::min_pivot {0}

Smallest pivot magnitude.

◆ n

std::size_t svmp::math::DenseLUSolver::n {0}

Matrix dimension.

◆ pivot_tolerance

double svmp::math::DenseLUSolver::pivot_tolerance {0}

Scale-aware pivot tolerance used.


The documentation for this struct was generated from the following files: