Re: [eigen] Re: Raising double to integer powers

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi,

just in case there's interest.


Am 11.05.21 um 01:27 schrieb Marc Glisse:

> Assuming pow is actually your own function and does the usual repeated squaring, unlike std::pow, this may do a lot of redundant computation (in particular base*base is computed many times). Do you know anything about the
> integers? In particular, are they always small? I assume the LinSpaced example doesn't look like the true data. Does your pow function already cache some results?
> 

One can use the shortest summation path, see <https://oeis.org/A003313>, to calculate integer powers.
It's not so hard to do. If there's interest I could dig out an implementation I did a long time ago.
Could provide a nice feature for Eigen.

Best regards,
Peter



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/