Re: [eigen] Does c++ use of "norm" bother anyone else? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
Hi
On Thursday 18 June 2009 13:40:34 Benoit Jacob wrote:
> Indeed, std::complex norm() isn't a "norm" in this sense. But it still
> is called "norm" in other mathematical contexts -- it's not just the
> c++ people who were on crack, it's the whole mathematics tradition :)
>
> (Optional part: the other sense of "norm" -- skip if not interested:
> let K/k be a Galois extension, let x in K, then the norm of x with
> respect to this extension is the product of the sigma(x) for all sigma
> in the Galois group of K/k. So for complex numbers, they are a Galois
> extension of the real numbers, of degree 2, the Galois group Gal(C/R)
> has 2 elements, the identity and complex conjugation, so the norm of a
> complex number x is the product x * conj(x) which is what
> std::complex calls norm(). More references:
> http://en.wikipedia.org/wiki/Field_norm#Example
> )
Oh, wow, I was totally unaware of this definition. (Although I still think
it's better called "field norm" to avoid confusion). So I apologize to the C++
committee, they have actually done it right :-)
> Actually I think that norm() isn't a method in std::complex, it's only
> a global function in std:: , right ?
Yes.
> 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.
Markus
--
PGP key on www.esat.kuleuven.be/~mmoll/public_key.pgp
Fingerprint is
90C4 B47D 1A00 5AC1 9147 3197 EDA7 1E0E 99E4 9EDB