pub enum SolverError {
MatrixNotDiagonallyDominant {
row: usize,
diagonal: f64,
off_diagonal_sum: f64,
},
NumericalInstability {
reason: String,
iteration: usize,
residual_norm: 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
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more