Re: [eigen] Does c++ use of "norm" bother anyone else? |

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

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] Does c++ use of "norm" bother anyone else?*From*: Mark Borgerding <mark@xxxxxxxxxxxxxx>*Date*: Thu, 18 Jun 2009 09:26:34 -0400

Markus Moll wrote:

Hi On Thursday 18 June 2009 14:15:01 Markus Moll wrote:On Thursday 18 June 2009 13:40:34 Benoit Jacob wrote:Then I think that it's safe to implement std::norm also for Eigen::Complex, as it's documented there what it does.That's the same problem as with std::vector, no? Eigen::Complex will be a template, so there's no way to specialize std::norm properly.Oh, but I think that this issue was resolved by requiring that libraryfunctions (and, in fact, just about everyone else) use the unqualified names.This, together with argument dependent lookup, allows things like:namespace std { template<typename T> T norm(const complex<T>& c); } namespace Eigen { template<typename T> T norm(const Complex<T>& c); }template<typename C> void g(const C& c) { norm(c); /* where c is eitherEigen::Complex or std::complex */ }to work correctly.So in fact, Eigen should best implement atemplate<typename T> Eigen::norm(const Eigen::Complex<T>&)function template with the std::complex semantics. Markus

I like Benoit's suggestion of also providing abs2(Complex)

**References**:**[eigen] Does c++ use of "norm" bother anyone else?***From:*Mark Borgerding

**Re: [eigen] Does c++ use of "norm" bother anyone else?***From:*Benoit Jacob

**Re: [eigen] Does c++ use of "norm" bother anyone else?***From:*Markus Moll

**Re: [eigen] Does c++ use of "norm" bother anyone else?***From:*Markus Moll

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Does c++ use of "norm" bother anyone else?** - Next by Date:
**[eigen] odd behaviour of operator[]** - Previous by thread:
**Re: [eigen] Does c++ use of "norm" bother anyone else?** - Next by thread:
**Re: [eigen] preparing the 2.0.3 release**

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