Trait discrete::space::Space

source ·
pub trait Space<N>: Construct + Sized {
    type Dim;
    type Pos;

    // Required methods
    fn count(&self, dim: &Self::Dim) -> N;
    fn zero(&self, dim: &Self::Dim) -> Self::Pos;
    fn to_index(&self, dim: &Self::Dim, pos: &Self::Pos) -> N;
    fn to_pos(&self, dim: &Self::Dim, index: N, pos: &mut Self::Pos);
}
Expand description

Implemented by discrete spaces.

Required Associated Types§

source

type Dim

The dimension type of the space.

source

type Pos

The position type of the space.

Required Methods§

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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<N, T, U> Space<N> for (T, U)
where T: Space<N>, U: Space<N>, N: Add<N, Output = N>, for<'a> &'a N: Mul<&'a N, Output = N> + Div<&'a N, Output = N> + Sub<&'a N, Output = N>,

§

type Dim = (<T as Space<N>>::Dim, <U as Space<N>>::Dim)

§

type Pos = (<T as Space<N>>::Pos, <U as Space<N>>::Pos)

source§

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

source§

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

source§

fn to_index(&self, (dim_t, dim_u): &Self::Dim, (pt, pu): &Self::Pos) -> N

source§

fn to_pos(&self, (dim_t, dim_u): &Self::Dim, ind: N, (pt, pu): &mut Self::Pos)

Implementors§

source§

impl Space<usize> for Context<Data>

§

type Dim = Vec<usize>

§

type Pos = (Vec<usize>, usize, usize)

source§

impl Space<usize> for Dimension<Data>

§

type Dim = usize

§

type Pos = usize

source§

impl Space<usize> for DimensionN<Data>

§

type Dim = Vec<usize>

§

type Pos = Vec<usize>

source§

impl Space<usize> for DirectedContext<Data>

§

type Dim = Vec<usize>

§

type Pos = (Vec<usize>, usize, usize)

source§

impl Space<usize> for EqPair<Data>

§

type Dim = usize

§

type Pos = (usize, usize)

source§

impl Space<usize> for Homotopy<Data>

§

type Dim = (usize, usize)

§

type Pos = HPoint

source§

impl Space<usize> for NeqPair<Data>

§

type Dim = usize

§

type Pos = (usize, usize)

source§

impl Space<usize> for Pair<Data>

§

type Dim = usize

§

type Pos = (usize, usize)

source§

impl Space<usize> for Permutation<Data>

§

type Dim = usize

§

type Pos = Vec<usize>

source§

impl Space<usize> for PowerSet<Data>

§

type Dim = usize

§

type Pos = Vec<usize>

source§

impl Space<usize> for SqPair<Data>

§

type Dim = usize

§

type Pos = (usize, usize)

source§

impl Space<BigUint> for Context<Data>

source§

impl Space<BigUint> for Dimension<Data>

§

type Dim = BigUint

§

type Pos = BigUint

source§

impl Space<BigUint> for DimensionN<Data>

§

type Dim = Vec<BigUint>

§

type Pos = Vec<BigUint>

source§

impl Space<BigUint> for DirectedContext<Data>

source§

impl Space<BigUint> for EqPair<Data>

source§

impl Space<BigUint> for Homotopy<Data>

source§

impl Space<BigUint> for NeqPair<Data>

source§

impl Space<BigUint> for Pair<Data>

source§

impl Space<BigUint> for Permutation<Data>

§

type Dim = BigUint

§

type Pos = Vec<BigUint>

source§

impl Space<BigUint> for PowerSet<Data>

§

type Dim = BigUint

§

type Pos = Vec<BigUint>

source§

impl Space<BigUint> for SqPair<Data>

source§

impl<N, T> Space<N> for Context<Of<T>>
where T: Space<N>, Pair<Data>: Space<N, Dim = N, Pos = (N, N)>, for<'a> N: Clone + From<usize> + Ord + MulAssign<&'a N> + SubAssign<&'a N> + DivAssign<&'a N> + AddAssign<&'a N>, for<'a> &'a N: Mul<&'a N, Output = N> + Div<&'a N, Output = N> + Add<&'a N, Output = N> + Sub<&'a N, Output = N>,

