Trait rin::math::base::allocator::Reallocator[][src]

pub trait Reallocator<N, RFrom, CFrom, RTo, CTo>: Allocator<N, RFrom, CFrom> + Allocator<N, RTo, CTo> where
    N: Scalar,
    RTo: Dim,
    CTo: Dim,
    RFrom: Dim,
    CFrom: Dim
{ pub unsafe fn reallocate_copy(
        nrows: RTo,
        ncols: CTo,
        buf: Self::Buffer
    ) -> Self::Buffer; }

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

pub unsafe fn reallocate_copy(
    nrows: RTo,
    ncols: CTo,
    buf: Self::Buffer
) -> Self::Buffer
[src]

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.
Loading content...

Implementors

impl<N, CFrom, CTo> Reallocator<N, Dynamic, CFrom, Dynamic, CTo> for DefaultAllocator where
    N: Scalar,
    CTo: Dim,
    CFrom: Dim
[src]

impl<N, CFrom, RTo> Reallocator<N, Dynamic, CFrom, RTo, Dynamic> for DefaultAllocator where
    N: Scalar,
    RTo: DimName,
    CFrom: Dim
[src]

impl<N, RFrom, CFrom, CTo> Reallocator<N, RFrom, CFrom, Dynamic, CTo> for DefaultAllocator where
    N: Scalar,
    CTo: Dim,
    RFrom: DimName,
    CFrom: DimName,
    <RFrom as DimName>::Value: Mul<<CFrom as DimName>::Value>,
    <<RFrom as DimName>::Value as Mul<<CFrom as DimName>::Value>>::Output: ArrayLength<N>, 
[src]

impl<N, RFrom, CFrom, RTo> Reallocator<N, RFrom, CFrom, RTo, Dynamic> for DefaultAllocator where
    N: Scalar,
    RTo: DimName,
    RFrom: DimName,
    CFrom: DimName,
    <RFrom as DimName>::Value: Mul<<CFrom as DimName>::Value>,
    <<RFrom as DimName>::Value as Mul<<CFrom as DimName>::Value>>::Output: ArrayLength<N>, 
[src]

impl<N, RFrom, CFrom, RTo, CTo> Reallocator<N, RFrom, CFrom, RTo, CTo> for DefaultAllocator where
    N: Scalar,
    RTo: DimName,
    CTo: DimName,
    RFrom: Dim,
    CFrom: Dim,
    DefaultAllocator: Allocator<N, RFrom, CFrom>,
    <RTo as DimName>::Value: Mul<<CTo as DimName>::Value>,
    <<RTo as DimName>::Value as Mul<<CTo as DimName>::Value>>::Output: ArrayLength<N>, 
[src]

impl<N, RFrom, CTo> Reallocator<N, RFrom, Dynamic, Dynamic, CTo> for DefaultAllocator where
    N: Scalar,
    CTo: Dim,
    RFrom: DimName
[src]

impl<N, RFrom, RTo> Reallocator<N, RFrom, Dynamic, RTo, Dynamic> for DefaultAllocator where
    N: Scalar,
    RTo: DimName,
    RFrom: DimName
[src]

Loading content...