Boost logo

Ublas :

Subject: [ublas] [bindinds] Problem with lapack::gbtrf
From: Marco Guazzone (marco.guazzone_at_[hidden])
Date: 2010-07-25 11:11:22


Dear all,

I need to use lapack::gbtrf (LUP decomposition for banded matrices)
but I have problems in using it.
My starting point is a ublas::banded_matrix (say A), on which I want
to apply GBTRF.

The attachment contains some representative tests. Here a brief summary:
* test_ok: works.
   In this test
   1. I directly convert the input matrix A into a vectorized matrix
AB (with column-major representation)
   2. Set the remaining parameters, and
   3. Finally directly call lapack::detail::gbtrf using AB as input
matrix (note the "detail" namespace)

* test_ko_1: fails to compute the right decomposition.
   In this test:
   1. I copy the input matrix A into a dense matrix (say aux_AB)
   2. Then I wrap this dense_matrix into a ublas::band_adaptor matrix, and
   3. Finally call lapack::gbtrf

* test_ko_2: fails to compile
   In this test:
   1. I copy the input matrix A into a dense matrix AB with the
representation explained in the GBTRF doc
           http://www.intel.com/software/products/mkl/docs/webhelp/lle/functn_gbtrf.html
       [note: the reason to link to the Intel MKL site is that
actually the netlib.org site appears down]
   3. Finally call lapack::gbtrf using AB as input matrix

* test_ko_3: fails to compute the right decomposition
   In this test:
   1. I copy the input matrix A into a dense matrix aux_AB with the
representation explained in the GBTRF doc (same as test_ko_2)
   2. Then I wrap this dense_matrix aux_AB into a ublas::band_adaptor
matrix AB (even it is not really a banded matrix), and
   3. Finally call lapack::gbtrf using AB as input matrix

So, apart test_ko_1 (which use function of detail namespace and hence
I suppose it should be discouraged), I'm unable to successfully use
GBTRF.

Please, can you help me?

Thank you in advance!!

PS: I've compiled with:
  g++ -Wall -ansi -pedantic -I /tmp/boost-numeric_bindings -lm
-llapack -o lapack_gbtrf lapack_gbtrf.cpp

Cheers,

-- Marco