SpatialScalar

Trait SpatialScalar 

Source
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§

Source

fn epsilon() -> Self

The epsilon value for floating-point comparisons

Source

fn max_finite() -> Self

Maximum finite value for this type

Provided Methods§

Source

fn from_f64(value: f64) -> Option<Self>

Convert from f64 (used for constants and literals)

Source

fn to_f64(&self) -> Option<f64>

Convert to f64 for interoperability

Source

fn sqrt(&self) -> Self

Square root function

Source

fn abs(&self) -> Self

Absolute value function

Source

fn powf(&self, exp: Self) -> Self

Power function

Source

fn ln(&self) -> Self

Natural logarithm

Source

fn exp(&self) -> Self

Exponential function

Source

fn sin(&self) -> Self

Sine function

Source

fn cos(&self) -> Self

Cosine function

Source

fn atan2(&self, other: Self) -> Self

Arctangent of y/x

Source

fn is_finite(&self) -> bool

Check if the value is finite

Source

fn is_nan(&self) -> bool

Check if the value is NaN

Source

fn simd_squared_euclidean_distance( _a: &[Self], b: &[Self], ) -> Result<Self, &'static str>

SIMD-optimized squared Euclidean distance

Source

fn simd_manhattan_distance( _a: &[Self], b: &[Self], ) -> Result<Self, &'static str>

SIMD-optimized Manhattan distance

Source

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.

Implementations on Foreign Types§

Source§

impl SpatialScalar for f32

Source§

fn epsilon() -> Self

Source§

fn max_finite() -> Self

Source§

fn simd_squared_euclidean_distance( a: &[Self], b: &[Self], ) -> Result<Self, &'static str>

Source§

fn simd_manhattan_distance(a: &[Self], b: &[Self]) -> Result<Self, &'static str>

Source§

fn simd_dot_product(a: &[Self], b: &[Self]) -> Result<Self, &'static str>

Source§

impl SpatialScalar for f64

Source§

fn epsilon() -> Self

Source§

fn max_finite() -> Self

Source§

fn simd_squared_euclidean_distance( a: &[Self], b: &[Self], ) -> Result<Self, &'static str>

Source§

fn simd_manhattan_distance(a: &[Self], b: &[Self]) -> Result<Self, &'static str>

Source§

fn simd_dot_product(a: &[Self], b: &[Self]) -> Result<Self, &'static str>

Implementors§