mardi 17 mars 2020

C++ - Apply std::exp to an std::vector

Is there a faster (from a performance perspective) way than simply do

std::vector<double> y;
y.reserve(x.size());
for(size_t i = 0; i < x.size(); ++i)
    y.push_back(std::exp(x[i]));

Aucun commentaire:

Enregistrer un commentaire