Skip to main content

Chain

Struct Chain 

Source
pub struct Chain<A, B, T> { /* private fields */ }
Expand description

Transformation obtained by combining two other ones.

Transformations are applied in the following order: A(B(x)).

Implementations§

Source§

impl<T, const N: usize> Chain<Shift<T, N>, Linear<T, N>, Vector<T, N>>
where T: Copy,

Source

pub fn linear(&self) -> Linear<T, N>

Linear component of the transformation.

Source

pub fn shift(&self) -> Shift<T, N>

Shift component of the transformation.

Source§

impl<A, B, T> Chain<A, B, T>

Source

pub fn new(outer: A, inner: B) -> Self

Construct chained transformation from outer and inner ones.

Source

pub fn split(self) -> (A, B)

Split into two components components.

Source

pub fn outer(&self) -> &A

Get outer transformation reference.

Source

pub fn outer_mut(&mut self) -> &mut A

Get outer transformation mutable reference.

Source

pub fn inner(&self) -> &B

Get inner transformation reference.

Source

pub fn inner_mut(&mut self) -> &mut B

Get inner transformation mutable reference.

Trait Implementations§

Source§

impl<A, B, T> AbsDiffEq for Chain<A, B, T>
where A: AbsDiffEq<Epsilon = T>, B: AbsDiffEq<Epsilon = T>, T: AbsDiffEq<Epsilon = T> + Copy,

Available on crate feature approx only.
Source§

type Epsilon = T

Used for specifying relative comparisons.
Source§

fn default_epsilon() -> Self::Epsilon

The default tolerance to use when testing values that are close together. Read more
Source§

fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool

A test for equality that uses the absolute difference to compute the approximate equality of two numbers.
Source§

fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool

The inverse of AbsDiffEq::abs_diff_eq.
Source§

impl<A: Clone, B: Clone, T: Clone> Clone for Chain<A, B, T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<A: Copy, B: Copy, T: Copy> Copy for Chain<A, B, T>

Source§

impl<A: Debug, B: Debug, T: Debug> Debug for Chain<A, B, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<A, B, T> Directional<T> for Chain<A, B, T>
where A: Directional<T>, B: Directional<T>, Self: Transform<T>, T: Normalize + Copy,

Source§

fn apply_dir(&self, pos: T, dir: T) -> T

Returns the result of the direction transformation at the specified position.
Source§

fn apply_normal(&self, pos: T, normal: T) -> T

Returns the result of the normal transformation at the specified position. Read more
Source§

impl<T, const N: usize> Distribution<Chain<Shift<T, N>, Linear<T, N>, Vector<T, N>>> for Normal
where Normal: Distribution<Linear<T, N>> + Distribution<Shift<T, N>>,

Available on crate feature rand only.
Source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Affine<T, N>

Generate a random value of T, using rng as the source of randomness.
Source§

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> ⓘ
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
Source§

fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more
Source§

impl<T, const N: usize> Distribution<Chain<Shift<T, N>, Linear<T, N>, Vector<T, N>>> for Invertible

Available on crate feature rand only.
Source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Affine<T, N>

Generate a random value of T, using rng as the source of randomness.
Source§

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> ⓘ
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
Source§

fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more
Source§

impl<A, B, T> From<(A, B)> for Chain<A, B, T>

Source§

fn from((a, b): (A, B)) -> Self

Converts to this type from the input type.
Source§

impl<A, B, T> From<Chain<A, B, T>> for (A, B)

Source§

fn from(c: Chain<A, B, T>) -> Self

Converts to this type from the input type.
Source§

impl<A: PartialEq, B: PartialEq, T: PartialEq> PartialEq for Chain<A, B, T>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<A: PartialEq, B: PartialEq, T: PartialEq> StructuralPartialEq for Chain<A, B, T>

Source§

impl<A, B, T> Transform<T> for Chain<A, B, T>
where A: Transform<T> + Reorder<B, T>, B: Transform<T> + Reorder<A, T>, T: Copy,

Source§

fn identity() -> Self

Identity transformation.
Source§

fn inv(self) -> Self

Inverse transformation.
Source§

fn apply(&self, pos: T) -> T

Perform the transformation itself.
Source§

fn deriv(&self, pos: T, dir: T) -> T

Find transformation directional derivative at specified point.
Source§

fn chain(self, other: Self) -> Self

Chain two transformations into a new one. Read more

Auto Trait Implementations§

§

impl<A, B, T> Freeze for Chain<A, B, T>
where A: Freeze, B: Freeze, PhantomData<T>: Freeze,

§

impl<A, B, T> RefUnwindSafe for Chain<A, B, T>

§

impl<A, B, T> Send for Chain<A, B, T>
where A: Send, B: Send, PhantomData<T>: Send,

§

impl<A, B, T> Sync for Chain<A, B, T>
where A: Sync, B: Sync, PhantomData<T>: Sync,

§

impl<A, B, T> Unpin for Chain<A, B, T>
where A: Unpin, B: Unpin, PhantomData<T>: Unpin,

§

impl<A, B, T> UnsafeUnpin for Chain<A, B, T>

§

impl<A, B, T> UnwindSafe for Chain<A, B, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, const M: usize, const N: usize> Broadcast<Matrix<T, M, N>> for T
where T: Copy,

Source§

fn broadcast(self) -> Matrix<T, M, N>

Copy values along axes to get V.
Source§

impl<T, const N: usize> Broadcast<Vector<T, N>> for T
where T: Copy,

Source§

fn broadcast(self) -> Vector<T, N>

Copy values along axes to get V.
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V