Scythe-1.0.3
template<typename T , matrix_order O, matrix_style S>
Matrix<T,O,S> scythe::eye ( unsigned int  k)

Create a k by k identity Matrix.

This function creates a k by k Matrix with 1s along the diagonal and 0s on the off-diagonal. This template is overloaded multiple times to provide default type, matrix_order, and matrix_style. The default call to eye returns a Concrete Matrix containing double precision floating point numbers, in column-major order. The user can write explicit template calls to generate matrices with other orders and/or styles.

Parameters:
kThe dimension of the identity Matrix.
See also:
diag(const Matrix<T,O,S>& M)
ones(unsigned int rows, unsigned int cols)
Exceptions:
scythe_alloc_error(Level 1)

References for_each_ij_set().