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]
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 ofbuf
are truncated. - If
buf
is smaller than the output size, then extra elements of the output are left uninitialized.
Implementors
impl<N, CFrom, CTo> Reallocator<N, Dynamic, CFrom, Dynamic, CTo> for DefaultAllocator where
N: Scalar,
CTo: Dim,
CFrom: Dim,
[src]
impl<N, CFrom, CTo> Reallocator<N, Dynamic, CFrom, Dynamic, CTo> for DefaultAllocator where
N: Scalar,
CTo: Dim,
CFrom: Dim,
[src]pub unsafe fn reallocate_copy(
rto: Dynamic,
cto: CTo,
buf: VecStorage<N, Dynamic, CFrom>
) -> VecStorage<N, Dynamic, CTo>
[src]
rto: Dynamic,
cto: CTo,
buf: VecStorage<N, Dynamic, CFrom>
) -> VecStorage<N, Dynamic, CTo>
impl<N, CFrom, RTo> Reallocator<N, Dynamic, CFrom, RTo, Dynamic> for DefaultAllocator where
N: Scalar,
RTo: DimName,
CFrom: Dim,
[src]
impl<N, CFrom, RTo> Reallocator<N, Dynamic, CFrom, RTo, Dynamic> for DefaultAllocator where
N: Scalar,
RTo: DimName,
CFrom: Dim,
[src]pub unsafe fn reallocate_copy(
rto: RTo,
cto: Dynamic,
buf: VecStorage<N, Dynamic, CFrom>
) -> VecStorage<N, RTo, Dynamic>
[src]
rto: RTo,
cto: Dynamic,
buf: VecStorage<N, Dynamic, CFrom>
) -> VecStorage<N, RTo, Dynamic>
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, 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]pub unsafe fn reallocate_copy(
rto: Dynamic,
cto: CTo,
buf: ArrayStorage<N, RFrom, CFrom>
) -> VecStorage<N, Dynamic, CTo>
[src]
rto: Dynamic,
cto: CTo,
buf: ArrayStorage<N, RFrom, CFrom>
) -> VecStorage<N, Dynamic, CTo>
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> 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]pub unsafe fn reallocate_copy(
rto: RTo,
cto: Dynamic,
buf: ArrayStorage<N, RFrom, CFrom>
) -> VecStorage<N, RTo, Dynamic>
[src]
rto: RTo,
cto: Dynamic,
buf: ArrayStorage<N, RFrom, CFrom>
) -> VecStorage<N, RTo, Dynamic>
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, 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]pub unsafe fn reallocate_copy(
rto: RTo,
cto: CTo,
buf: <DefaultAllocator as Allocator<N, RFrom, CFrom>>::Buffer
) -> ArrayStorage<N, RTo, CTo>
[src]
rto: RTo,
cto: CTo,
buf: <DefaultAllocator as Allocator<N, RFrom, CFrom>>::Buffer
) -> ArrayStorage<N, RTo, CTo>
impl<N, RFrom, CTo> Reallocator<N, RFrom, Dynamic, Dynamic, CTo> for DefaultAllocator where
N: Scalar,
CTo: Dim,
RFrom: DimName,
[src]
impl<N, RFrom, CTo> Reallocator<N, RFrom, Dynamic, Dynamic, CTo> for DefaultAllocator where
N: Scalar,
CTo: Dim,
RFrom: DimName,
[src]pub unsafe fn reallocate_copy(
rto: Dynamic,
cto: CTo,
buf: VecStorage<N, RFrom, Dynamic>
) -> VecStorage<N, Dynamic, CTo>
[src]
rto: Dynamic,
cto: CTo,
buf: VecStorage<N, RFrom, Dynamic>
) -> VecStorage<N, Dynamic, CTo>
impl<N, RFrom, RTo> Reallocator<N, RFrom, Dynamic, RTo, Dynamic> for DefaultAllocator where
N: Scalar,
RTo: DimName,
RFrom: DimName,
[src]
impl<N, RFrom, RTo> Reallocator<N, RFrom, Dynamic, RTo, Dynamic> for DefaultAllocator where
N: Scalar,
RTo: DimName,
RFrom: DimName,
[src]pub unsafe fn reallocate_copy(
rto: RTo,
cto: Dynamic,
buf: VecStorage<N, RFrom, Dynamic>
) -> VecStorage<N, RTo, Dynamic>
[src]
rto: RTo,
cto: Dynamic,
buf: VecStorage<N, RFrom, Dynamic>
) -> VecStorage<N, RTo, Dynamic>