Boost logo

Ublas :

From: Peter Schmitteckert (peter_at_[hidden])
Date: 2005-09-30 14:58:57


Dear Karl,

On Fri, 30 Sep 2005, Karl Meerbergen wrote:

> I have the impression that norm_1 and norm_inf are not correctly
> computed for complex vectors.
> It looks like norm_1 makes the sum of the absolute values of the real
> and imaginary parts, and norm_inf is the maximum of the absolute values
> of the real and the imaginary parts.
>
> Most textbooks only talk about real valued vectors. I would expect that
> norm_1 is the sum of the moduli of the vector's elements. Norm_inf is
> the maximum modulus. One of the definitions of norm is that for any
> scalar a and vector v, we have
>
> norm_1(a*v) = |a| * norm_1(v)
>
> What is |a| for a complex value? If it is std::abs(), norm_1 and
> norm_inf are definitely not correct.
> If |a| = std::abs(a.real())+std::abs(a.imag)), this is not correct
> either, I think. Correct me if I am wrong.

  || x ||_r := ( \sum_{j=1}^p | x_j | )^ (1/r)

|a| of a complex number is std::abs(), that is sqrt( a^* a )
or sqrt( re(a)^2 + im(a)^2 ).

So, you are correct.

Best regards,
Peter