Struct sprs::Permutation

source ·
pub struct Permutation<I, IndStorage>where
    IndStorage: Deref<Target = [I]>,{ /* private fields */ }

Implementations§

source§

impl<I: SpIndex> Permutation<I, Vec<I, Global>>

source

pub fn new(perm: Vec<I>) -> Self

source§

impl<'a, I: SpIndex> Permutation<I, &'a [I]>

source

pub fn reborrow(&self) -> Self

source

pub fn reborrow_inv(&self) -> Self

source§

impl<I: SpIndex, IndStorage> Permutation<I, IndStorage>where IndStorage: Deref<Target = [I]>,

source

pub fn identity(dim: usize) -> Self

source

pub fn inv(&self) -> PermViewI<'_, I>

source

pub fn dim(&self) -> usize

source

pub fn is_identity(&self) -> bool

Check whether the permutation is the identity.

source

pub fn view(&self) -> PermViewI<'_, I>

source

pub fn owned_clone(&self) -> PermOwnedI<I>

source

pub fn at(&self, index: usize) -> usize

source

pub fn at_inv(&self, index: usize) -> usize

source

pub fn vec(&self) -> Vec<I>

Get a vector representing this permutation

source

pub fn inv_vec(&self) -> Vec<I>

Get a vector representing the inverse of this permutation

source

pub fn to_other_idx_type<I2>(&self) -> PermOwnedI<I2>where I2: SpIndex,

Trait Implementations§

source§

impl<I: Clone, IndStorage> Clone for Permutation<I, IndStorage>where IndStorage: Deref<Target = [I]> + Clone,

source§

fn clone(&self) -> Permutation<I, IndStorage>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<I: Debug, IndStorage> Debug for Permutation<I, IndStorage>where IndStorage: Deref<Target = [I]> + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'b, V, I, IndStorage> Mul<V> for &'b Permutation<I, IndStorage>where IndStorage: 'b + Deref<Target = [I]>, V: DenseVector, <V as DenseVector>::Owned: DenseVectorMut + DenseVector<Scalar = <V as DenseVector>::Scalar>, <V as DenseVector>::Scalar: Clone, I: SpIndex,

§

type Output = <V as DenseVector>::Owned

The resulting type after applying the * operator.
source§

fn mul(self, rhs: V) -> Self::Output

Performs the * operation. Read more
source§

impl<V, I, IndStorage> Mul<V> for Permutation<I, IndStorage>where IndStorage: Deref<Target = [I]>, V: DenseVector, <V as DenseVector>::Owned: DenseVectorMut + DenseVector<Scalar = <V as DenseVector>::Scalar>, <V as DenseVector>::Scalar: Clone, I: SpIndex,

§

type Output = <V as DenseVector>::Owned

The resulting type after applying the * operator.
source§

fn mul(self, rhs: V) -> Self::Output

Performs the * operation. Read more

Auto Trait Implementations§

§

impl<I, IndStorage> RefUnwindSafe for Permutation<I, IndStorage>where IndStorage: RefUnwindSafe,

§

impl<I, IndStorage> Send for Permutation<I, IndStorage>where IndStorage: Send,

§

impl<I, IndStorage> Sync for Permutation<I, IndStorage>where IndStorage: Sync,

§

impl<I, IndStorage> Unpin for Permutation<I, IndStorage>where IndStorage: Unpin,

§

impl<I, IndStorage> UnwindSafe for Permutation<I, IndStorage>where IndStorage: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
source§

unsafe fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.