[Dune] Fwd: Re: another little c++ question that bugs me

Christian Engwer christian.engwer at uni-muenster.de
Wed Aug 13 12:16:50 CEST 2014


One further comment:

> >> 		rez += pow(x1[i] - x2[i],2);

std::pow is rather slow as it can deal with any exponent, also
negative and real. In your case it is better to use
   (x1[i] - x2[i]) * (x1[i] - x2[i])


Christian




More information about the Dune mailing list