Dear Newsgroup, I'm new in the field of numeric computing and I would like to learn more about it. To solve my problem I need to invert a matix and use the intermediate result as the input for following calculations. I browsed the uBLAS library and played a little bit with it but I didn't find a routine for matrix inversion. Is there any possibility to preform it in a single step? Is this package the wrong tool for doing this and I should use LAPACK++ or similar stuff? Thanks in advance, Thomas -- Thomas Reisinger Braunschweig Germany mailto:t.reisinger@tu-bs.de
Dear Newsgroup,
I'm new in the field of numeric computing and I would like to learn more about it. To solve my problem I need to invert a matix and use the intermediate result as the input for following calculations.
I browsed the uBLAS library and played a little bit with it but I didn't find a routine for matrix inversion. Is there any possibility to
--- In Boost-Users@yahoogroups.com, Thomas Reisinger
it in a single step? Is this package the wrong tool for doing this and I should use LAPACK++ or similar stuff?
Thanks in advance, Thomas
-- Thomas Reisinger Braunschweig Germany mailto:t.reisinger@t...
Hello Thomas, A couple of months ago I had the exact same query. Unfortunatly, uBLAS does not perform matrix inversion. There are essentially two options for you. #1: I have found a couple of matrix libraries that are not of the same level of quality as uBLAS but suit ones needs to a reasonable degree. You can find these through google, just type in C++ matrix or something to that effect and you will find many of them. #2: Obtain "Numerical Recipies in C++." This book is the C++ version of the very popular Numerical Recipies in C book, and details a lot of frequently used scientific algorithms. You would then of course have to implement these ideas. Best of luck in your efforts. Jon Agiato JonAgiato@nyc.rr.com
Hello Thomas, A couple of months ago I had the exact same query. Unfortunatly, uBLAS does not perform matrix inversion. There are essentially two options for you. #1: I have found a couple of matrix libraries that are not of the same level of quality as uBLAS but suit ones needs to a reasonable degree. You can find these through google, just type in C++ matrix or something to that effect and you will find many of them. #2: Obtain "Numerical Recipies in C++." This book is the C++ version of the very popular Numerical Recipies in C book, and details a lot of frequently used scientific algorithms. You would then of course have to implement these ideas.
I am just in the course of learning UBLAS. But I've seen the 'solve' functions. I expect it should be possible to do matrix inversion with these. Matrix inversion is nothing more than solving for a matrix of 'right hand' vectors. Normally you don't really need to invert a matrix at a whole since for practical purposes it is much faster to save the decomposed (L-R) parts and then backsupstitute (solve) for each right hand vector. So I think this is reflected in UBLAS. But I also would like to see a small example program of how to do this with UBLAS. Good luck, Roland
Thomas Reisinger wrote:
I'm new in the field of numeric computing and I would like to learn more about it. To solve my problem I need to invert a matix and use the intermediate result as the input for following calculations.
I browsed the uBLAS library and played a little bit with it but I didn't find a routine for matrix inversion.
As Jon Agiato already replied, uBLAS doesn't have matrix inversion. uBLAS is, more or less, BLAS, that is, it provides elementary vector and matrix operation (scaling, addition, multiplication etc.). One day we will hopefully have uLAPACK -- solution of linear systems, matrix inversion, eigenvalues & eigenvectors... (Roland aka speedsnaii mentioned uBLAS's solve() functions in his reply. But those functions are `triangular' solvers, i.e. matrix A must be triangular -- corresponding BLAS trsm() functions are used in LAPACK for `backward' substitutions after LU or Cholesky factorizations.)
Is there any possibility to preform it in a single step? Is this package the wrong tool for doing this and I should use LAPACK++ or similar stuff?
From LAPACK++ home page:
``[NOTE: This package is being superseded by the Template Numerical
Toolkit (TNT), which utilizes new features of the ANSI C++ specification.
TNT is a newer design, and will integrate the functionlaity of Lapack++,
IML++, SparseLib++, and MV++.]''
(TNT home page is: http://math.nist.gov/tnt/)
But I'd recommend the `bindings' library (as one of the co-authors
I am, of course, biased ;o) which *can be used with uBLAS
vectors and matrices*. Idea is similar to the LAPACK++, that is,
library provides interfaces to other, well-known numerical
libraries (written in Fortran or C).
For example, for matrix inversion you can use ATLAS
bindings:
=========================================
#include
participants (4)
-
agiatojon <JonAgiato@nyc.rr.com>
-
Kresimir Fresl
-
speedsnaii <speedsnaii@yahoo.de>
-
Thomas Reisinger