Boost logo

Ublas :

From: Karl Meerbergen (Karl.Meerbergen_at_[hidden])
Date: 2005-05-30 06:23:33


Hello Dan,

If you want to solve a linear system, you best perform an LU factorization
first and then solve using a backtransformation. Computing the inverse first
and multiplying the right-hand side with the inverse is twice as expensive
and numerically less stable. (For sparse matrices, it is extremely expensive
in memory, since you have to store a full inverse matrix.)

For dense matrices, I suggest you use the LAPACK bindings. They are in
boost-sandbox in numeric::bindings::lapack::gesv for unsymmetric matrices. I
think the boost-sandbox cvs version is up to date with uBLAS CVS. I am
currently not using the CVS head, so I cannot guarantee this.

For sparse matrices, there are umfpack bindings.

I hope this is helpful.

Best,

Karl

On Friday 27 May 2005 18:20, Dan Elliott wrote:
> Karl Meerbergen wrote:
> >On Thursday 26 May 2005 16:52, Paul C. Leopardi wrote:
> >>Dear Dan,
> >>Yes, you can use uBLAS to invert matrices, but this might not be the
> >>optimal way to do it. You use UBLAS to invert a matrix by doing solves on
> >>each column of a unit matrix.
> >>GluCat uses the uBLAS routines, originally because Joerg Walter wrote
> >> them specially for GluCat, and then because it was the easiest thing to
> >> do. Best regards
> >
> >In general computing the inverse of a matrix is a very bad idea. It is
> > very expensive and numerically less relible than using a
> > backtransformation.
>
> Perhaps my numerical methods knowledge is not where it should be; i
> typically diagonalize the matrix using LU and then solve. Is
> backtransformation something different/better? Where would I find a
> library to do this?
>
> >For a
> >sparse matrix, I am sure that SuperLU is a lot more efficient than the
> > ublas lu.
>
> Are there SuperLU bindings? What library do you suggest for inverting
> dense matrices? By the way, what is the status of the bindings? Where
> should I get the latest version (they are not an official part of
> BOOST/uBLAS)? Lastly, is it suggested that those of us who are actively
> using uBLAS stay up to date with the unofficial CVS (not the BOOST one)?
>
> >Have a nice day,
>
> Same to you! Thanks to all those actively working on uBLAS! It is great.
>
> - dan
>