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
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Re: [Bitbucket] Pull request #80: Allow LevenbergMarquardt to work with non-standard types. (eigen/eigen)
- From: Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>
- Date: Fri, 29 Aug 2014 17:55:31 +0200
- Organization: freehackers.org
Il 28/08/2014 22:31, Jitse Niesen ha scritto:
Sorry, I should probably have waited for your feedback instead of
jumping the gun and merging it.
No, it's ok, you did well.
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.
You mean that
{ using std::sqrt; return sqrt(x); }
will use std::sqrt() only when sqrt(someothertype) is not previously
defined ?
Thomas
--
Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>
http://www.freehackers.org/thomas/