# [−][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]

#### `unsafe fn reallocate_copy(
rto: Dynamic,
cto: CTo,
buf: VecStorage<N, Dynamic, CFrom>
) -> VecStorage<N, Dynamic, CTo>`[src]

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

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

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

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

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

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

Loading content...

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