Boost logo

Boost Users :

From: Lorenzo Bolla (bolla_at_[hidden])
Date: 2004-04-08 09:22:16


depending on the shape and sparsity of the matrix you have, there are a
lot of ways you can solve your problem.
simplifying, you can use:
- direct solvers: for example LU decomposition. i think the best library
  to do that is UMFPACK 4.3 if the matrix is sparse and any known LAPACK implementation if it's
  dense: uBlas has bindings for both of them (not included in the
  library - but look for "uBlas bindings" in google...). use direct solvers only if the
  matrix is not too big, because they need a lot of memory.
- iterative solvers: here the choice is much more difficult because
  the "best" algorithm strongly depends on the matrix you have. None of
  them are implemented in uBlas (even if it would be nice to...). to try,
  you can have a look at a very basic implementation of the most common
  iterative algorithms in the IML++ (Iterative Methods Library).

regards,
Lorenzo.

On Thu, Apr 08, 2004 at 02:33:35PM +0100, Russell Hind wrote:
> Angus Leeming wrote:
> >Russell Hind wrote:
> >
> >>Thanks, where are these methods defined? I'm using 1.30.2 and have
> >>searched the ublas directory for files with lu_factorize in and
> >>can't find it.
> >
> >
> >I do not know when these routines arrived, but they are certainly
> >present in boost 1.31. Example usage:
> >
>
> Yep, found lu.hpp in CVS. This is what I think I have
>
> matrix<double> X;
> vector<double> y;
>
> These are known and I have created them.
>
> I'm trying to solve
>
> Xa = y
>
> So should I be doing this? (I'm getting compile errors with bcc so
> can't check anything at the moment).
>
> permutation_matrix<size_t> pm(X.size1());
> lu_factorize(X, pm)
> lu_substitute(X, pm, y);
>
> so on the way out of lu_substitute, y will contain the values for a?
>
> Or am I completely on the wrong track?
>
> If not, is there another way of solving this without using lu_*? the
> initial expression I gave came from re-arranging Xa = y to give it in
> terms of a. I'm currently stuck with 1.30.2 but would like to be able
> to solve this using boost, rather than having to find another library.
>
> Thanks
>
> Russell
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users

-- 
                 CH3
                  |
                  N
                 / \
           N----C   C==O
          ||   ||   |
          ||   ||   |
          CH    C   N--CH3
            \  / \ /
             N    C
             |   ||
            CH3   O

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net