📄 contiguous.cpp
字号:
#include "testsuite.h"#include <blitz/array.h>BZ_USING_NAMESPACE(blitz)int main(){ { Array<int, 2> A(7,11); BZTEST(A.isStorageContiguous()); BZTEST(!(A(Range(fromStart, toEnd, 2), Range::all())).isStorageContiguous()); BZTEST(A.reverse(firstDim).isStorageContiguous()); BZTEST(A.reverse(secondDim).isStorageContiguous()); BZTEST(!A(Range::all(), 4).isStorageContiguous()); BZTEST(A(4, Range::all()).isStorageContiguous()); } { Array<int, 2> A(7,11,fortranArray); BZTEST(A.isStorageContiguous()); BZTEST(!(A(Range(fromStart, toEnd, 2), Range::all())).isStorageContiguous()); BZTEST(A.reverse(firstDim).isStorageContiguous()); BZTEST(A.reverse(secondDim).isStorageContiguous()); BZTEST(A(Range::all(), 4).isStorageContiguous()); BZTEST(!A(4, Range::all()).isStorageContiguous()); } { Array<int, 2> A(Range(-4,8),Range(4,27)); BZTEST(A.isStorageContiguous()); BZTEST(!(A(Range(fromStart, toEnd, 2), Range::all())).isStorageContiguous()); BZTEST(A.reverse(firstDim).isStorageContiguous()); BZTEST(A.reverse(secondDim).isStorageContiguous()); BZTEST(!A(Range::all(), 4).isStorageContiguous()); BZTEST(A(4, Range::all()).isStorageContiguous()); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -