编译
从OpenBlas Home Page 上下载源码,make, make install
使用
level 1 向量-向量 操作
#include <iostream>
#include "cblas.h"
#include <vector>
int main()
{
blasint n = 10;
blasint in_x =1;
blasint in_y =1;
std::vector<double> x(n);
std::vector<double> y(n);
double alpha = 10;
std::fill(x.begin(),x.end(),1.0);
std::fill(y.begin(),y.end(),2.0);
cblas_daxpy( n, alpha, &x[0], in_x, &y[0], in_y);
//Print y
for(int j=0;j<n;j++)
std::cout << y[j] << "\t";
std::cout << std::endl;
}
cblas_daxpy实现了求数乘和