Skip to content

num::eye

Defined in header <linear/matrix_utils.hpp>

mat<real> eye(idx size);  // (1)

mat<real> eye(idx rows, idx cols);  // (2)

(1) Construct the identity matrix: \(I_n\).

(2) Construct a rectangular identity matrix: \(a_{ij} = \delta_{ij}\), rows x cols.