Struct nalgebra_glm::DefaultAllocator
source · pub struct DefaultAllocator;
Expand description
An allocator based on GenericArray
and VecStorage
for statically-sized and dynamically-sized
matrices respectively.
Trait Implementations§
source§impl<N, C> Allocator<N, Dynamic, C> for DefaultAllocatorwhere
N: Scalar,
C: Dim,
impl<N, C> Allocator<N, Dynamic, C> for DefaultAllocatorwhere
N: Scalar,
C: Dim,
§type Buffer = VecStorage<N, Dynamic, C>
type Buffer = VecStorage<N, Dynamic, C>
The type of buffer this allocator can instanciate.
source§unsafe fn allocate_uninitialized(
nrows: Dynamic,
ncols: C
) -> <DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer
unsafe fn allocate_uninitialized(
nrows: Dynamic,
ncols: C
) -> <DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer
Allocates a buffer with the given number of rows and columns without initializing its content.
source§fn allocate_from_iterator<I>(
nrows: Dynamic,
ncols: C,
iter: I
) -> <DefaultAllocator as Allocator<N, Dynamic, C>>::Bufferwhere
I: IntoIterator<Item = N>,
fn allocate_from_iterator<I>(
nrows: Dynamic,
ncols: C,
iter: I
) -> <DefaultAllocator as Allocator<N, Dynamic, C>>::Bufferwhere
I: IntoIterator<Item = N>,
Allocates a buffer initialized with the content of the given iterator.
source§impl<N, R, C> Allocator<N, R, C> for DefaultAllocatorwhere
N: Scalar,
R: DimName,
C: DimName,
<R as DimName>::Value: Mul<<C as DimName>::Value>,
<<R as DimName>::Value as Mul<<C as DimName>::Value>>::Output: ArrayLength<N>,
impl<N, R, C> Allocator<N, R, C> for DefaultAllocatorwhere
N: Scalar,
R: DimName,
C: DimName,
<R as DimName>::Value: Mul<<C as DimName>::Value>,
<<R as DimName>::Value as Mul<<C as DimName>::Value>>::Output: ArrayLength<N>,
§type Buffer = ArrayStorage<N, R, C>
type Buffer = ArrayStorage<N, R, C>
The type of buffer this allocator can instanciate.
source§unsafe fn allocate_uninitialized(
_: R,
_: C
) -> <DefaultAllocator as Allocator<N, R, C>>::Buffer
unsafe fn allocate_uninitialized(
_: R,
_: C
) -> <DefaultAllocator as Allocator<N, R, C>>::Buffer
Allocates a buffer with the given number of rows and columns without initializing its content.
source§fn allocate_from_iterator<I>(
nrows: R,
ncols: C,
iter: I
) -> <DefaultAllocator as Allocator<N, R, C>>::Bufferwhere
I: IntoIterator<Item = N>,
fn allocate_from_iterator<I>(
nrows: R,
ncols: C,
iter: I
) -> <DefaultAllocator as Allocator<N, R, C>>::Bufferwhere
I: IntoIterator<Item = N>,
Allocates a buffer initialized with the content of the given iterator.
source§impl<N, R> Allocator<N, R, Dynamic> for DefaultAllocatorwhere
N: Scalar,
R: DimName,
impl<N, R> Allocator<N, R, Dynamic> for DefaultAllocatorwhere
N: Scalar,
R: DimName,
§type Buffer = VecStorage<N, R, Dynamic>
type Buffer = VecStorage<N, R, Dynamic>
The type of buffer this allocator can instanciate.
source§unsafe fn allocate_uninitialized(
nrows: R,
ncols: Dynamic
) -> <DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer
unsafe fn allocate_uninitialized(
nrows: R,
ncols: Dynamic
) -> <DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer
Allocates a buffer with the given number of rows and columns without initializing its content.
source§fn allocate_from_iterator<I>(
nrows: R,
ncols: Dynamic,
iter: I
) -> <DefaultAllocator as Allocator<N, R, Dynamic>>::Bufferwhere
I: IntoIterator<Item = N>,
fn allocate_from_iterator<I>(
nrows: R,
ncols: Dynamic,
iter: I
) -> <DefaultAllocator as Allocator<N, R, Dynamic>>::Bufferwhere
I: IntoIterator<Item = N>,
Allocates a buffer initialized with the content of the given iterator.
source§impl<N, CFrom, CTo> Reallocator<N, Dynamic, CFrom, Dynamic, CTo> for DefaultAllocatorwhere
N: Scalar,
CFrom: Dim,
CTo: Dim,
impl<N, CFrom, CTo> Reallocator<N, Dynamic, CFrom, Dynamic, CTo> for DefaultAllocatorwhere
N: Scalar,
CFrom: Dim,
CTo: Dim,
source§unsafe fn reallocate_copy(
rto: Dynamic,
cto: CTo,
buf: VecStorage<N, Dynamic, CFrom>
) -> VecStorage<N, Dynamic, CTo>
unsafe fn reallocate_copy(
rto: Dynamic,
cto: CTo,
buf: VecStorage<N, Dynamic, CFrom>
) -> VecStorage<N, Dynamic, CTo>
Reallocates a buffer of shape
(RTo, CTo)
, possibly reusing a previously allocated buffer
buf
. Data stored by buf
are linearly copied to the output: Read moresource§impl<N, CFrom, RTo> Reallocator<N, Dynamic, CFrom, RTo, Dynamic> for DefaultAllocatorwhere
N: Scalar,
CFrom: Dim,
RTo: DimName,
impl<N, CFrom, RTo> Reallocator<N, Dynamic, CFrom, RTo, Dynamic> for DefaultAllocatorwhere
N: Scalar,
CFrom: Dim,
RTo: DimName,
source§unsafe fn reallocate_copy(
rto: RTo,
cto: Dynamic,
buf: VecStorage<N, Dynamic, CFrom>
) -> VecStorage<N, RTo, Dynamic>
unsafe fn reallocate_copy(
rto: RTo,
cto: Dynamic,
buf: VecStorage<N, Dynamic, CFrom>
) -> VecStorage<N, RTo, Dynamic>
Reallocates a buffer of shape
(RTo, CTo)
, possibly reusing a previously allocated buffer
buf
. Data stored by buf
are linearly copied to the output: Read moresource§impl<N, RFrom, CFrom, CTo> Reallocator<N, RFrom, CFrom, Dynamic, CTo> for DefaultAllocatorwhere
N: Scalar,
RFrom: DimName,
CFrom: DimName,
CTo: Dim,
<RFrom as DimName>::Value: Mul<<CFrom as DimName>::Value>,
<<RFrom as DimName>::Value as Mul<<CFrom as DimName>::Value>>::Output: ArrayLength<N>,
impl<N, RFrom, CFrom, CTo> Reallocator<N, RFrom, CFrom, Dynamic, CTo> for DefaultAllocatorwhere
N: Scalar,
RFrom: DimName,
CFrom: DimName,
CTo: Dim,
<RFrom as DimName>::Value: Mul<<CFrom as DimName>::Value>,
<<RFrom as DimName>::Value as Mul<<CFrom as DimName>::Value>>::Output: ArrayLength<N>,
source§unsafe fn reallocate_copy(
rto: Dynamic,
cto: CTo,
buf: ArrayStorage<N, RFrom, CFrom>
) -> VecStorage<N, Dynamic, CTo>
unsafe fn reallocate_copy(
rto: Dynamic,
cto: CTo,
buf: ArrayStorage<N, RFrom, CFrom>
) -> VecStorage<N, Dynamic, CTo>
Reallocates a buffer of shape
(RTo, CTo)
, possibly reusing a previously allocated buffer
buf
. Data stored by buf
are linearly copied to the output: Read moresource§impl<N, RFrom, CFrom, RTo, CTo> Reallocator<N, RFrom, CFrom, RTo, CTo> for DefaultAllocatorwhere
N: Scalar,
RFrom: Dim,
CFrom: Dim,
RTo: DimName,
CTo: DimName,
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>,
impl<N, RFrom, CFrom, RTo, CTo> Reallocator<N, RFrom, CFrom, RTo, CTo> for DefaultAllocatorwhere
N: Scalar,
RFrom: Dim,
CFrom: Dim,
RTo: DimName,
CTo: DimName,
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>,
source§unsafe fn reallocate_copy(
rto: RTo,
cto: CTo,
buf: <DefaultAllocator as Allocator<N, RFrom, CFrom>>::Buffer
) -> ArrayStorage<N, RTo, CTo>
unsafe fn reallocate_copy(
rto: RTo,
cto: CTo,
buf: <DefaultAllocator as Allocator<N, RFrom, CFrom>>::Buffer
) -> ArrayStorage<N, RTo, CTo>
Reallocates a buffer of shape
(RTo, CTo)
, possibly reusing a previously allocated buffer
buf
. Data stored by buf
are linearly copied to the output: Read moresource§impl<N, RFrom, CFrom, RTo> Reallocator<N, RFrom, CFrom, RTo, Dynamic> for DefaultAllocatorwhere
N: Scalar,
RFrom: DimName,
CFrom: DimName,
RTo: DimName,
<RFrom as DimName>::Value: Mul<<CFrom as DimName>::Value>,
<<RFrom as DimName>::Value as Mul<<CFrom as DimName>::Value>>::Output: ArrayLength<N>,
impl<N, RFrom, CFrom, RTo> Reallocator<N, RFrom, CFrom, RTo, Dynamic> for DefaultAllocatorwhere
N: Scalar,
RFrom: DimName,
CFrom: DimName,
RTo: DimName,
<RFrom as DimName>::Value: Mul<<CFrom as DimName>::Value>,
<<RFrom as DimName>::Value as Mul<<CFrom as DimName>::Value>>::Output: ArrayLength<N>,
source§unsafe fn reallocate_copy(
rto: RTo,
cto: Dynamic,
buf: ArrayStorage<N, RFrom, CFrom>
) -> VecStorage<N, RTo, Dynamic>
unsafe fn reallocate_copy(
rto: RTo,
cto: Dynamic,
buf: ArrayStorage<N, RFrom, CFrom>
) -> VecStorage<N, RTo, Dynamic>
Reallocates a buffer of shape
(RTo, CTo)
, possibly reusing a previously allocated buffer
buf
. Data stored by buf
are linearly copied to the output: Read moresource§impl<N, RFrom, CTo> Reallocator<N, RFrom, Dynamic, Dynamic, CTo> for DefaultAllocatorwhere
N: Scalar,
RFrom: DimName,
CTo: Dim,
impl<N, RFrom, CTo> Reallocator<N, RFrom, Dynamic, Dynamic, CTo> for DefaultAllocatorwhere
N: Scalar,
RFrom: DimName,
CTo: Dim,
source§unsafe fn reallocate_copy(
rto: Dynamic,
cto: CTo,
buf: VecStorage<N, RFrom, Dynamic>
) -> VecStorage<N, Dynamic, CTo>
unsafe fn reallocate_copy(
rto: Dynamic,
cto: CTo,
buf: VecStorage<N, RFrom, Dynamic>
) -> VecStorage<N, Dynamic, CTo>
Reallocates a buffer of shape
(RTo, CTo)
, possibly reusing a previously allocated buffer
buf
. Data stored by buf
are linearly copied to the output: Read moresource§impl<N, RFrom, RTo> Reallocator<N, RFrom, Dynamic, RTo, Dynamic> for DefaultAllocatorwhere
N: Scalar,
RFrom: DimName,
RTo: DimName,
impl<N, RFrom, RTo> Reallocator<N, RFrom, Dynamic, RTo, Dynamic> for DefaultAllocatorwhere
N: Scalar,
RFrom: DimName,
RTo: DimName,
source§unsafe fn reallocate_copy(
rto: RTo,
cto: Dynamic,
buf: VecStorage<N, RFrom, Dynamic>
) -> VecStorage<N, RTo, Dynamic>
unsafe fn reallocate_copy(
rto: RTo,
cto: Dynamic,
buf: VecStorage<N, RFrom, Dynamic>
) -> VecStorage<N, RTo, Dynamic>
Reallocates a buffer of shape
(RTo, CTo)
, possibly reusing a previously allocated buffer
buf
. Data stored by buf
are linearly copied to the output: Read moreimpl<N, R1, R2, C1, C2> SameShapeAllocator<N, R1, C1, R2, C2> for DefaultAllocatorwhere
R1: Dim,
R2: Dim,
C1: Dim,
C2: Dim,
N: Scalar,
DefaultAllocator: Allocator<N, R1, C1> + Allocator<N, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative>,
ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,
impl<N, R1, R2> SameShapeVectorAllocator<N, R1, R2> for DefaultAllocatorwhere
R1: Dim,
R2: Dim,
N: Scalar,
DefaultAllocator: Allocator<N, R1, U1> + Allocator<N, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, U1>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
Auto Trait Implementations§
impl RefUnwindSafe for DefaultAllocator
impl Send for DefaultAllocator
impl Sync for DefaultAllocator
impl Unpin for DefaultAllocator
impl UnwindSafe for DefaultAllocator
Blanket Implementations§
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.