Help with cblas_dgbmv

Help with cblas_dgbmv

Hello,

I would really appreciate help with the following problem. I have a matrix B
B =
Matrix: 4 x 4
[ 1 3 0 0
2 6 4 0
0 9 7 5
0 0 10 8 ]
I want to compute:

Bx * scalara + scalarb * y
with x =
x: 4
[ 1 1 1 1 ]

Using dgemv I get with y = 0 and scalara = scalarb = 1:
cblas_dgemv(CblasRowMajor, CblasNoTrans, 4, 4, 1.0, B, 4, x, 1, 1.0, y, 1);
dgemv: 4
[ 4 12 21 18 ]

Now I try band storage: by Band Storage of B looks like this (in Column major):

Column Major: 3 x 4
[ 0 3 4 5
1 6 7 8
2 9 10 0 ]

Using cblas_dgbmv with the same x and y and scalars from above I get:
cblas_dgbmv(CblasColMajor, CblasNoTrans, 3, 4, 1, 1, 1.0, bandB,
3, x, 1, 1.0, y, 1)
dgbmv (Fortran storage)): 4
[ 4 12 21 0 ]

How do I get the 18 into the last element? Also how can I do this in row major? I tried the suggestion in the cblas document from netlib, but it didn't work at all.

Cheers,

Paul

1 contenuto / 0 nuovi
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione