Hi,
I'd like to partition an interval such as [-1.0, 1.0] into a discrete set of equally spaced points with a specified distance or step-size between each point. For example if the step-size is 0.1 my function would return an array:
-1.0, -0.9, -0.8,...., 0.9, 1.0.
Now a way of doing using a vector container is a follows:
vector<double> Range;
double Step = 0.1;
Range.push_back(-1.0);
for(unsigned int i=0; i<int(2.0/Step); i++)
{
Range.push_back(Range.back() + Step);
}
Is there an STL library function I could use?