[−][src]Struct hilbert::permutation::Permutation
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]
T: Clone,
Apply the Permutation
to data, cloning and reordering the input values appropriately.
Trait Implementations
impl Clone for Permutation
[src]
fn clone(&self) -> Permutation
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl PartialEq<Permutation> for Permutation
[src]
fn eq(&self, other: &Permutation) -> bool
[src]
fn ne(&self, other: &Permutation) -> bool
[src]
impl Debug for Permutation
[src]
impl StructuralPartialEq for Permutation
[src]
Auto Trait Implementations
impl Send for Permutation
impl Sync for Permutation
impl Unpin for Permutation
impl UnwindSafe for Permutation
impl RefUnwindSafe for Permutation
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,