Trait rin::math::base::allocator::Allocator [−][src]
pub trait Allocator<N, R, C = U1>: Any where
C: Dim,
N: Scalar,
R: Dim, { type Buffer: ContiguousStorageMut<N, R, C> + Clone; pub unsafe fn allocate_uninitialized(nrows: R, ncols: C) -> Self::Buffer; pub fn allocate_from_iterator<I>(
nrows: R,
ncols: C,
iter: I
) -> Self::Buffer
where
I: IntoIterator<Item = N>; }
A matrix allocator of a memory buffer that may contain R::to_usize() * C::to_usize()
elements of type N
.
An allocator is said to be:
− static: if R
and C
both implement DimName
.
− dynamic: if either one (or both) of R
or C
is equal to Dynamic
.
Every allocator must be both static and dynamic. Though not all implementations may share the
same Buffer
type.
Associated Types
type Buffer: ContiguousStorageMut<N, R, C> + Clone
[src]
The type of buffer this allocator can instanciate.
Required methods
pub unsafe fn allocate_uninitialized(nrows: R, ncols: C) -> Self::Buffer
[src]
Allocates a buffer with the given number of rows and columns without initializing its content.
pub fn allocate_from_iterator<I>(nrows: R, ncols: C, iter: I) -> Self::Buffer where
I: IntoIterator<Item = N>,
[src]
I: IntoIterator<Item = N>,
Allocates a buffer initialized with the content of the given iterator.
Implementors
impl<N, C> Allocator<N, Dynamic, C> for DefaultAllocator where
C: Dim,
N: Scalar,
[src]
impl<N, C> Allocator<N, Dynamic, C> for DefaultAllocator where
C: Dim,
N: Scalar,
[src]type Buffer = VecStorage<N, Dynamic, C>
pub unsafe fn allocate_uninitialized(
nrows: Dynamic,
ncols: C
) -> <DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer
[src]
nrows: Dynamic,
ncols: C
) -> <DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer
pub fn allocate_from_iterator<I>(
nrows: Dynamic,
ncols: C,
iter: I
) -> <DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer where
I: IntoIterator<Item = N>,
[src]
nrows: Dynamic,
ncols: C,
iter: I
) -> <DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer where
I: IntoIterator<Item = N>,
impl<N, R> Allocator<N, R, Dynamic> for DefaultAllocator where
N: Scalar,
R: DimName,
[src]
impl<N, R> Allocator<N, R, Dynamic> for DefaultAllocator where
N: Scalar,
R: DimName,
[src]type Buffer = VecStorage<N, R, Dynamic>
pub unsafe fn allocate_uninitialized(
nrows: R,
ncols: Dynamic
) -> <DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer
[src]
nrows: R,
ncols: Dynamic
) -> <DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer
pub fn allocate_from_iterator<I>(
nrows: R,
ncols: Dynamic,
iter: I
) -> <DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer where
I: IntoIterator<Item = N>,
[src]
nrows: R,
ncols: Dynamic,
iter: I
) -> <DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer where
I: IntoIterator<Item = N>,
impl<N, R, C> Allocator<N, R, C> for DefaultAllocator where
C: DimName,
N: Scalar,
R: DimName,
<R as DimName>::Value: Mul<<C as DimName>::Value>,
<<R as DimName>::Value as Mul<<C as DimName>::Value>>::Output: ArrayLength<N>,
[src]
impl<N, R, C> Allocator<N, R, C> for DefaultAllocator where
C: DimName,
N: Scalar,
R: DimName,
<R as DimName>::Value: Mul<<C as DimName>::Value>,
<<R as DimName>::Value as Mul<<C as DimName>::Value>>::Output: ArrayLength<N>,
[src]type Buffer = ArrayStorage<N, R, C>
pub unsafe fn allocate_uninitialized(
R,
C
) -> <DefaultAllocator as Allocator<N, R, C>>::Buffer
[src]
R,
C
) -> <DefaultAllocator as Allocator<N, R, C>>::Buffer
pub fn allocate_from_iterator<I>(
nrows: R,
ncols: C,
iter: I
) -> <DefaultAllocator as Allocator<N, R, C>>::Buffer where
I: IntoIterator<Item = N>,
[src]
nrows: R,
ncols: C,
iter: I
) -> <DefaultAllocator as Allocator<N, R, C>>::Buffer where
I: IntoIterator<Item = N>,