Sat Jul 04, 2015 2:13 pm
std::vector<double> ClassName::linspace(double a, double b, size_t N) {
double h = (b - a) / static_cast<double>(N-1);
vector<double> xs(N);
vector<double>::iterator x;
double val;
for (x = xs.begin(), val = a; x != xs.end(); ++x, val += h)
*x = val;
return xs;
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.