Boost logo

Ublas :

From: Kresimir Fresl (fresl_at_[hidden])
Date: 2008-02-04 01:59:36


Arun Tom Abraham wrote:

> however, what does one need to do if the "b" in the equation Ax = b is
> a general matrix .
>
> I think the lapack sgesv does allow one to enter a matrix in general .

Yes, it does.

ublas::matrix<float, ublas::column_major> A (n, n); // system matrix
ublas::matrix<float, ublas::column_major> b (n, nrhs);
          // right-hand side matrix
          // nrhs - number of right-hand side vectors

lapack::gesv (A, b);

I think that in your first post (dated 2/2/08) problem was that you
didn't specify that matrices are column_major:

ublas::matrix<float> A(3,3);
ublas::matrix<float> b(3,1);

Hope this helps,

fres