I would like to create a row vector in C++ with integer elements from and including 0 to N (an integer variable I assign in my C++ program). I have seen the Armadillo C++ library and tried using its span
function but it does not create a vector (rather creates an object with type arma::span
) so writing:
vec n = span(0,N);
does not create the desired vector. If it helps (like if my explanation of what I want is unclear) I know that in MATLAB this creates the vector I want:
n=0:N;
I do not really care which library (if any) is used, provided the library is available on most major Linux distributions (like my present one, Fedora 25).