Boost logo

Ublas :

Subject: Re: [ublas] numeric bindings nrm2 differences
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2011-11-29 13:25:08


Kraus Philipp wrote:
> The C++ Code ist build with 
> g++ text.cpp -I/Developer/opt/Boost/1.48.0/include -I/Developer/opt/Boost/sandbox/numeric_bindings -latlas -lf77blas -lcblas
>
> Matlab result: 1.897052466920491
> C++ result: blas: 1.46849
>     ublas: 1.46849

I tried to reproduce (I even installed boost-1.48), but I got
ublas: 1.89705

Can you remove the call to "blas::nrm2(vec3)" or at least call "ublas::norm_2(vec3)" first, so that "memory corruption" by "blas::nrm2(vec3)" can be excluded?

> If I compile it with -D BOOST_NUMERIC_BINDINGS_BLAS_CBLAS flag, I get errors eg:

You need to add the include path for atlas to the compile line...

> The parameter n is the vector.size(), x the vector, isn't it?

Correct.

> Which definition has incx?

You should set it to "1" for this case.

Regards,
Thomas