Boost logo

Glas :

Re: [glas] norms and inner products for vectors of matrices

From: Karl Meerbergen (Karl.Meerbergen_at_[hidden])
Date: 2006-01-13 05:02:29

Peter Gottschling wrote:

>Concerning the norms, I would like to limit the result type to real
>values as I have seen it in all mathematical definitions. Does
>somebody sees a reason to vectors or matrices as results?
>The definitions of vector<vector> norms are straight forward:
>- norm_1 := sum (norm_1(x[i])
>- norm_2 := sqrt(sum(norm_2(x[i])^2)) // there might be more
>efficient ways to compute this
>- norm_inf := max(norm_inf(x[i])

I am afraid that we cannot define norm_1, etc in this way. (I too made
this mistake in a previous mail) But we can define functions
generalized_norm_1 := sum (generalized_norm_1(x[i])
generalized_norm_2 :=sqrt( sum (generalized_norm_2(x[i])^2 )
generalized_norm_inf := max (generalized_norm_inf(x[i])

norm_1, norm_2, norm_inf are well defined in linear algebra and these
definitions should be respected:
norm_1 := sum( abs(x[i]) )
These should only be used for vector and matrix objects with 'scalar'