Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <cblas.h>
- #define m 5
- #define n 4
- #define kl 3
- #define ku 2
- #define lda 8
- double A[] = {
- 0.0, 0.0, 1.0, 2.0,
- 0.0, 1.0, 2.0, 3.0,
- 1.0, 2.0, 3.0, 4.0,
- 2.0, 3.0, 4.0, 5.0,
- 3.0, 4.0, 5.0, 0.0,
- 4.0, 5.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0
- };
- double X[] = {1.0, 2.0, 3.0, 4.0};
- double Y[] = {1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0, 5.0, 0.0};
- int main()
- {
- int i, j;
- cblas_dgbmv(CblasRowMajor, CblasNoTrans, m, n, kl, ku, 2.0, A, lda, X, 1, 10.0, Y, 2);
- //for (i=0; i<3; ++i) printf("%5.1f\n", y[i]);
- for (i=0; i<10; ++i)
- printf("%5.1f ", Y[i]);
- return 0;
- }
Add Comment
Please, Sign In to add comment