📄 neg_stride.cc
字号:
#include <iostream>#include <mtl/strided1D.h>#include <mtl/light1D.h>#include <mtl/mtl.h>intmain(){ using namespace mtl; double dx[20], dy[20]; for (int i = 0; i < 20; ++i) { if (i % 2 == 0) { dx[i] = i; dy[i] = 2*i; } else { dx[i] = 0; dy[i] = 0; } } light1D<double> x(dx, 20); strided1D< light1D<double> > sx(x, -2); light1D<double> y(dy, 20); strided1D< light1D<double> > sy(y, -2); if (dot(sx, sy) == dot(x, y)) std::cout << "success" << std::endl; else std::cout << "failure" << std::endl; return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -