[][src]Struct hilbert::permutation::Permutation

pub struct Permutation { /* fields omitted */ }

Defines a one-to-one mapping from one ordering of values to another. This can be used to rearrange the coordinates in a Point.

No coordinate value is lost or duplicated, so long as every value from 0 to dimensions - 1 is present in the moves_to collection.

Methods

impl Permutation[src]

pub fn identity(dimensions: usize) -> Self[src]

Create a Permutation that causes no changes to the order of dimensions if applied to a Point.

pub fn new(moves: &[usize]) -> Self[src]

Create a Permutation that performs the given set of moves.

pub fn random(dimensions: usize) -> Self[src]

Create a random permutation which will cause almost every dimension to be shifted to a new position.

pub fn swap(&self, first_dimension: usize, second_dimension: usize) -> Self[src]

Create a new Permutation where the two given dimensions are swapped.

This is useful for controlled permutation, unlike the chaotically scrambled Permutations generated by the random method.

pub fn dimensions(&self) -> usize[src]

Number of dimensions of points that can be handled by the permutation.

pub fn apply<T>(&self, unpermuted_data: &[T]) -> Vec<T> where
    T: Clone
[src]

Apply the Permutation to data, cloning and reordering the input values appropriately.

Trait Implementations

impl Clone for Permutation[src]

impl PartialEq<Permutation> for Permutation[src]

impl Debug for Permutation[src]

impl StructuralPartialEq for Permutation[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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