Scythe-1.0.3
template<typename T_type = double, matrix_order ORDER = Col, matrix_style STYLE = Concrete>
void scythe::Matrix< T_type, ORDER, STYLE >::resize ( uint  rows,
uint  cols,
bool  preserve = false 
) [inline]

Resize or reshape a Matrix.

This modifier resizes this Matrix to the given dimensions. Matrix contents after a resize is undefined (junk) unless the preserve flag is set to true. In this case, the old contents of the Matrix remains at the same indices it occupied in the old Matrix. Any excess capacity is junk.

Resizing a Matrix ALWAYS disengages it from its current view, even if the dimensions passed to resize are the same as the current Matrix's dimensions. Resized matrices point to new, uninitialized data blocks (technically, the Matrix might recycle its current block if it is the only Matrix viewing the block, but callers cannot rely on this). It is important to realize that concrete matrices behave just like views in this respect. Any views to a concrete Matrix will be pointing to a different underlying data block than the concrete Matrix after the concrete Matrix is resized.

Parameters:
rowsThe number of rows in the resized Matrix.
colsThe number of columns in the resized Matrix.
preserveWhether or not to retain the current contents of the Matrix.
See also:
resize2Match(const Matrix<T_type, O, S>&, bool)
detach()
Exceptions:
scythe_alloc_error(Level 1)

Referenced by scythe::Matrix< T_type, M_ORDER, M_STYLE >::Matrix(), and scythe::Matrix< T_type, M_ORDER, M_STYLE >::resize2Match().