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

Return the diagonal of a Matrix.

This function returns the diagonal of a Matrix in a row vector.

Parameters:
MThe Matrix one wishes to extract the diagonal of.
See also:
crossprod (const Matrix<T,PO,PS> &M)
Exceptions:
scythe_alloc_error(Level 1)

References scythe::Matrix< T_type, ORDER, STYLE >::begin(), scythe::Matrix< T_type, ORDER, STYLE >::begin_f(), scythe::Matrix_base< ORDER, STYLE >::cols(), scythe::Matrix< T_type, ORDER, STYLE >::end(), min(), and scythe::Matrix_base< ORDER, STYLE >::rows().