[][src]Trait nalgebra::base::allocator::Reallocator

pub trait Reallocator<N: Scalar, RFrom: Dim, CFrom: Dim, RTo: Dim, CTo: Dim>: Allocator<N, RFrom, CFrom> + Allocator<N, RTo, CTo> {
    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

unsafe fn reallocate_copy(
    nrows: RTo,
    ncols: CTo,
    buf: Self::Buffer
) -> Self::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.
Loading content...

Implementors

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

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

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

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

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

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

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

Loading content...