?? 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 + -