forked from M-Labs/nalgebra
4a6022d9bf
There are two major additions in this commit. The first is a new storage trait, `ReshapableStorage`, that can be implemented for storage types that can be reshaped in-place. I have implemented this for both the `ArrayStorage` and `VecStorage` types, as they are the most common and they are just interpretations of a flat list. The second is a `Matrix::reshape_generic` method that allows matrices to be in-place reshaped provided that the underlying storage can handle it. In practice, this means that the standard matrix types (`MatrixMN` and `DMatrix`) can be resized to any size that has the same element count. Resizing between array and vector storage is not implemented due to `Storage` only being implemented for `VecStorage` variants where at least one dimension is `Dynamic`. Additionally, only the generic reshape function is added as it can be a basis for other reshaping functions (see the resizing functions) and I am not particularly in the mood to implement a variety of reshaping methods. |
||
---|---|---|
.. | ||
alias_slice.rs | ||
alias.rs | ||
allocator.rs | ||
array_storage.rs | ||
blas.rs | ||
cg.rs | ||
componentwise.rs | ||
constraint.rs | ||
construction_slice.rs | ||
construction.rs | ||
conversion.rs | ||
coordinates.rs | ||
default_allocator.rs | ||
dimension.rs | ||
edition.rs | ||
helper.rs | ||
indexing.rs | ||
iter.rs | ||
matrix_alga.rs | ||
matrix_simba.rs | ||
matrix_slice.rs | ||
matrix.rs | ||
mod.rs | ||
norm.rs | ||
ops.rs | ||
properties.rs | ||
scalar.rs | ||
statistics.rs | ||
storage.rs | ||
swizzle.rs | ||
unit.rs | ||
vec_storage.rs |