Trait rin::math::One [−][src]
pub trait One: Mul<Self, Output = Self> { pub fn one() -> Self; pub fn set_one(&mut self) { ... } pub fn is_one(&self) -> bool
where
Self: PartialEq<Self>, { ... } }
Required methods
pub fn one() -> Self
[src]
Returns the multiplicative identity element of Self
, 1
.
Purity
This function should return the same result at all times regardless of
external mutable state, for example values stored in TLS or in
static mut
s.
Provided methods
pub fn set_one(&mut self)
[src]
Sets self
to the multiplicative identity element of Self
, 1
.
pub fn is_one(&self) -> bool where
Self: PartialEq<Self>,
[src]
Self: PartialEq<Self>,
Returns true
if self
is equal to the multiplicative identity.
For performance reasons, it’s best to implement this manually.
After a semver bump, this method will be required, and the
where Self: PartialEq
bound will be removed.
Implementations on Foreign Types
impl<T> One for Wrapping<T> where
T: One,
Wrapping<T>: Mul<Wrapping<T>>,
<Wrapping<T> as Mul<Wrapping<T>>>::Output == Wrapping<T>,
[src]
impl<T> One for Wrapping<T> where
T: One,
Wrapping<T>: Mul<Wrapping<T>>,
<Wrapping<T> as Mul<Wrapping<T>>>::Output == Wrapping<T>,
[src]impl<T> One for Ratio<T> where
T: Clone + Integer,
[src]
impl<T> One for Ratio<T> where
T: Clone + Integer,
[src]impl<T> One for Complex<T> where
T: Clone + Num,
[src]
impl<T> One for Complex<T> where
T: Clone + Num,
[src]impl<N> One for Dual<Quaternion<N>> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]
impl<N> One for Dual<Quaternion<N>> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]pub fn one() -> Dual<Quaternion<N>>
[src]
Implementors
impl<N> One for Quaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]
impl<N> One for Quaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]pub fn one() -> Quaternion<N>
[src]
impl<N> One for Unit<Complex<N>> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]
impl<N> One for Unit<Complex<N>> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]impl<N> One for Unit<Quaternion<N>> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]
impl<N> One for Unit<Quaternion<N>> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]pub fn one() -> Unit<Quaternion<N>>
[src]
impl<N, D> One for Matrix<N, D, D, <DefaultAllocator as Allocator<N, D, D>>::Buffer> where
N: Scalar + Zero + One + ClosedMul<N> + ClosedAdd<N>,
D: DimName,
DefaultAllocator: Allocator<N, D, D>,
[src]
impl<N, D> One for Matrix<N, D, D, <DefaultAllocator as Allocator<N, D, D>>::Buffer> where
N: Scalar + Zero + One + ClosedMul<N> + ClosedAdd<N>,
D: DimName,
DefaultAllocator: Allocator<N, D, D>,
[src]impl<N, D> One for Rotation<N, D> where
N: Scalar + Zero + One + ClosedAdd<N> + ClosedMul<N>,
D: DimName,
DefaultAllocator: Allocator<N, D, D>,
[src]
impl<N, D> One for Rotation<N, D> where
N: Scalar + Zero + One + ClosedAdd<N> + ClosedMul<N>,
D: DimName,
DefaultAllocator: Allocator<N, D, D>,
[src]impl<N, D> One for Translation<N, D> where
N: Scalar + Zero + ClosedAdd<N>,
D: DimName,
DefaultAllocator: Allocator<N, D, U1>,
[src]
impl<N, D> One for Translation<N, D> where
N: Scalar + Zero + ClosedAdd<N>,
D: DimName,
DefaultAllocator: Allocator<N, D, U1>,
[src]pub fn one() -> Translation<N, D>
[src]
impl<N, D, C> One for Transform<N, D, C> where
C: TCategory,
N: RealField,
D: DimNameAdd<U1>,
DefaultAllocator: Allocator<N, <D as DimNameAdd<U1>>::Output, <D as DimNameAdd<U1>>::Output>,
[src]
impl<N, D, C> One for Transform<N, D, C> where
C: TCategory,
N: RealField,
D: DimNameAdd<U1>,
DefaultAllocator: Allocator<N, <D as DimNameAdd<U1>>::Output, <D as DimNameAdd<U1>>::Output>,
[src]impl<N, D, R> One for Isometry<N, D, R> where
N: SimdRealField,
D: DimName,
R: AbstractRotation<N, D>,
<N as SimdValue>::Element: SimdRealField,
DefaultAllocator: Allocator<N, D, U1>,
[src]
impl<N, D, R> One for Isometry<N, D, R> where
N: SimdRealField,
D: DimName,
R: AbstractRotation<N, D>,
<N as SimdValue>::Element: SimdRealField,
DefaultAllocator: Allocator<N, D, U1>,
[src]impl<N, D, R> One for Similarity<N, D, R> where
N: SimdRealField,
D: DimName,
R: AbstractRotation<N, D>,
<N as SimdValue>::Element: SimdRealField,
DefaultAllocator: Allocator<N, D, U1>,
[src]
impl<N, D, R> One for Similarity<N, D, R> where
N: SimdRealField,
D: DimName,
R: AbstractRotation<N, D>,
<N as SimdValue>::Element: SimdRealField,
DefaultAllocator: Allocator<N, D, U1>,
[src]pub fn one() -> Similarity<N, D, R>
[src]
Creates a new identity similarity.