Re: [eigen] How to raise double to array powers in Eigen |
[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
pow(x,k) can be accomplished on
O(log2(k)) time by
y = x; accum = 1; while (k) { if (k&1) accum += y; k>>=1; y = y*y; } return y e.g. pow(x,11) = x^8 * x^2 * x^1 On 08/18/2014 01:30 PM, Ian Bell wrote:
|
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |