Hi,
I'd like to calculate the square and square-root of a vector of doubles. For example given:
vector<double> Array1(10,2.0);
vector<double> Array2(10,2.0);
for(unsigned int i=0; i<Array1.size(); i++)
Array1[i] = sqrt(Array1[i]);
for(unsigned int i=0; i<Array2.size(); i++)
Array2[i] = Array2[i] * Array2[i];
Is there a way of doing the above using a STL function such as transform? Perhaps there is an in-built sqrt function that acts on arrays?