pub enum SolveError {
MaxIterReached(usize),
SingularJacobian,
SliceWrongLength {
slice_type: Type,
slice_length: usize,
edge_count: usize,
},
OutOfBoundsIdx {
idx_and_val_type: Type,
idx: usize,
edge_count: usize,
},
NonPositiveResistance {
val: f64,
idx: usize,
},
NonzeroForMismatchedEdgeType {
val: f64,
idx: usize,
edge_type_at_idx: Type,
edge_type_check: Type,
},
}Expand description
An error returned from a failed call to solve.
Variants§
MaxIterReached(usize)
The maximum number of iterations defined in SolverConfig has been reached
without finding a solution. Consider either increasing the iteration maximum or relaxing the tolerances
(see docstring of SolverConfig).
SingularJacobian
The Jacobian has become singular. This can e.g. happen due to variable resistances / inductances
becoming (almost) zero. Make sure the provided EdgeValueInputs does return reasonable values for all inputs (e.g. by
clamping) and that the custom Jacobian function (if one is given) only returns finite, non-nan entries for the Jacobian.
SliceWrongLength
For one of resistance, current or voltage sources (see slice_type), the Slice variant has been used.
The length of the underlying slice is not equal to the edge count.
Fields
OutOfBoundsIdx
For one of resistance, current or voltage sources (see idx_and_val_type), the IdxAndVals variant has been used.
At least one of the indices (idx) is equal to or larger than the edge count, which would result in an out-of-bounds access.
Fields
NonPositiveResistance
Resistances must always have positive values (larger than zero), but the negative value val was found at edge idx.
Fields
NonzeroForMismatchedEdgeType
If one of Resistances, CurrentSources or VoltageSources produce a nonzero value val at edge idx,
but the edge has a different type edge_type_at_idx, this error variant is returned. As explained in the docstrings
of the two enums, they must only produce nonzero values for edges of the same type.
Trait Implementations§
Source§impl Clone for SolveError
impl Clone for SolveError
Source§impl Debug for SolveError
impl Debug for SolveError
Source§impl Display for SolveError
impl Display for SolveError
Source§impl Error for SolveError
impl Error for SolveError
1.30.0 · 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()
Auto Trait Implementations§
impl Freeze for SolveError
impl RefUnwindSafe for SolveError
impl Send for SolveError
impl Sync for SolveError
impl Unpin for SolveError
impl UnsafeUnpin for SolveError
impl UnwindSafe for SolveError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.