Skip to content

num::ones

Defined in header <linear/matrix_utils.hpp>

mat<real> ones(idx rows, idx cols);  // (1)

vec<real> ones(idx size);  // (2)

(1) Construct an n x m matrix filled with ones.

(2) Construct a length-n vector filled with ones.