Boost logo

Ublas :

From: Michael Stevens (mail_at_[hidden])
Date: 2005-09-22 02:33:51


Hi Angus.

On Mittwoch 21 September 2005 12:51, Angus Leeming wrote:
> The following simple little code produces a warning with current Boost
> cvs.
>
> $ g++ --version
> g++ (GCC) 4.0.2 20050917 (prerelease) (Debian 4.0.1-8)
>
> $ g++ -I/home/aleem/boost/cvs -DNDEBUG -O2 -W -Wall -c test.C
> /home/aleem/boost/cvs/boost/numeric/ublas/storage.hpp: In function
> 'void make_weights(const Vector&, double, double)':
> /home/aleem/boost/cvs/boost/numeric/ublas/storage.hpp:123: warning:
> 'data' may be used uninitialized in this function

Angus. I cannot reproduce. Are you sure you have the most recent CVS HEAD.
"storage.hpp" should be 1.67. This already has a change to avoid this
warning.

> #include <boost/numeric/ublas/vector.hpp>
>
> typedef boost::numeric::ublas::vector<double> Vector;
>
> Vector const jacobi(Vector const & z, int n, double alpha, double
> beta);
>
>
> void make_weights(Vector const & zeros, double const alpha, double
> const beta)
> {
> Vector::size_type const P = zeros.size();
> Vector weights(P);
>
> weights = jacobi(zeros, P-1, alpha, beta);
> }

I think the warning must come from a call to vector 'resize' member in
'jacobi'. Or am I missing something?

Regards,

Michael

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