[eigen] compile-time sqrt

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


Hi.

I sometimes need to use sqrt of epsilon (typically in unsupported/Eigen/src/NonLinearOptimization/chkder.h)
Currently i do
const Scalar eps = ei_sqrt(NumTraits<Scalar>::epsilon());

but i'd like to have it computed at compile-time.. i'm not sure how to do this. I've tried :
const Scalar eps = ei_meta_sqrt<NumTraits<Scalar>::epsilon()>::ret;

but the compiler complais that epsilon() is a function call hence the template can't be done.

Thomas
-- 
Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>
http://www.freehackers.org/thomas



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