Struct alga::general::Id
[−]
[src]
#[repr(C)]pub struct Id<O: Operator = Multiplicative> { /* fields omitted */ }
The universal identity element wrt. a given operator, usually noted Id
with a
context-dependent subscript.
By default, it is the multiplicative identity element. It represents the degenerate set containing only the identity element of any group-like structure. It has no dimension known at compile-time. All its operations are no-ops.
Methods
impl<O: Operator> Id<O>
[src]
Trait Implementations
impl<O: Debug + Operator> Debug for Id<O>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<O: Operator> Copy for Id<O>
[src]
impl<O: Operator> Clone for Id<O>
[src]
fn clone(&self) -> Id<O>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<O: Operator> Display for Id<O>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<O: Operator> PartialEq for Id<O>
[src]
fn eq(&self, _: &Id<O>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<O: Operator> Eq for Id<O>
[src]
impl<O: Operator> PartialOrd for Id<O>
[src]
fn partial_cmp(&self, _: &Id<O>) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<O: Operator> Identity<O> for Id<O>
[src]
fn identity() -> Id<O>
[src]
The identity element.
fn id(_: O) -> Self where
Self: Sized,
[src]
Self: Sized,
Specific identity.
impl<O: Operator> ApproxEq for Id<O>
[src]
type Epsilon = Id<O>
Used for specifying relative comparisons.
fn default_epsilon() -> Self::Epsilon
[src]
The default tolerance to use when testing values that are close together. Read more
fn default_max_relative() -> Self::Epsilon
[src]
The default relative tolerance for testing values that are far-apart. Read more
fn default_max_ulps() -> u32
[src]
The default ULPs to tolerate when testing values that are far-apart. Read more
fn relative_eq(&self, _: &Self, _: Self::Epsilon, _: Self::Epsilon) -> bool
[src]
A test for equality that uses a relative comparison if the values are far apart.
fn ulps_eq(&self, _: &Self, _: Self::Epsilon, _: u32) -> bool
[src]
A test for equality that uses units in the last place (ULP) if the values are far apart.
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of ApproxEq::relative_eq
.
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
The inverse of ApproxEq::ulps_eq
.
impl Mul<Id> for Id
[src]
type Output = Id
The resulting type after applying the *
operator.
fn mul(self, _: Id) -> Id
[src]
Performs the *
operation.
impl MulAssign<Id> for Id
[src]
fn mul_assign(&mut self, _: Id)
[src]
Performs the *=
operation.
impl Div<Id> for Id
[src]
type Output = Id
The resulting type after applying the /
operator.
fn div(self, _: Id) -> Id
[src]
Performs the /
operation.
impl DivAssign<Id> for Id
[src]
fn div_assign(&mut self, _: Id)
[src]
Performs the /=
operation.
impl Add<Id> for Id
[src]
type Output = Id
The resulting type after applying the +
operator.
fn add(self, _: Id) -> Id
[src]
Performs the +
operation.
impl AddAssign<Id> for Id
[src]
fn add_assign(&mut self, _: Id)
[src]
Performs the +=
operation.
impl<O: Operator> AbstractMagma<O> for Id<O>
[src]
fn operate(&self, _: &Self) -> Id<O>
[src]
Performs an operation.
fn op(&self, _: O, lhs: &Self) -> Self
[src]
Performs specific operation.
impl<O: Operator> Inverse<O> for Id<O>
[src]
fn inverse(&self) -> Self
[src]
Returns the inverse of self
, relative to the operator O
.
fn inverse_mut(&mut self)
[src]
In-place inversin of self
.
impl<O: Operator> AbstractSemigroup<O> for Id<O>
[src]
fn prop_is_associative_approx(args: (Self, Self, Self)) -> bool where
Self: ApproxEq,
[src]
Self: ApproxEq,
Returns true
if associativity holds for the given arguments. Approximate equality is used for verifications. Read more
fn prop_is_associative(args: (Self, Self, Self)) -> bool where
Self: Eq,
[src]
Self: Eq,
Returns true
if associativity holds for the given arguments.
impl<O: Operator> AbstractQuasigroup<O> for Id<O>
[src]
fn prop_inv_is_latin_square_approx(args: (Self, Self)) -> bool where
Self: ApproxEq,
[src]
Self: ApproxEq,
Returns true
if latin squareness holds for the given arguments. Approximate equality is used for verifications. Read more
fn prop_inv_is_latin_square(args: (Self, Self)) -> bool where
Self: Eq,
[src]
Self: Eq,
Returns true
if latin squareness holds for the given arguments.
impl<O: Operator> AbstractMonoid<O> for Id<O>
[src]
fn prop_operating_identity_element_is_noop_approx(args: (Self,)) -> bool where
Self: ApproxEq,
[src]
Self: ApproxEq,
Checks whether operating with the identity element is a no-op for the given argument. Approximate equality is used for verifications. Read more
fn prop_operating_identity_element_is_noop(args: (Self,)) -> bool where
Self: Eq,
[src]
Self: Eq,
Checks whether operating with the identity element is a no-op for the given argument. Read more
impl<O: Operator> AbstractLoop<O> for Id<O>
[src]
impl<O: Operator> AbstractGroup<O> for Id<O>
[src]
impl<O: Operator> AbstractGroupAbelian<O> for Id<O>
[src]
fn prop_is_commutative_approx(args: (Self, Self)) -> bool where
Self: ApproxEq,
[src]
Self: ApproxEq,
Returns true
if the operator is commutative for the given argument tuple. Approximate equality is used for verifications. Read more
fn prop_is_commutative(args: (Self, Self)) -> bool where
Self: Eq,
[src]
Self: Eq,
Returns true
if the operator is commutative for the given argument tuple.
impl One for Id
[src]
impl Zero for Id
[src]
fn zero() -> Id
[src]
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
[src]
Returns true
if self
is equal to the additive identity.
impl<O: Operator, T: PartialEq + Identity<O>> SubsetOf<T> for Id<O>
[src]
fn to_superset(&self) -> T
[src]
The inclusion map: converts self
to the equivalent element of its superset.
fn is_in_subset(t: &T) -> bool
[src]
Checks if element
is actually part of the subset Self
(and can be converted to it).
unsafe fn from_superset_unchecked(_: &T) -> Self
[src]
Use with care! Same as self.to_superset
but without any property checks. Always succeeds.
fn from_superset(element: &T) -> Option<Self>
[src]
The inverse inclusion map: attempts to construct self
from the equivalent element of its superset. Read more
impl<O: Operator> MeetSemilattice for Id<O>
[src]
impl<O: Operator> JoinSemilattice for Id<O>
[src]
impl<O: Operator> Lattice for Id<O>
[src]
fn meet_join(&self, other: &Self) -> (Self, Self)
[src]
Returns the infimum and the supremum simultaneously.
fn partial_min<'a>(&'a self, other: &'a Self) -> Option<&'a Self>
[src]
Return the minimum of self
and other
if they are comparable.
fn partial_max<'a>(&'a self, other: &'a Self) -> Option<&'a Self>
[src]
Return the maximum of self
and other
if they are comparable.
fn partial_sort2<'a>(&'a self, other: &'a Self) -> Option<(&'a Self, &'a Self)>
[src]
Sorts two values in increasing order using a partial ordering.
fn partial_clamp<'a>(&'a self, min: &'a Self, max: &'a Self) -> Option<&'a Self>
[src]
Clamp value
between min
and max
. Returns None
if value
is not comparable to min
or max
. Read more
impl<E: EuclideanSpace> Transformation<E> for Id
[src]
fn transform_point(&self, pt: &E) -> E
[src]
Applies this group's action on a point from the euclidean space.
fn transform_vector(&self, v: &E::Coordinates) -> E::Coordinates
[src]
Applies this group's action on a vector from the euclidean space. Read more
impl<E: EuclideanSpace> ProjectiveTransformation<E> for Id
[src]
fn inverse_transform_point(&self, pt: &E) -> E
[src]
Applies this group's inverse action on a point from the euclidean space.
fn inverse_transform_vector(&self, v: &E::Coordinates) -> E::Coordinates
[src]
Applies this group's inverse action on a vector from the euclidean space. Read more
impl<E: EuclideanSpace> AffineTransformation<E> for Id
[src]
type Rotation = Id
Type of the first rotation to be applied.
type NonUniformScaling = Id
Type of the non-uniform scaling to be applied.
type Translation = Id
The type of the pure translation part of this affine transformation.
fn decompose(&self) -> (Id, Id, Id, Id)
[src]
Decomposes this affine transformation into a rotation followed by a non-uniform scaling, followed by a rotation, followed by a translation. Read more
fn append_translation(&self, _: &Self::Translation) -> Self
[src]
Appends a translation to this similarity.
fn prepend_translation(&self, _: &Self::Translation) -> Self
[src]
Prepends a translation to this similarity.
fn append_rotation(&self, _: &Self::Rotation) -> Self
[src]
Appends a rotation to this similarity.
fn prepend_rotation(&self, _: &Self::Rotation) -> Self
[src]
Prepends a rotation to this similarity.
fn append_scaling(&self, _: &Self::NonUniformScaling) -> Self
[src]
Appends a scaling factor to this similarity.
fn prepend_scaling(&self, _: &Self::NonUniformScaling) -> Self
[src]
Prepends a scaling factor to this similarity.
fn append_rotation_wrt_point(&self, r: &Self::Rotation, p: &E) -> Option<Self>
[src]
Appends to this similarity a rotation centered at the point p
, i.e., this point is left invariant. Read more
impl<E: EuclideanSpace> Similarity<E> for Id
[src]
type Scaling = Id
The type of the pure (uniform) scaling part of this similarity transformation.
fn translation(&self) -> Self::Translation
[src]
The pure translational component of this similarity transformation.
fn rotation(&self) -> Self::Rotation
[src]
The pure rotational component of this similarity transformation.
fn scaling(&self) -> Self::Scaling
[src]
The pure scaling component of this similarity transformation.
fn translate_point(&self, pt: &E) -> E
[src]
Applies this transformation's pure translational part to a point.
fn rotate_point(&self, pt: &E) -> E
[src]
Applies this transformation's pure rotational part to a point.
fn scale_point(&self, pt: &E) -> E
[src]
Applies this transformation's pure scaling part to a point.
fn rotate_vector(&self, pt: &E::Coordinates) -> E::Coordinates
[src]
Applies this transformation's pure rotational part to a vector.
fn scale_vector(&self, pt: &E::Coordinates) -> E::Coordinates
[src]
Applies this transformation's pure scaling part to a vector.
fn inverse_translate_point(&self, pt: &E) -> E
[src]
Applies this transformation inverse's pure translational part to a point.
fn inverse_rotate_point(&self, pt: &E) -> E
[src]
Applies this transformation inverse's pure rotational part to a point.
fn inverse_scale_point(&self, pt: &E) -> E
[src]
Applies this transformation inverse's pure scaling part to a point.
fn inverse_rotate_vector(&self, pt: &E::Coordinates) -> E::Coordinates
[src]
Applies this transformation inverse's pure rotational part to a vector.
fn inverse_scale_vector(&self, pt: &E::Coordinates) -> E::Coordinates
[src]
Applies this transformation inverse's pure scaling part to a vector.
impl<E: EuclideanSpace> Scaling<E> for Id
[src]
fn to_real(&self) -> E::Real
[src]
Converts this scaling factor to a real. Same as self.to_superset()
.
fn from_real(r: E::Real) -> Option<Self>
[src]
Attempts to convert a real to an element of this scaling subgroup. Same as Self::from_superset()
. Returns None
if no such scaling is possible for this subgroup. Read more
fn powf(&self, n: E::Real) -> Option<Self>
[src]
Raises the scaling to a power. The result must be equivalent to self.to_superset().powf(n)
. Returns None
if the result is not representable by Self
. Read more
fn scale_between(a: &E::Coordinates, b: &E::Coordinates) -> Option<Self>
[src]
The scaling required to make a
have the same norm as b
, i.e., |b| = |a| * norm_ratio(a, b)
. Read more
impl<E: EuclideanSpace> Isometry<E> for Id
[src]
impl<E: EuclideanSpace> DirectIsometry<E> for Id
[src]
impl<E: EuclideanSpace> OrthogonalTransformation<E> for Id
[src]
impl<E: EuclideanSpace> Rotation<E> for Id
[src]
fn powf(&self, _: E::Real) -> Option<Self>
[src]
Raises this rotation to a power. If this is a simple rotation, the result must be equivalent to multiplying the rotation angle by n
. Read more
fn rotation_between(a: &E::Coordinates, b: &E::Coordinates) -> Option<Self>
[src]
Computes a simple rotation that makes the angle between a
and b
equal to zero, i.e., b.angle(a * delta_rotation(a, b)) = 0
. If a
and b
are collinear, the computed rotation may not be unique. Returns None
if no such simple rotation exists in the subgroup represented by Self
. Read more
fn scaled_rotation_between(
a: &E::Coordinates,
b: &E::Coordinates,
_: E::Real
) -> Option<Self>
[src]
a: &E::Coordinates,
b: &E::Coordinates,
_: E::Real
) -> Option<Self>
Computes the rotation between a
and b
and raises it to the power n
. Read more
impl<E: EuclideanSpace> Translation<E> for Id
[src]
fn to_vector(&self) -> E::Coordinates
[src]
Converts this translation to a vector.
fn from_vector(v: E::Coordinates) -> Option<Self>
[src]
Attempts to convert a vector to this translation. Returns None
if the translation represented by v
is not part of the translation subgroup represented by Self
. Read more
fn powf(&self, n: E::Real) -> Option<Self>
[src]
Raises the translation to a power. The result must be equivalent to self.to_superset() * n
. Returns None
if the result is not representable by Self
. Read more
fn translation_between(a: &E, b: &E) -> Option<Self>
[src]
The translation needed to make a
coincide with b
, i.e., b = a * translation_to(a, b)
.