Page 1 of 1

Banded matrices, dgbbrd and indexing in clapack

PostPosted: Fri Apr 29, 2005 11:00 am
by janbth
Dear Forum,

I'm trying to do an SVD of a tridiagonal matrix by using first dgbbrd
(bidiagonalization) and then dbdsdc (divide-and-conquer SVD). However,
I'm using clapack and can't get it to work. Probably I haven't done the
indexing correctly. I have tried to look at the comments and code in the
source files, but this is just confusing to me. (Looks like fortran indexing...)

Does anyone have any experience with this, and know how to properly index banded matrices?

Thanks!
Jan

PostPosted: Fri Apr 29, 2005 4:15 pm
by Julie
Jan,

What you try to do is reasonable: an SVD of a tridiagonal matrix by using first dgbbrd
(bidiagonalization) and then dbdsdc (divide-and-conquer SVD)

Let's take a basic tridiagonal Matrix A

2 1 0 0
1 2 1 0
0 1 2 1
0 0 1 2

A should look like this in a array
* 1 1 1
2 2 2 2
1 1 1 *

And like this in memory
index: 0 1 2 3 4 5 6 7 8 9
value: 2 1 1 2 1 1 2 1 1 2

as you noticed, it is column major (ie Fortran)

Hope it helps
Julie

PostPosted: Mon May 02, 2005 7:35 am
by janbth
Julie, thanks! I got it to work now.

I guess the indexing-scheme for this kind of banded matrix needs to be a bit
messy in clapack, because it is C translated from Fortran code. But thanks to your "memory map" I was able to experiment around and find it out.

I think there is a gap in the documentation here, when it comes to indexing
of special matrices, like banded ones. Perhaps the people responsible for
clapack would consider putting this on their todo-list...? :-)

Jan