pub trait SpatialScalar:
Float
+ Debug
+ Default
+ NumCast
+ Send
+ Sync
+ SimdUnifiedOps
+ 'static {
Show 17 methods
// Required methods
fn epsilon() -> Self;
fn max_finite() -> Self;
// Provided methods
fn from_f64(value: f64) -> Option<Self> { ... }
fn to_f64(&self) -> Option<f64> { ... }
fn sqrt(&self) -> Self { ... }
fn abs(&self) -> Self { ... }
fn powf(&self, exp: Self) -> Self { ... }
fn ln(&self) -> Self { ... }
fn exp(&self) -> Self { ... }
fn sin(&self) -> Self { ... }
fn cos(&self) -> Self { ... }
fn atan2(&self, other: Self) -> Self { ... }
fn is_finite(&self) -> bool { ... }
fn is_nan(&self) -> bool { ... }
fn simd_squared_euclidean_distance(
_a: &[Self],
b: &[Self],
) -> Result<Self, &'static str> { ... }
fn simd_manhattan_distance(
_a: &[Self],
b: &[Self],
) -> Result<Self, &'static str> { ... }
fn simd_dot_product(_a: &[Self], b: &[Self]) -> Result<Self, &'static str> { ... }
}Expand description
Trait for scalar types that can be used in spatial computations
This trait extends standard numeric traits with requirements specific to spatial algorithms, including floating-point operations and conversions.
Required Methods§
Sourcefn max_finite() -> Self
fn max_finite() -> Self
Maximum finite value for this type
Provided Methods§
Sourcefn simd_squared_euclidean_distance(
_a: &[Self],
b: &[Self],
) -> Result<Self, &'static str>
fn simd_squared_euclidean_distance( _a: &[Self], b: &[Self], ) -> Result<Self, &'static str>
SIMD-optimized squared Euclidean distance
Sourcefn simd_manhattan_distance(
_a: &[Self],
b: &[Self],
) -> Result<Self, &'static str>
fn simd_manhattan_distance( _a: &[Self], b: &[Self], ) -> Result<Self, &'static str>
SIMD-optimized Manhattan distance
Sourcefn simd_dot_product(_a: &[Self], b: &[Self]) -> Result<Self, &'static str>
fn simd_dot_product(_a: &[Self], b: &[Self]) -> Result<Self, &'static str>
SIMD-optimized dot product
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.