← Back to team overview

dolfin team mailing list archive

Re: Memory access error in DenseMatrix::invert()

 

On Sun, May 07, 2006 at 02:41:05PM +0200, Garth N. Wells wrote:
> Quoting Anders Logg <logg@xxxxxxxxx>:
> 
> > When adding the option to compile without PETSc, I took the
> > opportunity change the precomputation of quadrature weights for the
> > ODE solvers to use DenseMatrix instead of the standard PETSc
> > Matrix. (The matrices are small and dense anyway.)
> > 
> > It seems that DenseMatrix::invert() sometimes gives unexpected results
> > and the reason seems to be a memory access error somewhere in ublas. I
> > don't know if this is a problem with ublas or the way we use
> > it. Garth, could you look again at DenseMatrix::invert() and see if
> > you can spot something obvious?
> >
> 
> I'll take a look. I haven't tested invert - Kristian Oelgaard has been using it
> and hasn't had any problems. Are you using the Ubuntu Boost package?

Yes.

I found the following example of doing matrix inverse with ublas and
it looks very similar to what we have:

http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?LU_Matrix_Inversion

/Anders


> > I have attached the error log from running valgrind and here is the code
> > that
> > reproduces the error:
> > 
> >    DenseMatrix A(3, 3);
> >    A(0, 0) = A(1, 1) = A(2, 2) = 1.0;
> >    A.invert();
> > 
> > How about adding solve(DenseVector& x, const DenseVector& b) to DenseMatrix?
> >
> 
> Sure.
> 
> Garth
>  
> > /Anders
> > 



References