Struct discrete::Dimension

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

Dimension is natural number, position is the same as index.

Trait Implementations§

source§

impl<T> Construct for Dimension<T>

source§

fn new() -> Self

Constructs a new Self.
source§

impl Space<BigUint> for Dimension<Data>

§

type Dim = BigUint

The dimension type of the space.
§

type Pos = BigUint

The position type of the space.
source§

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

Counts the size of space given the dimensions.
source§

fn zero(&self, _dim: &Self::Dim) -> 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>> Space<N> for Dimension<Of<T>>

§

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

The dimension type of the space.
§

type Pos = <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 Dimension<Data>

§

type Dim = usize

The dimension type of the space.
§

type Pos = 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) -> usize

Creates a default element.
source§

fn to_index(&self, _dim: &usize, pos: &usize) -> usize

Converts position to index.
source§

fn to_pos(&self, _dim: &usize, index: usize, pos: &mut usize)

Converts index to position.

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<T> UnwindSafe for Dimension<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.