On Wed, Jul 7, 2010 at 4:45 PM, Max S. Kaznady
<max.kaznady@gmail.com> wrote:
Great example, thanks! Before your post, I wrote something like:
namespace my {
void my_vec_pow(boost::numeric::ublas::vector<double> &vec, double expon) {
boost::numeric::ublas::vector<double>::iterator it;
for (it = vec.begin(); it != vec.end(); ++it)
*it = std::pow(*it, expon);
}
}
I'm just curious, but from performance perspective, how much more
efficient is it to use iterators and functors? I would assume that
most compilers can exploit this to improve memory management and speed
up the computation... I'll write some benchmarks later on this week,
efficiency is crucial for what I'm doing.