I was trying to use the accumulate function for vectors
vector <double> A;
double B = 0;
A.reserve(100);
for(itr = 0; itr < 210; itr++)
{
term1 = pow(r[itr], 12);
term1 = 1/term1;
term2 = pow(r[itr], 6);
term2 = 2/term2;
A.push_back(term1 - term2);
}
B = accumulate(A.begin(), A.end(), 0);
however, I always got B = 0, while A had nonzero values