Boost logo

Ublas :

From: Michael Stevens (mail_at_[hidden])
Date: 2005-10-02 07:14:16


On Saturday 01 Oct 2005 16:01, Karl Meerbergen wrote:
> On Saturday 01 October 2005 12:08, Ian McCulloch wrote:
> > BLAS implements norm_1 for complex in this fashion, out of
> > efficency considerations. (ie. avoid a sqrt() in the inner loop). it was
> > probably a mistake, and I think there are some comments by jack Dongarra
> > to that effect.
>
> BLAS do have a function DZNRM2, which is the two norm. It do not think they
> have a 1-norm, but a function DZASUM, which corresponds to uBLAS norm_1.
> So, in my opinion, BLAS is not breaking anything, they just do not call it
> a norm.

> > > 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.
> >
> > You are not wrong. uBLAS just follows the broken way BLAS does it. My
> > vote is to fix it and document that it differs from BLAS.

uBLAS seems more broken then that! The documentation and comments define the
algorithm used for the norm_1 function as 'sum (abs (v [i]))'. But then it is
implemented as 'sum (norm_1(v[i]))'. With that done we should fix
'overview.htm' so it better describes relationship between the 'xASUM'
function and 'norm_1'.

> In GLAS, we have both the norm_1() and abs_sum() functions and similarly,
> norm_inf() and abs_max(). If you do not care about the third property of a
> norm, the more efficient functions are ok.

This seems the way to go. Why did you choose the function names in the order
abs_ followed by sum or max? To me the logical names are sum_abs and max_abs.

Cheers,
        Michael

-- 
___________________________________
Michael Stevens Systems Engineering
34128 Kassel, Germany
Phone/Fax: +49 561 5218038
Navigation Systems, Estimation  and
                 Bayesian Filtering
    http://bayesclasses.sf.net
___________________________________