Skip to main content

SolverError

Enum SolverError 

Source
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

§row: usize

The row where diagonal dominance fails

§diagonal: f64

Diagonal element value

§off_diagonal_sum: f64

Sum of off-diagonal absolute values

§

NumericalInstability

Numerical instability detected during computation.

Fields

§reason: String

Description of the instability

§iteration: usize

Iteration where instability was detected

§residual_norm: f64

Current residual norm when instability occurred

§

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

§coherence: f64

Computed coherence score in [-∞, 1]: 1.0 = perfectly diagonal,

0 = strictly diagonally dominant, ≤ 0 = at or past the diagonal-dominance boundary.

§threshold: f64

Threshold the caller configured via SolverOptions::coherence_threshold.

§

ConvergenceFailure

Algorithm failed to converge within specified iterations.

Fields

§iterations: usize

Number of iterations performed

§residual_norm: f64

Final residual norm achieved

§tolerance: f64

Target tolerance that wasn’t reached

§algorithm: String

Algorithm that failed to converge

§

InvalidInput

Invalid input parameters or data.

Fields

§message: String

Description of the invalid input

§parameter: Option<String>

Optional parameter name that was invalid

§

DimensionMismatch

Dimension mismatch between matrix and vector operations.

Fields

§expected: usize

Expected dimension

§actual: usize

Actual dimension found

§operation: String

Context where mismatch occurred

§

UnsupportedMatrixFormat

Matrix format is not supported for the requested operation.

Fields

§current_format: String

Current matrix format

§required_format: String

Required format for the operation

§operation: String

Operation that was attempted

§

MemoryAllocationError

Memory allocation failure.

Fields

§requested_size: usize

Requested allocation size in bytes

§available_memory: Option<usize>

Available memory at time of failure (if known)

§

IndexOutOfBounds

Index out of bounds for matrix or vector access.

Fields

§index: usize

The invalid index

§max_index: usize

Maximum valid index

§context: String

Context where out-of-bounds access occurred

§

InvalidSparseMatrix

Sparse matrix contains invalid data.

Fields

§reason: String

Description of the invalid data

§position: Option<(usize, usize)>

Position where invalid data was found

§

AlgorithmError

Algorithm-specific error conditions.

Fields

§algorithm: String

Name of the algorithm

§message: String

Specific error message

§context: Vec<(String, String)>

Additional context data

§

IoError

I/O error for file operations (when std feature is enabled).

Fields

§message: String

I/O error description

§context: String

Context where I/O error occurred

§

SerializationError

Serialization/deserialization error.

Fields

§message: String

Error message from serialization

§data_type: String

Data type being serialized

Implementations§

Source§

impl SolverError

Source

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.

Source

pub fn recovery_strategy(&self) -> Option<RecoveryStrategy>

Get suggested recovery strategy for recoverable errors.

Source

pub fn severity(&self) -> ErrorSeverity

Get the error severity level.

Trait Implementations§

Source§

impl Clone for SolverError

Source§

fn clone(&self) -> SolverError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SolverError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SolverError

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for SolverError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for SolverError

Available on crate feature std only.
Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for SolverError

Available on crate feature std only.
Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for SolverError

Source§

fn eq(&self, other: &SolverError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for SolverError

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SolverError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,