pub trait Reallocator<T: Scalar, RFrom: Dim, CFrom: Dim, RTo: Dim, CTo: Dim>: Allocator<T, RFrom, CFrom> + Allocator<T, RTo, CTo> {
    // Required method
    unsafe fn reallocate_copy(
        nrows: RTo,
        ncols: CTo,
        buf: <Self as Allocator<T, RFrom, CFrom>>::Buffer
    ) -> <Self as Allocator<T, RTo, CTo>>::Buffer;
}
Expand description

A matrix reallocator. Changes the size of the memory buffer that initially contains (RFrom × CFrom) elements to a smaller or larger size (RTo, CTo).

Required Methods§

source

unsafe fn reallocate_copy( nrows: RTo, ncols: CTo, buf: <Self as Allocator<T, RFrom, CFrom>>::Buffer ) -> <Self as Allocator<T, RTo, CTo>>::Buffer

Reallocates a buffer of shape (RTo, CTo), possibly reusing a previously allocated buffer buf. Data stored by buf are linearly copied to the output:

  • The copy is performed as if both were just arrays (without a matrix structure).
  • If buf is larger than the output size, then extra elements of buf are truncated.
  • If buf is smaller than the output size, then extra elements of the output are left uninitialized.

Implementors§

source§

impl<T: Scalar, CFrom: Dim, CTo: Dim> Reallocator<T, Dynamic, CFrom, Dynamic, CTo> for DefaultAllocator

source§

impl<T: Scalar, CFrom: Dim, RTo: DimName> Reallocator<T, Dynamic, CFrom, RTo, Dynamic> for DefaultAllocator

source§

impl<T: Scalar, CTo, const RFROM: usize, const CFROM: usize> Reallocator<T, Const<RFROM>, Const<CFROM>, Dynamic, CTo> for DefaultAllocatorwhere CTo: Dim,

source§

impl<T: Scalar, RFrom, CFrom, const RTO: usize, const CTO: usize> Reallocator<T, RFrom, CFrom, Const<RTO>, Const<CTO>> for DefaultAllocatorwhere RFrom: Dim, CFrom: Dim, Self: Allocator<T, RFrom, CFrom>,

source§

impl<T: Scalar, RFrom: DimName, CTo: Dim> Reallocator<T, RFrom, Dynamic, Dynamic, CTo> for DefaultAllocator

source§

impl<T: Scalar, RFrom: DimName, RTo: DimName> Reallocator<T, RFrom, Dynamic, RTo, Dynamic> for DefaultAllocator

source§

impl<T: Scalar, RTo, const RFROM: usize, const CFROM: usize> Reallocator<T, Const<RFROM>, Const<CFROM>, RTo, Dynamic> for DefaultAllocatorwhere RTo: DimName,