Re: [eigen] Re: [Bitbucket] Pull request #80: Allow LevenbergMarquardt to work with non-standard types. (eigen/eigen)

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


On Wed, 27 Aug 2014, Thomas Capricelli wrote:

Currently the unsupported LevenbergMarquardt module uses expressions of
the form |std::sqrt(ex)|. This is a problem if the type of |ex| is not
float or double. This pull request resolves this issue and allows
LevenbergMarquardt to be used with unsupported types such as mpreal.

Ok, sure. I just dont understand the need for sqrt_(). How different from std::sqrt() is it ... ?

Sorry, I should probably have waited for your feedback instead of jumping the gun and merging it.

The definition of sqrt_() is

static Scalar sqrt_(const Scalar& x) { using std::sqrt; return sqrt(x); }

If Scalar is a custom type like mpreal which is defined in its own namespace, then this function also looks for sqrt in that namespace (I think it's called argument-dependent lookup). For standard types there is no difference.


Jitse



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