C++ library with matrix inversion?

I know that question is little off-topic here, but I hope there is someone who can answer it. Could you recommend some C++ library for matrix calculation that supports matrix inversion? Blizt++ does not have it, neither boost.ublas. Or I missed it. Ideas? TIA B.

"Bronek Kozicki" <brok@rubikon.pl> wrote in message news:417FEB6F.5030705@rubikon.pl...
I know that question is little off-topic here, but I hope there is someone who can answer it. Could you recommend some C++ library for matrix calculation that supports matrix inversion? Blizt++ does not have it, neither boost.ublas. Or I missed it. Ideas?
Yes... Please :-) regards Andy Little

On Oct 27, 2004, at 2:39 PM, Bronek Kozicki wrote:
I know that question is little off-topic here, but I hope there is someone who can answer it. Could you recommend some C++ library for matrix calculation that supports matrix inversion? Blizt++ does not have it, neither boost.ublas. Or I missed it. Ideas?
It's been a few years since I was doing linear algebra (omg, nearly a decade!), and I'm not familiar with the interface of Blitz++ or boost.ublas, but if the library supports direct factorization of a matrix, I believe you can compute the inverse very efficiently with something like: factor(matrix); vector f = {0}; for (unsigned i = 0; i < ncols; ++i) f[i] = 1; solve(matrix, inverse.col(i), f); f[i] = 0; I.e. you can generate a column of the inverse at a time by solving against a vector with all zero's except for a 1 in the column/row of interest. Indeed, it is because of this relationship that it may not be necessary at all to ever store the entire inverse. The factored original is just as good. -Howard

This might have what you are looking for. The Matrix Template Library. http://www.osl.iu.edu/research/mtl/ Bronek Kozicki wrote:
I know that question is little off-topic here, but I hope there is someone who can answer it. Could you recommend some C++ library for matrix calculation that supports matrix inversion? Blizt++ does not have it, neither boost.ublas. Or I missed it. Ideas?
TIA
B. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Bronek Kozicki wrote:
I know that question is little off-topic here, but I hope there is someone who can answer it. Could you recommend some C++ library for matrix calculation that supports matrix inversion? Blizt++ does not have it, neither boost.ublas. Or I missed it. Ideas?
I don't know of any library - but I have written such a thing for square and non-square matricies many years back - though admittedly in some odd mix of Forth and Lisp - if you're really in need of such a thing, I can dig it up (it would mean searching through many tens of boxes), and then port the code to C++ for you (though it would probably be faster to rewrite the work from scratch). Would that help ?? Cheers, Manfred Doudar MetOcean Engineers

--- Bronek Kozicki <brok@rubikon.pl> wrote:
I know that question is little off-topic here, but I hope there is someone who can answer it. Could you recommend some C++ library for matrix calculation that supports matrix inversion? Blizt++ does not have it, neither boost.ublas. Or I missed it. Ideas?
http://cvs.sourceforge.net/viewcvs.py/cctbx/scitbx/include/scitbx/math/matri... This file has no dependencies other than the STL includes <algorithm> and <vector>. Simply copy the file into your own project. If you are working with 3x3 matrices this may also be interesting: http://cvs.sourceforge.net/viewcvs.py/cctbx/scitbx/include/scitbx/mat3.h?vie... Look for "co_factor_matrix_transposed()" and "inverse()". The mat3.h header file has lots of dependencies, but you could just copy code fragments. License is BSD-style open source, i.e. basically there are no restrictions. __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail

Hi Bronek, I use uBLAS and the LAPACK-bindings from the sandbox . This works quite nice. The inversion itself I do with a SVD: SVD(A): A=U*S*V.t (s is diagonal) Inverse: A.i = V*S.i*U.t Regards, Patrick "Bronek Kozicki" <brok@rubikon.pl> wrote in message news:417FEB6F.5030705@rubikon.pl...
I know that question is little off-topic here, but I hope there is someone who can answer it. Could you recommend some C++ library for matrix calculation that supports matrix inversion? Blizt++ does not have it, neither boost.ublas. Or I missed it. Ideas?
TIA
B. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

http://libcalc.sourceforge.net/ If you're dealing with smaller square matrices and really like boost, I suggest you use the above matrix library. It works exactly as you would want it: #include <math/tiny_matrix.hpp> rmatrix3x3d m ( 1, 0, 0, 0, 1, 0, 0, 0, 1); m = ~m; //invert m David On Wed, 27 Oct 2004 20:39:43 +0200, Bronek Kozicki <brok@rubikon.pl> wrote:
I know that question is little off-topic here, but I hope there is someone who can answer it. Could you recommend some C++ library for matrix calculation that supports matrix inversion? Blizt++ does not have it, neither boost.ublas. Or I missed it. Ideas?
TIA
B. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (8)
-
Andy Little
-
Bronek Kozicki
-
David Sankel
-
Howard Hinnant
-
kjw
-
Manfred Doudar
-
Patrick Kowalzick
-
Ralf W. Grosse-Kunstleve