Hello,
some time ago I discovered great FloatVectorOperations and I fell in love with it ![]()
And lastly I got into situation that for each element in the array I need to calculate std::log10() and store those values in the same array, or at least copy them to another array.
Now I use basic for loop iterating through each element in the array and calculate std::log10() but I wonder if is there any better and faster way to do that?
I tried something like:
std::for_each(p, p+sizeOfArray, [](float &n) { n = std::log10(n); });
Where p is of course pointer to the first element of float array.
I have not made any extensive tests on very big arrays, but for my needs it looks like std::for_each is not much faster than iterating through each elements with standard for loop. While FloatVectorOperations makes really big difference in comparison with for loop.
So I would like to ask you if you know any better solution than classic for loop or std::for_each() ?
For any help great thanks in advance.
Best Regards
