#[non_exhaustive]pub enum PolarError {
Inverted,
Degenerate,
SingularStep {
steps: u32,
},
NotConverged {
steps: u32,
},
}Expand description
Why Mat3Fix::polar_rotation could not produce a rotation.
The three refusals and the two iteration outcomes are separate variants on
purpose: the caller’s next action is different for each, and collapsing
them into one None was measured to mislead. The same crate already learned
this for the conjugate gradient, where pᵀKp ≤ 0 was reported uniformly as
“under-constrained” until it was split into a null space (add constraints) and
a rounding floor (revisit the preconditioner or the tolerance). During this type’s own
development a budget that was merely too small was read as a degeneracy and
cost a round of diagnosis, which is the same failure one layer up.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Inverted
det F ≤ 0: the deformation has turned the element inside out.
There is no rotation factor — the nearest orthogonal matrix is a reflection
with det = −1. Fix the mesh or the deformation; a larger budget or a
lower floor will not help. Returned whatever det_floor was given, so a
caller passing a negative floor still cannot receive a reflection.
Degenerate
det F ≤ det_floor: too close to singular for the caller’s policy.
Revisit the floor, or the element that produced this gradient.
SingularStep
An intermediate iterate was exactly singular, so it could not be inverted.
Distinct from Self::Degenerate because the input passed the floor:
what failed is the path, not the data. Lower the floor’s tolerance for
ill-conditioning, or inspect the gradient.
NotConverged
max_iters was exhausted while the change was still above the settling
bound.
⚠️ The input is fine — raise the budget. Measured requirements run to 21
steps for a gradient with one singular value four decades from one, so a
budget of 16 is too small for the general case; see
Mat3Fix::polar_rotation for the table.
Trait Implementations§
Source§impl Clone for PolarError
impl Clone for PolarError
impl Copy for PolarError
Source§impl Debug for PolarError
impl Debug for PolarError
impl Eq for PolarError
Source§impl PartialEq for PolarError
impl PartialEq for PolarError
impl StructuralPartialEq for PolarError
Auto Trait Implementations§
impl Freeze for PolarError
impl RefUnwindSafe for PolarError
impl Send for PolarError
impl Sync for PolarError
impl Unpin for PolarError
impl UnsafeUnpin for PolarError
impl UnwindSafe for PolarError
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 more