Struct discrete::Permutation

source ·
pub struct Permutation<T = Data>(/* private fields */);
Expand description

Dimension is natural number, position is a list of numbers.

Trait Implementations§

source§

impl<T> Construct for Permutation<T>

source§

fn new() -> Self

Constructs a new Self.
source§

impl Space<BigUint> for Permutation<Data>

§

type Dim = BigUint

The dimension type of the space.
§

type Pos = Vec<BigUint>

The position type of the space.
source§

fn count(&self, dim: &BigUint) -> BigUint

Counts the size of space given the dimensions.
source§

fn zero(&self, dim: &BigUint) -> Vec<BigUint>

Creates a default element.
source§

fn to_index(&self, dim: &Self::Dim, pos: &Self::Pos) -> BigUint

Converts position to index.
source§

fn to_pos(&self, dim: &Self::Dim, index: BigUint, pos: &mut Self::Pos)

Converts index to position.
source§

impl<N, T> Space<N> for Permutation<Of<T>>
where T: Space<N>, T::Pos: Clone, N: Clone + From<usize> + TryInto<usize> + for<'a> AddAssign<&'a N> + for<'a> MulAssign<&'a N> + Sub<usize, Output = N> + SubAssign + DivAssign<usize> + MulAssign<usize> + PartialOrd, <N as TryInto<usize>>::Error: Debug, for<'a> &'a N: Sub<usize, Output = N> + Mul<&'a N, Output = N> + Div<usize, Output = N> + Div<&'a N, Output = N>,

§

type Dim = <T as Space<N>>::Dim

The dimension type of the space.
§

type Pos = Vec<<T as Space<N>>::Pos>

The position type of the space.
source§

fn count(&self, dim: &Self::Dim) -> N

Counts the size of space given the dimensions.
source§

fn zero(&self, dim: &Self::Dim) -> Self::Pos

Creates a default element.
source§

fn to_index(&self, dim: &Self::Dim, pos: &Self::Pos) -> N

Converts position to index.
source§

fn to_pos(&self, dim: &Self::Dim, index: N, pos: &mut Self::Pos)

Converts index to position.
source§

impl Space<usize> for Permutation<Data>

§

type Dim = usize

The dimension type of the space.
§

type Pos = Vec<usize>

The position type of the space.
source§

fn count(&self, dim: &usize) -> usize

Counts the size of space given the dimensions.
source§

fn zero(&self, dim: &usize) -> Vec<usize>

Creates a default element.
source§

fn to_index(&self, dim: &usize, pos: &Vec<usize>) -> usize

Converts position to index.
source§

fn to_pos(&self, dim: &usize, index: usize, pos: &mut Vec<usize>)

Converts index to position.

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Permutation<T>
where T: RefUnwindSafe,

§

impl<T> Send for Permutation<T>
where T: Send,

§

impl<T> Sync for Permutation<T>
where T: Sync,

§

impl<T> Unpin for Permutation<T>
where T: Unpin,

§

impl<T> UnwindSafe for Permutation<T>
where T: UnwindSafe,

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<D, T> Count<D, BigUint> for T
where T: Space<BigUint, Dim = D>,

source§

fn count(&self, dim: &D) -> BigUint

Counts the size of space given the dimensions.
source§

impl<D, T> Count<D, usize> for T
where T: Space<usize, Dim = D>,

source§

fn count(&self, dim: &D) -> usize

Counts the size of space given the dimensions.
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<D, P, T> ToIndex<D, P, BigUint> for T
where T: Space<BigUint, Dim = D, Pos = P>,

source§

fn to_index(&self, dim: &D, pos: &P) -> BigUint

Converts position to index.
source§

impl<D, P, T> ToIndex<D, P, usize> for T
where T: Space<usize, Dim = D, Pos = P>,

source§

fn to_index(&self, dim: &D, pos: &P) -> usize

Converts position to index.
source§

impl<D, P, T> ToPos<D, P, BigUint> for T
where T: Space<BigUint, Dim = D, Pos = P>,

source§

fn to_pos(&self, dim: &D, ind: BigUint, pos: &mut P)

Converts index to position.
source§

impl<D, P, T> ToPos<D, P, usize> for T
where T: Space<usize, Dim = D, Pos = P>,

source§

fn to_pos(&self, dim: &D, ind: usize, pos: &mut P)

Converts index to position.
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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<D, P, T> Zero<D, P, BigUint> for T
where T: Space<BigUint, Dim = D, Pos = P>,

source§

fn zero(&self, dim: &D) -> P

Creates a default element.
source§

impl<D, P, T> Zero<D, P, usize> for T
where T: Space<usize, Dim = D, Pos = P>,

source§

fn zero(&self, dim: &D) -> P

Creates a default element.