Scythe-1.0.3
template<matrix_order RO, matrix_style RS, typename T , matrix_order PO, matrix_style PS>
Matrix<T, RO, RS> scythe::vech ( const Matrix< T, PO, PS > &  M)

Vectorize a symmetric Matrix.

This function returns a column vector containing only those elements necessary to reconstruct the symmetric Matrix, M. In practice, this means extracting one triangle of M and returning it as a vector.

Note that the symmetry check in this function (active at error level 3) is quite costly.

Parameters:
MA symmetric Matrix.
Exceptions:
scythe_dimension_error(Level 3)
scythe_alloc_error(Level 1)
See also:
xpnd(const Matrix<T,PO,PS>& v)

References scythe::Matrix< T_type, ORDER, STYLE >::begin_f(), scythe::Matrix_base< ORDER, STYLE >::cols(), copy(), scythe::Matrix< T_type, ORDER, STYLE >::end_f(), scythe::Matrix< T_type, ORDER, STYLE >::isSymmetric(), scythe::Matrix_base< ORDER, STYLE >::rows(), scythe::Matrix_base< ORDER, STYLE >::size(), and scythe::Matrix_base< ORDER, STYLE >::storeorder().