Boost logo

Ublas :

Subject: Re: [ublas] [bindinds] Problem with lapack::gbtrf
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2010-07-25 18:37:00


Marco Guazzone wrote:
> Please, can you help me?

Right now, the best thing to find out how to use lapack::gbtrf is to look at libs/numeric/bindings/lapack/test/ublas_gbsv.cpp.

I already see two significant differences just looking at the line where the banded matirx is defined. ublas_gbsv.cpp writes

ublas::banded_matrix<T> a(sz, sz, kl, kl+ku);

while your example code writes

typedef ublas::banded_matrix<value_type, ublas::column_major> matrix_type;
...
matrix_type A(nr,nc,l,u);

So the first thing to learn is that "ublas::column_major" is not right in case of a banded matrix. The second thing is that "kl+ku" (or "l+u") must be written instead of "ku" (or "u"), because the pivoting used during the factorization slightly enlarges the bandwidth of the matrix.

Regards,
Thomas