|
Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
|
Stateful partial-pivot LU factor/solve with preallocated, precision-adjustable banks. More...
#include <lu_solver.hpp>
Public Member Functions | |
| void | ChangeSize (unsigned n) |
| (Re)size the workspace to hold n x n systems. | |
| void | ChangePrecision (unsigned prec) |
| Re-set the precision of every mp temporary bank (a no-op for complex_dbl). | |
| unsigned | precision () const |
| Get the current working precision (digits). | |
| MatrixSuccessCode | Factor (Mat< NumT > const &A) |
| Factor a copy of A with partial pivoting; A is preserved. | |
| MatrixSuccessCode | FactorDestructive (Mat< NumT > &A) |
| Factor A destructively (no copy): on return A holds the L\U factors. | |
| template<typename OutDerived> | |
| void | Solve (Vec< NumT > const &b, Eigen::MatrixBase< OutDerived > const &x_out) const |
| Solve A x = b using the stored factors. | |
| Mat< NumT > const & | Factors () const |
| The factored matrix (L below the diagonal, U on and above), for the caller's LUPartialPivotDecompositionSuccessful()-style health check. | |
Stateful partial-pivot LU factor/solve with preallocated, precision-adjustable banks.
| NumT | The (complex) scalar type – complex_dbl or complex_mp. |
Numerically this is the same right-looking Gaussian elimination with partial pivoting as Eigen's PartialPivLU (unit lower-triangular L, upper-triangular U, row pivoting), so solutions agree with Eigen to backward-stable accuracy. The win is allocation behavior, not the arithmetic.
|
inline |
Re-set the precision of every mp temporary bank (a no-op for complex_dbl).
| prec | The new working precision (digits). |
|
inline |
(Re)size the workspace to hold n x n systems.
Call on a system-size change.
| n | The matrix dimension. |
|
inline |
Factor a copy of A with partial pivoting; A is preserved.
O(1) allocations.
| A | The square matrix to factor. |
|
inline |
Factor A destructively (no copy): on return A holds the L\U factors.
| A | The square matrix; overwritten with the factorization. |
|
inline |
The factored matrix (L below the diagonal, U on and above), for the caller's LUPartialPivotDecompositionSuccessful()-style health check.
|
inline |
Get the current working precision (digits).
|
inline |
Solve A x = b using the stored factors.
Reuses scratch; O(1) allocations.
| OutDerived | The output type – a Vec or a writable block such as K.col(stage). |
| b | The right-hand side (must be materialized storage, distinct from x). | |
| [out] | x_out | The solution (sized n). A temporary expression (e.g. .col()) is fine. |