← Back to team overview

dolfin team mailing list archive

Re: bug in vector summation???

 

This is probably my fault. When I have proper net access I'll clean up the use
of namespaces in the uBLAS wrapper classes.

Garth

Quoting Anders Logg <logg@xxxxxxxxx>:

> No wonder, the sum() function in uBlasVector has the following elegant
> implementation:
> 
> real uBlasVector::sum() const
> {
>   return sum();
> }
> 
> :-)
> 
> Replace with the following (will commit this update shortly):
> 
> real uBlasVector::sum() const
> {
>   // FIXME: Find suitable uBlas call to compute sum
>   real s = 0.0;
>   for (uint i = 0; i < size(); i++)
>     s += (this)[i];
>   return s;
> }
> 
> /Anders
> 
> On Fri, Sep 15, 2006 at 01:59:42PM +0200, Dag Lindbo wrote:
> > Hello all,
> > 
> > I have a possible bug to report in the Vector class. The summation call,
> > sum(), causes my program to freeze. To test I use this little code
> > 
> >   Vector vec;
> >   vec.init(100);
> >   vec = 1.0;
> >   vec.disp();         // All seems fine
> >   real s = vec.sum(); // Does not return. 100% CPU load
> > 
> > Ideas??
> > 
> > /Dag Lindbo
> > 
> > _______________________________________________
> > DOLFIN-dev mailing list
> > DOLFIN-dev@xxxxxxxxxx
> > http://www.fenics.org/mailman/listinfo/dolfin-dev
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev
> 


References