use core::ops::Neg;
use crate::Scalar;
pub trait Zero {
const ZERO: Self;
#[allow(clippy::wrong_self_convention)]
fn is_zero(self) -> bool;
}
pub trait One {
const ONE: Self;
}
pub trait Select {
fn min_val(self, other: Self) -> Self;
fn max_val(self, other: Self) -> Self;
}
pub trait HasScalar {
type Scalar: Scalar;
}
pub trait Negate: Neg<Output = Self> {
fn negate(self) -> Self;
}
pub trait DotProduct<Rhs = Self> {
type Output;
fn dot(self, rhs: Rhs) -> Self::Output;
}
pub trait Abs {
type Output;
fn abs(self) -> Self::Output;
}
pub trait Rounding {
fn floor(self) -> Self;
fn ceil(self) -> Self;
fn trunc(self) -> Self;
fn round(self) -> Self;
fn fract(self) -> Self;
}
pub trait Infinity {
const INFINITY: Self;
const NEG_INFINITY: Self;
#[allow(clippy::wrong_self_convention)]
fn is_finite(self) -> bool;
#[allow(clippy::wrong_self_convention)]
fn is_infinite(self) -> bool;
}
pub trait NaN {
const NAN: Self;
#[allow(clippy::wrong_self_convention)]
fn is_nan(self) -> bool;
}