Linear algebra vocabulary types and dense utilities for finite-element computations.
More...
|
| | Matrix |
| | Fixed-size matrix type aliases.
|
| |
| | Vector |
| | Fixed-size vector type aliases.
|
| |
|
| double | svmp::FE::math::dense_matrix_max_abs (std::span< const double > matrix) noexcept |
| | Largest absolute entry of a dense matrix.
|
| |
| double | svmp::FE::math::dense_matrix_pivot_tolerance (std::size_t rows, std::size_t cols, double max_abs, double multiplier=double(64)) noexcept |
| | Scale-aware pivot tolerance for dense factorization.
|
| |
| double | svmp::FE::math::dense_matrix_singular_value_tolerance (std::size_t rows, std::size_t cols, double largest_singular_value, double multiplier=double(64)) noexcept |
| | Scale-aware singular-value tolerance for rank decisions.
|
| |
| double | svmp::FE::math::dense_matrix_condition_fallback_threshold () noexcept |
| | Condition estimate above which the inverse switches to an SVD fallback.
|
| |
| double | svmp::FE::math::dense_matrix_condition_error_threshold () noexcept |
| | Condition estimate above which validation rejects a dense inverse.
|
| |
| DenseMatrixDiagnostics | svmp::FE::math::dense_matrix_diagnostics (std::span< const double > matrix, std::size_t rows, std::size_t cols, std::string_view error_message_label="dense matrix") |
| | SVD-based rank and conditioning diagnostics for a dense matrix.
|
| |
| DenseLUSolver | svmp::FE::math::factor_dense_matrix (std::vector< double > matrix, std::size_t n, std::string_view error_message_label="dense matrix") |
| | LU-factor a dense square matrix.
|
| |
| std::vector< double > | svmp::FE::math::invert_dense_matrix (std::vector< double > matrix, std::size_t n, std::string_view error_message_label="dense matrix") |
| | Invert a dense square matrix.
|
| |
| DenseInverseResult | svmp::FE::math::invert_dense_matrix_with_diagnostics (std::vector< double > matrix, std::size_t n, std::string_view error_message_label="dense matrix") |
| | Invert a dense square matrix with diagnostics, using an SVD fallback for high-condition matrices.
|
| |
| void | svmp::FE::math::validate_dense_inverse_diagnostics (const DenseInverseResult &result, std::size_t expected_rank, std::string_view error_message_label="dense matrix", double max_condition=dense_matrix_condition_error_threshold()) |
| | Validate that a dense inverse has full rank and acceptable conditioning.
|
| |
| std::size_t | svmp::FE::math::dense_matrix_rank (std::vector< double > matrix, std::size_t rows, std::size_t cols) |
| | Numerical rank of a dense matrix from its singular values.
|
| |
| DensePseudoInverseResult | svmp::FE::math::rank_revealing_pseudo_inverse (std::span< const double > matrix, std::size_t rows, std::size_t cols, std::string_view error_message_label="dense matrix") |
| | Moore-Penrose pseudo-inverse via a rank-revealing SVD.
|
| |
Linear algebra vocabulary types and dense utilities for finite-element computations.
The Math module defines the fixed-size vector and matrix types used in element-level kernels (as aliases of Eigen types) and dense linear algebra utilities used by basis construction and local transforms.
◆ dense_matrix_condition_error_threshold()
| double svmp::FE::math::dense_matrix_condition_error_threshold |
( |
| ) |
|
|
noexcept |
Condition estimate above which validation rejects a dense inverse.
- Returns
- The error condition-number threshold.
◆ dense_matrix_condition_fallback_threshold()
| double svmp::FE::math::dense_matrix_condition_fallback_threshold |
( |
| ) |
|
|
noexcept |
Condition estimate above which the inverse switches to an SVD fallback.
- Returns
- The fallback condition-number threshold.
◆ dense_matrix_diagnostics()
| DenseMatrixDiagnostics svmp::FE::math::dense_matrix_diagnostics |
( |
std::span< const double > |
matrix, |
|
|
std::size_t |
rows, |
|
|
std::size_t |
cols, |
|
|
std::string_view |
error_message_label = "dense matrix" |
|
) |
| |
SVD-based rank and conditioning diagnostics for a dense matrix.
- Parameters
-
| matrix | Row-major matrix of size rows * cols. |
| rows | Row count. |
| cols | Column count. |
| error_message_label | Prefix for the message of any exception thrown. |
- Returns
- Rank, tolerance, singular-value, and condition diagnostics.
- Exceptions
-
| FEException | If the matrix size is inconsistent or the matrix is empty. |
◆ dense_matrix_max_abs()
| double svmp::FE::math::dense_matrix_max_abs |
( |
std::span< const double > |
matrix | ) |
|
|
noexcept |
Largest absolute entry of a dense matrix.
- Parameters
-
| matrix | Row-major matrix entries. |
- Returns
- Maximum of |entry| over all entries, or 0 for an empty matrix.
◆ dense_matrix_pivot_tolerance()
| double svmp::FE::math::dense_matrix_pivot_tolerance |
( |
std::size_t |
rows, |
|
|
std::size_t |
cols, |
|
|
double |
max_abs, |
|
|
double |
multiplier = double(64) |
|
) |
| |
|
noexcept |
Scale-aware pivot tolerance for dense factorization.
Proportional to machine epsilon scaled by the matrix size and magnitude; pivots below it are treated as rank-deficient.
- Parameters
-
| rows | Row count. |
| cols | Column count. |
| max_abs | Largest absolute matrix entry (see dense_matrix_max_abs()). |
| multiplier | Safety factor applied to the epsilon-scaled tolerance. |
- Returns
- Pivot magnitude threshold.
◆ dense_matrix_rank()
| std::size_t svmp::FE::math::dense_matrix_rank |
( |
std::vector< double > |
matrix, |
|
|
std::size_t |
rows, |
|
|
std::size_t |
cols |
|
) |
| |
Numerical rank of a dense matrix from its singular values.
- Parameters
-
| matrix | Row-major matrix of size rows * cols (consumed). |
| rows | Row count. |
| cols | Column count. |
- Returns
- Number of singular values above the scale-aware tolerance.
- Exceptions
-
◆ dense_matrix_singular_value_tolerance()
| double svmp::FE::math::dense_matrix_singular_value_tolerance |
( |
std::size_t |
rows, |
|
|
std::size_t |
cols, |
|
|
double |
largest_singular_value, |
|
|
double |
multiplier = double(64) |
|
) |
| |
|
noexcept |
Scale-aware singular-value tolerance for rank decisions.
Singular values at or below the returned tolerance are treated as zero when computing rank or a pseudo-inverse.
- Parameters
-
| rows | Row count. |
| cols | Column count. |
| largest_singular_value | Largest singular value of the matrix. |
| multiplier | Safety factor applied to the epsilon-scaled tolerance. |
- Returns
- Singular-value threshold.
◆ factor_dense_matrix()
| DenseLUSolver svmp::FE::math::factor_dense_matrix |
( |
std::vector< double > |
matrix, |
|
|
std::size_t |
n, |
|
|
std::string_view |
error_message_label = "dense matrix" |
|
) |
| |
LU-factor a dense square matrix.
- Parameters
-
| matrix | Row-major n * n matrix (consumed). |
| n | Matrix dimension. |
| error_message_label | Prefix for the message of any exception thrown. |
- Returns
- The factorization.
- Exceptions
-
| FEException | If the size is inconsistent or the matrix is rank-deficient. |
◆ invert_dense_matrix()
| std::vector< double > svmp::FE::math::invert_dense_matrix |
( |
std::vector< double > |
matrix, |
|
|
std::size_t |
n, |
|
|
std::string_view |
error_message_label = "dense matrix" |
|
) |
| |
Invert a dense square matrix.
- Parameters
-
| matrix | Row-major n * n matrix (consumed). |
| n | Matrix dimension. |
| error_message_label | Prefix for the message of any exception thrown. |
- Returns
- Row-major inverse of size n * n.
- Exceptions
-
| FEException | If the size is inconsistent or the matrix is singular. |
◆ invert_dense_matrix_with_diagnostics()
| DenseInverseResult svmp::FE::math::invert_dense_matrix_with_diagnostics |
( |
std::vector< double > |
matrix, |
|
|
std::size_t |
n, |
|
|
std::string_view |
error_message_label = "dense matrix" |
|
) |
| |
Invert a dense square matrix with diagnostics, using an SVD fallback for high-condition matrices.
- Parameters
-
| matrix | Row-major n * n matrix (consumed). |
| n | Matrix dimension. |
| error_message_label | Prefix for the message of any exception thrown. |
- Returns
- Inverse plus diagnostics and whether the SVD fallback was used.
- Exceptions
-
| FEException | If the size is inconsistent or the matrix is rank-deficient. |
◆ rank_revealing_pseudo_inverse()
| DensePseudoInverseResult svmp::FE::math::rank_revealing_pseudo_inverse |
( |
std::span< const double > |
matrix, |
|
|
std::size_t |
rows, |
|
|
std::size_t |
cols, |
|
|
std::string_view |
error_message_label = "dense matrix" |
|
) |
| |
Moore-Penrose pseudo-inverse via a rank-revealing SVD.
- Parameters
-
| matrix | Row-major matrix of size rows * cols. |
| rows | Row count. |
| cols | Column count. |
| error_message_label | Prefix for the message of any exception thrown. |
- Returns
- Row-major pseudo-inverse (cols * rows) plus rank/tolerance diagnostics.
- Exceptions
-
| FEException | If the matrix size is inconsistent or the matrix is empty. |
◆ validate_dense_inverse_diagnostics()
Validate that a dense inverse has full rank and acceptable conditioning.
- Parameters
-
| result | Result from invert_dense_matrix_with_diagnostics(). |
| expected_rank | Required (full) rank. |
| error_message_label | Prefix for the message of any exception thrown. |
| max_condition | Largest acceptable condition estimate. |
- Exceptions
-
| FEException | If the rank is below expected_rank or the condition exceeds max_condition. |