Boost logo

Ublas :

Subject: Re: [ublas] numeric bindings nrm2 differences
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2011-11-29 10:39:47


Kraus Philipp wrote:
> > double norm2 = boost::numeric::bindings::blas::nrm2( v );
> > by
> > double norm2 = norm_2( v );
> >
> > and see whether this gives you the expected results.
>
> no changing if I use the nrm2 or norm2 call. The values are always wrong.
> 2.3281 is the wrong value and 1.768592181649873 the correct. The value
> with norm_2 and nrm2 is equal, but wrong

Very good. This means that the problem is completely unrelated to nrm2, and that the input data to nrm2 is already "wrong". Explanation: "norm_2" is the function provided by uBlas itself, and it definitively has no accuracy problems.

So you should compare the input data to "nrm2" in the Matlab and in the uBlas case. (In the worst case you can save them line by line to two different files and compare these files with a diff-viewer.) When you have established that they are indeed different, you can start investigating why they are different.

Regards,
Thomas