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: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Wed, 17 Jun 2009 23:16:16 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=7VIfMOhZl78ZAStSlhB3ZAo3zA1lN+7ax3a+iVJ1Cos=; b=ZbyD9KMJeU9Zr6MkdeXHBVPQOBK8axsqj4ciMIELWXIHVCniNpp3+jQ7DJGnbR8Gto reerCwE+LMttcDR+V/RsX0RtJxeEjvfle1OXQLGeh4h9D2lISZnfLU5wwHslskknnkJ+ Y2BUWv8+J7WZHX4Z/de1eAxXq20GluPyGllPM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=VhYn/srLLoqOb6vOXVe617aOWVsd7juXgnfdymdhZk0n60piBfoDv5MzFWyHqaS0B0 KbGAIEBjLgZzdPyAUWhvR6YQFM82jWkhDe/gU3fqpgseiE3hBbQsae4twTmuX217JknX yv4owV59tCpKbpSBDX5+adTxrWcGZDfUkrnXo=
Yes, the word "norm" is not normalized across mathematics...
Personnally I just stay away from using the word "norm" in relation to
complex numbers, instead I say "absolute value" and "squared absolute
value". So in Eigen we do abs and abs2.
So in Eigen::Complex, one may or may not implement norm() for
compatibility with std::complex, i don't have a strong opinion, but
what we must have for sure is abs and abs2.
Benoit
2009/6/17 Mark Borgerding <mark@xxxxxxxxxxxxxx>
>
> According to matlab/octave and http://en.wikipedia.org/wiki/Norm_(mathematics)
> norm(3+4j) = abs(3+4j) == 5
>
> but in C++:
> norm( complex<float>(3,4) ) == 25
> abs( complex<float>(3,4) ) == 5
>
>
> Just thought I'd mention it while we are thinking about problems to solve with Eigen::Complex.
>
>
> -- Mark
>
>
>