- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page