§

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

§

type Pos = (Vec<<T as Space<N>>::Pos>, usize, <T as Space<N>>::Pos)

source§

impl<N, T> Space<N> for DimensionN<Of<T>>
where N: Clone + From<usize> + AddAssign<N> + SubAssign<N> + MulAssign<N> + Div<Output = N> + DivAssign<N>, for<'a> &'a N: Div<&'a N, Output = N> + Mul<&'a N, Output = N>, T: Space<N>,

§

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

§

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

source§

impl<N, T> Space<N> for DirectedContext<Of<T>>
where T: Space<N>, T::Pos: Clone, NeqPair<Data>: Space<N, Dim = N>, Pair<Data>: Space<N, Dim = N, Pos = (N, N)>, for<'a> N: Clone + From<usize> + Ord + MulAssign<&'a N> + Sub<usize, Output = N> + Div<usize, Output = N> + AddAssign<&'a N> + DivAssign<&'a N> + SubAssign<&'a N> + Mul<usize, Output = N> + Add<usize, Output = N>, for<'a> &'a N: Mul<&'a N, Output = N> + Add<&'a N, Output = N> + Rem<usize, Output = N> + Sub<&'a N, Output = N> + Div<&'a N, Output = N>,

§

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

§

type Pos = (Vec<<T as Space<N>>::Pos>, usize, <T as Space<N>>::Pos)

source§

impl<N, T> Space<N> for EqPair<Of<T>>
where T: Space<N>, EqPair<Data>: Space<N, Dim = N, Pos = (N, N)>,

§

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

§

type Pos = (<T as Space<N>>::Pos, <T as Space<N>>::Pos)

source§

impl<N, T> Space<N> for Homotopy<Of<T>>
where T: Space<N>, T::Dim: Clone, EqPair<Data>: Space<N, Dim = N, Pos = (N, N)>, EqPair<Of<T>>: Space<N, Dim = T::Dim, Pos = (T::Pos, T::Pos)>, N: Clone + Ord + From<usize>, Homotopy<Data>: Space<N, Dim = (usize, N), Pos = HPoint<N>>,

§

type Dim = (usize, <T as Space<N>>::Dim)

§

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

source§

impl<N, T> Space<N> for NeqPair<Of<T>>
where T: Space<N>, NeqPair<Data>: Space<N, Dim = N, Pos = (N, N)>,

§

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

§

type Pos = (<T as Space<N>>::Pos, <T as Space<N>>::Pos)

source§

impl<N, T> Space<N> for Pair<Of<T>>
where T: Space<N>, Pair<Data>: Space<N, Dim = N, Pos = (N, N)>,

§

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

§

type Pos = (<T as Space<N>>::Pos, <T as Space<N>>::Pos)

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

§

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

source§

impl<N, T> Space<N> for PowerSet<Of<T>>
where T: Space<N>, N: Clone + From<usize> + PartialEq + TryInto<u32> + BitOrAssign<N> + Rem<usize, Output = N> + Pow<u32, Output = N> + Shr<u32, Output = N>, <N as TryInto<u32>>::Error: Debug,

§

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

§

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

source§

impl<N, T: Space<N>> Space<N> for Dimension<Of<T>>

§

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

§

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

source§

impl<T, N> Space<N> for SqPair<Of<T>>
where T: Space<N>, N: From<usize>, SqPair<Data>: Space<N, Dim = N, Pos = (N, N)>,

§

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

§

type Pos = (<T as Space<N>>::Pos, <T as Space<N>>::Pos)

source§

impl<T, U, N> Space<N> for Either<T, U>
where T: Space<N>, U: Space<N>, N: Add<Output = N> + Sub<Output = N> + PartialOrd,

§

type Dim = (<T as Space<N>>::Dim, <U as Space<N>>::Dim)

§

type Pos = Select<<T as Space<N>>::Pos, <U as Space<N>>::Pos>