pub struct StrictFinitePolicy<ScalarType: Sized, const PRECISION: u32>(/* private fields */);
Expand description
A validation policy that checks for strict finiteness.
For floating-point types (ScalarType =
f64
, ScalarType =
rug::Float
), this policy ensures that the value is:
- Not NaN (Not a Number).
- Not positive or negative Infinity.
- Not subnormal (for
f64
). Whilerug::Float
maintains its specified precision rather than having distinct subnormal representation in the IEEE 754 sense, this policy will also rejectrug::Float
values that are classified asFpCategory::Subnormal
(e.g., results of underflow that are tiny but not exactly zero).
For complex types (ScalarType =
Complex<f64>
, ScalarType =
rug::Complex
), this policy applies
the strict finiteness check to both the real and imaginary parts.
This struct is a Zero-Sized Type (ZST) and uses PhantomData
to associate
with the ScalarType
it validates.
Trait Implementations§
Source§impl<const PRECISION: u32> ValidationPolicy for StrictFinitePolicy<Complex, PRECISION>
Ensures both the real and imaginary parts of a rug::Complex
value are strictly finite.
impl<const PRECISION: u32> ValidationPolicy for StrictFinitePolicy<Complex, PRECISION>
Ensures both the real and imaginary parts of a rug::Complex
value are strictly finite.
This policy applies the StrictFinitePolicy<rug::Float>
(which checks the underlying rug::Float
) to both the real and imaginary
components of the rug::Complex
.
§Errors
Returns ErrorsValidationRawComplex<ErrorsValidationRawReal<rug::Float>>
if either the real part, the imaginary part, or both parts fail the
StrictFinitePolicy<RealRugStrictFinite<Precision>>
checks.
Source§type Error = ErrorsValidationRawComplex<ErrorsValidationRawReal<Float>>
type Error = ErrorsValidationRawComplex<ErrorsValidationRawReal<Float>>
Source§impl<const PRECISION: u32> ValidationPolicy for StrictFinitePolicy<Float, PRECISION>
Ensures the rug::Float
value is strictly finite.
impl<const PRECISION: u32> ValidationPolicy for StrictFinitePolicy<Float, PRECISION>
Ensures the rug::Float
value is strictly finite.
This policy checks if the underlying rug::Float
value:
- Is not NaN (Not a Number).
- Is not positive nor negative Infinity.
- Has the specified precision (equal to
PRECISION
).
Note: rug::Float
does not have a direct concept of “subnormal” in the same
way IEEE 754 floats do; it maintains its specified precision.
§Errors
Returns ErrorsValidationRawReal<rug::Float>
if the value fails any of these checks.