pub struct SliceStorageMut<'a, T, R, C, RStride, CStride>where
    R: Dim,
    C: Dim,
    RStride: Dim,
    CStride: Dim,{ /* private fields */ }
Expand description

A mutable matrix data storage for mutable matrix slice. Only contains an internal mutable reference to another matrix data storage.

Implementations§

source§

impl<'a, T, R, C, RStride, CStride> SliceStorageMut<'a, T, R, C, RStride, CStride>where R: Dim, C: Dim, RStride: Dim, CStride: Dim,

source

pub unsafe fn from_raw_parts( ptr: *mut T, shape: (R, C), strides: (RStride, CStride) ) -> SliceStorageMut<'a, T, R, C, RStride, CStride>where RStride: Dim, CStride: Dim,

Create a new matrix slice without bound checking and from a raw pointer.

source§

impl<'a, T, R, C> SliceStorageMut<'a, T, R, C, Dynamic, Dynamic>where R: Dim, C: Dim,

source

pub unsafe fn new_unchecked<RStor, CStor, S>( storage: &'a mut S, start: (usize, usize), shape: (R, C) ) -> SliceStorageMut<'a, T, R, C, <S as RawStorage<T, RStor, CStor>>::RStride, <S as RawStorage<T, RStor, CStor>>::CStride>where RStor: Dim, CStor: Dim, S: RawStorageMut<T, RStor, CStor>,

Create a new matrix slice without bound checking.

source

pub unsafe fn new_with_strides_unchecked<S, RStor, CStor, RStride, CStride>( storage: &'a mut S, start: (usize, usize), shape: (R, C), strides: (RStride, CStride) ) -> SliceStorageMut<'a, T, R, C, RStride, CStride>where RStor: Dim, CStor: Dim, S: RawStorageMut<T, RStor, CStor>, RStride: Dim, CStride: Dim,

Create a new matrix slice without bound checking.

source§

impl<'a, T, R, C, RStride, CStride> SliceStorageMut<'a, T, R, C, RStride, CStride>where R: Dim, C: Dim, RStride: Dim, CStride: Dim, SliceStorageMut<'a, T, R, C, RStride, CStride>: RawStorage<T, R, C> + IsContiguous,

source

pub fn into_slice(self) -> &'a [T]

Extracts the original slice from this storage

source§

impl<'a, T, R, C, RStride, CStride> SliceStorageMut<'a, T, R, C, RStride, CStride>where T: Scalar, R: Dim, C: Dim, RStride: Dim, CStride: Dim, SliceStorageMut<'a, T, R, C, RStride, CStride>: RawStorageMut<T, R, C> + IsContiguous,

source

pub fn into_slice_mut(self) -> &'a mut [T]

Extracts the original slice from this storage

Trait Implementations§

source§

impl<'a, T, R, C, RStride, CStride> Debug for SliceStorageMut<'a, T, R, C, RStride, CStride>where T: Debug, R: Debug + Dim, C: Debug + Dim, RStride: Debug + Dim, CStride: Debug + Dim,

source§

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

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

impl<'a, T, R, C, RStride, CStride> RawStorage<T, R, C> for SliceStorageMut<'a, T, R, C, RStride, CStride>where R: Dim, C: Dim, RStride: Dim, CStride: Dim,

§

type RStride = RStride

The static stride of this storage’s rows.
§

type CStride = CStride

The static stride of this storage’s columns.
source§

fn ptr(&self) -> *const T

The matrix data pointer.
source§

fn shape(&self) -> (R, C)

The dimension of the matrix at run-time. Arr length of zero indicates the additive identity element of any dimension. Must be equal to Self::dimension() if it is not None.
source§

fn strides( &self ) -> (<SliceStorageMut<'a, T, R, C, RStride, CStride> as RawStorage<T, R, C>>::RStride, <SliceStorageMut<'a, T, R, C, RStride, CStride> as RawStorage<T, R, C>>::CStride)

The spacing between consecutive row elements and consecutive column elements. Read more
source§

fn is_contiguous(&self) -> bool

Indicates whether this data buffer stores its elements contiguously. Read more
source§

unsafe fn as_slice_unchecked(&self) -> &[T]

Retrieves the data buffer as a contiguous slice. Read more
source§

fn linear_index(&self, irow: usize, icol: usize) -> usize

Compute the index corresponding to the irow-th row and icol-th column of this matrix. The index must be such that the following holds: Read more
source§

fn get_address_unchecked_linear(&self, i: usize) -> *const T

Gets the address of the i-th matrix component without performing bound-checking. Read more
source§

fn get_address_unchecked(&self, irow: usize, icol: usize) -> *const T

Gets the address of the i-th matrix component without performing bound-checking. Read more
source§

unsafe fn get_unchecked_linear(&self, i: usize) -> &T

Retrieves a reference to the i-th element without bound-checking. Read more
source§

unsafe fn get_unchecked(&self, irow: usize, icol: usize) -> &T

Retrieves a reference to the i-th element without bound-checking. Read more
source§

impl<'a, T, R, C, RStride, CStride> RawStorageMut<T, R, C> for SliceStorageMut<'a, T, R, C, RStride, CStride>where R: Dim, C: Dim, RStride: Dim, CStride: Dim,

source§

fn ptr_mut(&mut self) -> *mut T

The matrix mutable data pointer.
source§

unsafe fn as_mut_slice_unchecked(&mut self) -> &mut [T]

Retrieves the mutable data buffer as a contiguous slice. Read more
source§

fn get_address_unchecked_linear_mut(&mut self, i: usize) -> *mut T

Gets the mutable address of the i-th matrix component without performing bound-checking. Read more
source§

fn get_address_unchecked_mut(&mut self, irow: usize, icol: usize) -> *mut T

Gets the mutable address of the i-th matrix component without performing bound-checking. Read more
source§

unsafe fn get_unchecked_linear_mut(&mut self, i: usize) -> &mut T

Retrieves a mutable reference to the i-th element without bound-checking. Read more
source§

unsafe fn get_unchecked_mut(&mut self, irow: usize, icol: usize) -> &mut T

Retrieves a mutable reference to the element at (irow, icol) without bound-checking. Read more
source§

unsafe fn swap_unchecked_linear(&mut self, i1: usize, i2: usize)

Swaps two elements using their linear index without bound-checking. Read more
source§

unsafe fn swap_unchecked( &mut self, row_col1: (usize, usize), row_col2: (usize, usize) )

Swaps two elements without bound-checking. Read more
source§

impl<'a, T, R, C, RStride, CStride> Storage<T, R, C> for SliceStorageMut<'a, T, R, C, RStride, CStride>where T: Scalar, R: Dim, C: Dim, RStride: Dim, CStride: Dim,

source§

fn into_owned(self) -> <DefaultAllocator as Allocator<T, R, C>>::Bufferwhere DefaultAllocator: Allocator<T, R, C>,

Builds a matrix data storage that does not contain any reference.
source§

fn clone_owned(&self) -> <DefaultAllocator as Allocator<T, R, C>>::Bufferwhere DefaultAllocator: Allocator<T, R, C>,

Clones this data storage to one that does not contain any reference.
source§

impl<'a, T, R, C> IsContiguous for SliceStorageMut<'a, T, R, C, Const<1>, R>where R: DimName, C: Dim + IsNotStaticOne,

source§

impl<'a, T, R, CStride> IsContiguous for SliceStorageMut<'a, T, R, Const<1>, Const<1>, CStride>where R: Dim, CStride: Dim,

source§

impl<'a, T, R, C, RStride, CStride> Send for SliceStorageMut<'a, T, R, C, RStride, CStride>where T: Send, R: Dim, C: Dim, RStride: Dim, CStride: Dim,

source§

impl<'a, T, R, C, RStride, CStride> Sync for SliceStorageMut<'a, T, R, C, RStride, CStride>where T: Sync, R: Dim, C: Dim, RStride: Dim, CStride: Dim,

Auto Trait Implementations§

§

impl<'a, T, R, C, RStride, CStride> RefUnwindSafe for SliceStorageMut<'a, T, R, C, RStride, CStride>where C: RefUnwindSafe, CStride: RefUnwindSafe, R: RefUnwindSafe, RStride: RefUnwindSafe, T: RefUnwindSafe,

§

impl<'a, T, R, C, RStride, CStride> Unpin for SliceStorageMut<'a, T, R, C, RStride, CStride>where C: Unpin, CStride: Unpin, R: Unpin, RStride: Unpin,

§

impl<'a, T, R, C, RStride, CStride> !UnwindSafe for SliceStorageMut<'a, T, R, C, RStride, CStride>

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
§

impl<T> Downcast for Twhere T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T, Global>) -> Arc<dyn Any + Send + Sync, Global>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T> Finalize for T

§

unsafe fn finalize_raw(data: *mut ())

Safety 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.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

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

§

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

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

fn is_in_subset(&self) -> bool

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

fn to_subset_unchecked(&self) -> SS

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

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.
§

impl<T> Component for Twhere T: Send + Sync + 'static,

source§

impl<S, T, R, C> StorageMut<T, R, C> for Swhere R: Dim, C: Dim, S: Storage<T, R, C> + RawStorageMut<T, R, C>,