Skip to content

num::linspace

Defined in header <container/util/math.hpp>

vec<real> linspace(real start, real stop, idx n);

Evenly spaced values from start to stop, inclusive. MATLAB/NumPy linspace.

Returns vec<real> rather than std::vector<real>, matching zeros and ones. The constructor from std::vector is explicit, so the earlier return type made num::vec<real> v = num::linspace(...) ill-formed.