pub enum SolverError {
Show 13 variants
MatrixNotDiagonallyDominant {
row: usize,
diagonal: f64,
off_diagonal_sum: f64,
},
NumericalInstability {
reason: String,
iteration: usize,
residual_norm: f64,
},
Incoherent {
coherence: f64,
threshold: f64,
},
ConvergenceFailure {
iterations: usize,
residual_norm: f64,
tolerance: f64,
algorithm: String,
},
InvalidInput {
message: String,
parameter: Option<String>,
},
DimensionMismatch {
expected: usize,
actual: usize,
operation: String,
},
UnsupportedMatrixFormat {
current_format: String,
required_format: String,
operation: String,
},
MemoryAllocationError {
requested_size: usize,
available_memory: Option<usize>,
},
IndexOutOfBounds {
index: usize,
max_index: usize,
context: String,
},
InvalidSparseMatrix {
reason: String,
position: Option<(usize, usize)>,
},
AlgorithmError {
algorithm: String,
message: String,
context: Vec<(String, String)>,
},
IoError {
message: String,
context: String,
},
SerializationError {
message: String,
data_type: String,
},
}Expand description
Comprehensive error type for all solver operations.
Variants§
MatrixNotDiagonallyDominant
Matrix is not diagonally dominant, which is required for convergence guarantees.
Fields
NumericalInstability
Numerical instability detected during computation.
Fields
Incoherent
Coherence gate refused the solve: the matrix’s diagonal-dominance
margin dropped below the configured threshold, so the solver would
have spent polynomial-time work on a near-singular system to
produce an ε-quality answer. See ADR-001 (Complexity as Architecture)
roadmap item #3 and src/coherence.rs for the gate implementation.
Fields
ConvergenceFailure
Algorithm failed to converge within specified iterations.
Fields
InvalidInput
Invalid input parameters or data.
Fields
DimensionMismatch
Dimension mismatch between matrix and vector operations.
Fields
UnsupportedMatrixFormat
Matrix format is not supported for the requested operation.
Fields
MemoryAllocationError
Memory allocation failure.
Fields
IndexOutOfBounds
Index out of bounds for matrix or vector access.
Fields
InvalidSparseMatrix
Sparse matrix contains invalid data.
Fields
AlgorithmError
Algorithm-specific error conditions.
Fields
IoError
I/O error for file operations (when std feature is enabled).
SerializationError
Serialization/deserialization error.
Implementations§
Source§impl SolverError
impl SolverError
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this error indicates a recoverable condition.
Recoverable errors can potentially be resolved by adjusting algorithm parameters or switching to a different solver.
Sourcepub fn recovery_strategy(&self) -> Option<RecoveryStrategy>
pub fn recovery_strategy(&self) -> Option<RecoveryStrategy>
Get suggested recovery strategy for recoverable errors.
Sourcepub fn severity(&self) -> ErrorSeverity
pub fn severity(&self) -> ErrorSeverity
Get the error severity level.
Trait Implementations§
Source§impl Clone for SolverError
impl Clone for SolverError
Source§fn clone(&self) -> SolverError
fn clone(&self) -> SolverError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SolverError
impl Debug for SolverError
Source§impl<'de> Deserialize<'de> for SolverError
impl<'de> Deserialize<'de> for SolverError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for SolverError
impl Display for SolverError
Source§impl Error for SolverError
Available on crate feature std only.
impl Error for SolverError
std only.Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<Error> for SolverError
Available on crate feature std only.
impl From<Error> for SolverError
std only.Source§impl PartialEq for SolverError
impl PartialEq for SolverError
Source§fn eq(&self, other: &SolverError) -> bool
fn eq(&self, other: &SolverError) -> bool
self and other values to be equal, and is used by ==.