# [−][src]Struct nalgebra::base::default_allocator::DefaultAllocator

    pub struct DefaultAllocator;

An allocator based on `GenericArray` and `VecStorage` for statically-sized and dynamically-sized matrices respectively.

## Trait Implementations

### `impl<N, R, C> Allocator<N, R, C> for DefaultAllocator where
N: Scalar,
R: DimName,
C: DimName,
R::Value: Mul<C::Value>,
Prod<R::Value, C::Value>: ArrayLength<N>,` [src]

#### `type Buffer = ArrayStorage<N, R, C>`

The type of buffer this allocator can instanciate.

#### `unsafe fn allocate_uninitialized(_: R, _: C) -> Self::Buffer`[src]

Allocates a buffer with the given number of rows and columns without initializing its content.

#### `fn allocate_from_iterator<I: IntoIterator<Item = N>>(
nrows: R,
ncols: C,
iter: I
) -> Self::Buffer`[src]

Allocates a buffer initialized with the content of the given iterator.

### `impl<N: Scalar, C: Dim> Allocator<N, Dynamic, C> for DefaultAllocator`[src]

#### `type Buffer = VecStorage<N, Dynamic, C>`

The type of buffer this allocator can instanciate.

#### `unsafe fn allocate_uninitialized(nrows: Dynamic, ncols: C) -> Self::Buffer`[src]

Allocates a buffer with the given number of rows and columns without initializing its content.

#### `fn allocate_from_iterator<I: IntoIterator<Item = N>>(
nrows: Dynamic,
ncols: C,
iter: I
) -> Self::Buffer`[src]

Allocates a buffer initialized with the content of the given iterator.

### `impl<N: Scalar, R: DimName> Allocator<N, R, Dynamic> for DefaultAllocator`[src]

#### `type Buffer = VecStorage<N, R, Dynamic>`

The type of buffer this allocator can instanciate.

#### `unsafe fn allocate_uninitialized(nrows: R, ncols: Dynamic) -> Self::Buffer`[src]

Allocates a buffer with the given number of rows and columns without initializing its content.

#### `fn allocate_from_iterator<I: IntoIterator<Item = N>>(
nrows: R,
ncols: Dynamic,
iter: I
) -> Self::Buffer`[src]

Allocates a buffer initialized with the content of the given iterator.

### `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]

#### `unsafe fn reallocate_copy(
rto: RTo,
cto: CTo,
buf: Self::Buffer
) -> ArrayStorage<N, RTo, CTo>`[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: Read more

### `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]

#### `unsafe fn reallocate_copy(
rto: Dynamic,
cto: CTo,
buf: ArrayStorage<N, RFrom, CFrom>
) -> VecStorage<N, Dynamic, CTo>`[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: Read more

### `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]

#### `unsafe fn reallocate_copy(
rto: RTo,
cto: Dynamic,
buf: ArrayStorage<N, RFrom, CFrom>
) -> VecStorage<N, RTo, Dynamic>`[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: Read more

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

#### `unsafe fn reallocate_copy(
rto: Dynamic,
cto: CTo,
buf: VecStorage<N, Dynamic, CFrom>
) -> VecStorage<N, Dynamic, CTo>`[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: Read more

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

#### `unsafe fn reallocate_copy(
rto: RTo,
cto: Dynamic,
buf: VecStorage<N, Dynamic, CFrom>
) -> VecStorage<N, RTo, Dynamic>`[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: Read more

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

#### `unsafe fn reallocate_copy(
rto: Dynamic,
cto: CTo,
buf: VecStorage<N, RFrom, Dynamic>
) -> VecStorage<N, Dynamic, CTo>`[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: Read more

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

#### `unsafe fn reallocate_copy(
rto: RTo,
cto: Dynamic,
buf: VecStorage<N, RFrom, Dynamic>
) -> VecStorage<N, RTo, Dynamic>`[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: Read more

### `impl<N, R1, R2, C1, C2> SameShapeAllocator<N, R1, C1, R2, C2> for DefaultAllocator where
R1: Dim,
R2: Dim,
C1: Dim,
C2: Dim,
N: Scalar,
DefaultAllocator: Allocator<N, R1, C1> + Allocator<N, SameShapeR<R1, R2>, SameShapeC<C1, C2>>,
ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,` [src]

### `impl<N, R1, R2> SameShapeVectorAllocator<N, R1, R2> for DefaultAllocator where
R1: Dim,
R2: Dim,
N: Scalar,
DefaultAllocator: Allocator<N, R1, U1> + Allocator<N, SameShapeR<R1, R2>>,
ShapeConstraint: SameNumberOfRows<R1, R2>,` [src]

## Auto Trait Implementations

### `impl Send for DefaultAllocator`

### `impl Unpin for DefaultAllocator`

### `impl Sync for DefaultAllocator`

### `impl UnwindSafe for DefaultAllocator`

### `impl RefUnwindSafe for DefaultAllocator`

## Blanket Implementations

### `impl<T, U> Into<U> for T where
U: From<T>,` [src]

#### `fn into(self) -> U`[src]

Performs the conversion.

### `impl<T> From<T> for T`[src]

#### `fn from(t: T) -> T`[src]

Performs the conversion.

### `impl<T, U> TryFrom<U> for T where
U: Into<T>,` [src]

#### `type Error = Infallible`

The type returned in the event of a conversion error.

#### `fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`[src]

Performs the conversion.

### `impl<T, U> TryInto<U> for T where
U: TryFrom<T>,` [src]

#### `type Error = <U as TryFrom<T>>::Error`

The type returned in the event of a conversion error.

#### `fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`[src]

Performs the conversion.

### `impl<T> BorrowMut<T> for T where
T: ?Sized,` [src]

#### `fn borrow_mut(&mut self) -> &mut T`[src]

Mutably borrows from an owned value. Read more

### `impl<T> Borrow<T> for T where
T: ?Sized,` [src]

#### `fn borrow(&self) -> &T`[src]

Immutably borrows from an owned value. Read more

### `impl<T> Any for T where
T: 'static + ?Sized,` [src]

#### `fn type_id(&self) -> TypeId`[src]

Gets the `TypeId` of `self`. Read more

### `impl<T> Same<T> for T`[src]

#### `type Output = T`

Should always be `Self`

### `impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,` [src]

#### `fn to_subset(&self) -> Option<SS>`[src]

The inverse inclusion map: attempts to construct `self` from the equivalent element of its superset. Read more

#### `fn is_in_subset(&self) -> bool`[src]

Checks if `self` is actually part of its subset `T` (and can be converted to it).

#### `unsafe fn to_subset_unchecked(&self) -> SS`[src]

Use with care! Same as `self.to_subset` but without any property checks. Always succeeds.

#### `fn from_subset(element: &SS) -> SP`[src]

The inclusion map: converts `self` to the equivalent element of its superset.

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)