Boost logo

Ublas :

From: Georg Baum (Georg.Baum_at_[hidden])
Date: 2006-09-15 02:26:20

Am Freitag, 15. September 2006 00:10 schrieb Marco:
> On 9/14/06, Gunter Winkler <guwi17_at_[hidden]> wrote:
> > On Wednesday 13 September 2006 17:20, Marco wrote:
> > > it seems that lapack is returning the transpose of matrices U and VT.
> >
> > I think the reason is that ublas usually uses a row major layout and
> > lapack (read: Fortran) uses always column major layouts.
> Quite disappointing ;-)

Not at all. You can also use column major matrices with ublas:

using namespace boost::numeric::ublas;
typedef matrix<double, column_major> mymatrix;

row major is simply the default if you don't sepcify the template parameter.
I do this all the time because I interface with several fortran libraries
(including lapack), and it works well. The only thing you have to keep in
mind is that you write your own algorithms in column major version, but
that is only for performance reasons.