#include <stdio.h>
#include <stdlib.h>
#include "cblas.h"
Go to the source code of this file.
◆ main()
Definition at line 7 of file cblas_example1.c.
8{
11
15
18
19 m = 4;
21 lda = 4;
22 incx = 1;
23 incy = 1;
26
27 a = (
double *)malloc(
sizeof(
double)*m*
n);
28 x = (
double *)malloc(
sizeof(
double)*
n);
29 y = (
double *)malloc(
sizeof(
double)*
n);
30
31 a[0] = 1;
32 a[1] = 2;
33 a[2] = 3;
34 a[3] = 4;
35
36 a[m] = 1;
37 a[m+1] = 1;
38 a[m+2] = 1;
39 a[m+3] = 1;
40
41 a[m*2] = 3;
42 a[m*2+1] = 4;
43 a[m*2+2] = 5;
44 a[m*2+3] = 6;
45
46 a[m*3] = 5;
47 a[m*3+1] = 6;
48 a[m*3+2] = 7;
49 a[m*3+3] = 8;
50
59
60 cblas_dgemv( Layout, transa, m,
n,
alpha, a, lda,
x, incx, beta,
62
63 for( i = 0; i <
n; i++ )
64 printf(
" y%d = %f\n", i,
y[i]);
65 free(a);
68 return 0;
69}
void cblas_dgemv(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE TransA, const CBLAS_INT M, const CBLAS_INT N, const double alpha, const double *A, const CBLAS_INT lda, const double *X, const CBLAS_INT incX, const double beta, double *Y, const CBLAS_INT incY)
double precision, save, private beta