📄 check_blas1pp.cc
字号:
// Testing functions for the BLAS sub-library#include <iostream>//#define LA_COMPLEX_SUPPORT#include <lavd.h>#include <lavc.h>#include <blas1pp.h>//#include <lapackpp/blas3pp.h>using namespace std;// #ifndef __FILE__// # define __FILE__ "unknown"// #endif// #ifndef __LINE__// # define __LINE__ "unknown"// #endif#define check_assert(expr) if (!(expr)) { std::cout << __FILE__ << ": Failed check in line " << __LINE__ << std::endl; error = true; }int main(){ bool error = false; { // Checking Blas_H_Dot_Prod LaVectorComplex a(3),b(3); a=LaComplex(1,0); b=LaComplex(1,0); check_assert(Blas_H_Dot_Prod(a,b) == LaComplex(3.0)); } { // Checking LaVectorDouble::inject LaVectorDouble m,n; m.resize(3,1); m=2.0; n.resize(2,1); n=1.0; m(LaIndex(0,1)).inject(n); check_assert(m(0) == 1.0); check_assert(m(1) == 1.0); check_assert(m(2) == 2.0); } return error ? 1 : 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -