1#ifndef FUSED_ALGORITHMS_CONDITION_H
2#define FUSED_ALGORITHMS_CONDITION_H
56 template <
typename T, my_
size_t N>
59 static_assert(is_floating_point_v<T>,
60 "condition requires a floating-point scalar type");
66 if (!inv_result.has_value())
71 T norm_Ainv =
norm1(inv_result.value());
73 return norm_A * norm_Ainv;
A discriminated union holding either a success value or an error.
Definition expected.h:86
Definition fused_matrix.h:12
Global configuration for the tesseract tensor library.
A minimal, STL-free expected/result type for failable operations.
Matrix inverse with compile-time dispatch.
Runtime property descriptors and error codes for matrices.
Expected< FusedMatrix< T, N, N >, MatrixStatus > inverse(const FusedMatrix< T, N, N > &A)
Compute the inverse of a square matrix.
Definition inverse.h:65
T norm1(const FusedMatrix< T, N, N > &A)
Compute the 1-norm of a square matrix: max absolute column sum.
Definition norms.h:34
Expected< T, MatrixStatus > condition(const FusedMatrix< T, N, N > &A)
Compute the condition number of A in the 1-norm: cond₁(A) = ‖A‖₁ · ‖A⁻¹‖₁.
Definition condition.h:57
MatrixStatus
Error codes for matrix decomposition and solver algorithms.
Definition matrix_traits.h:33
Tag type for constructing an Expected in the error state.
Definition expected.h:30
E error
The error value.
Definition expected.h:31