pub enum MathError {
InvalidKnotVector {
expected: usize,
got: usize,
},
InvalidWeights {
expected: usize,
got: usize,
},
InvalidControlPointGrid {
expected_rows: usize,
expected_cols: usize,
},
ZeroVector,
SingularMatrix,
EmptyInput,
ParameterOutOfRange {
value: f64,
min: f64,
max: f64,
},
ConvergenceFailure {
iterations: usize,
},
PoleAtInfinity {
start: f64,
end: f64,
},
}Expand description
Errors from math operations.
Variants§
InvalidKnotVector
Knot vector length does not match control points and degree.
InvalidWeights
Weights vector length does not match control points.
InvalidControlPointGrid
Control point grid dimensions are inconsistent.
Fields
ZeroVector
Cannot normalize a zero-length vector.
SingularMatrix
Matrix is singular and cannot be inverted.
EmptyInput
Input collection is empty where at least one element is required.
ParameterOutOfRange
Parameter is outside the valid range.
Fields
ConvergenceFailure
Newton iteration did not converge within the allowed iterations.
PoleAtInfinity
A rational curve’s or surface’s control net over a span, after a knot insertion or removal, a degree elevation or in Bezier form, has a control point at infinity: its homogeneous weight is zero while its numerator is not, so it has no Cartesian point to store. Weights of mixed sign can cancel to such a weight.
Trait Implementations§
Source§impl Error for MathError
impl Error for MathError
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 Forget for MathError
impl Freeze for MathError
impl Move for MathError
impl RefUnwindSafe for MathError
impl Send for MathError
impl Sync for MathError
impl Unpin for MathError
impl UnsafeUnpin for MathError
impl UnwindSafe for MathError
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> 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 more