1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
#include "testsuite.h"
#include <blitz/array.h>
using namespace blitz;
int main()
{
Array<int,2> A(3,4), B(3,4);
A = 0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11;
B = 3, 2, 1, 0,
7, 6, 5, 4,
11, 10, 9, 8;
A.reverseSelf(secondDim);
BZTEST(count(A==B) == 12);
A.reverseSelf(secondDim);
B = 0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11;
BZTEST(count(A==B) == 12);
A.reverseSelf(firstDim);
B = 8, 9, 10, 11,
4, 5, 6, 7,
0, 1, 2, 3;
BZTEST(count(A==B) == 12);
A.reverseSelf(secondDim);
B = 11, 10, 9, 8,
7, 6, 5, 4,
3, 2, 1, 0;
BZTEST(count(A==B) == 12);
Array<int,2> E(3,4);
E = 0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11;
Array<int,2> C = E(Range(1,2),Range(2,3));
Array<int,2> D(2,2);
D = 6, 7,
10, 11;
BZTEST(count(C==D) == 4);
C.reverseSelf(firstDim);
D = 10, 11,
6, 7;
BZTEST(count(C==D) == 4);
C.reverseSelf(firstDim);
D = 6, 7,
10, 11;
BZTEST(count(C==D) == 4);
C.reverseSelf(secondDim);
D = 7, 6,
11, 10;
BZTEST(count(C==D) == 4);
C.reverseSelf(firstDim);
D = 11, 10,
7, 6;
BZTEST(count(C==D) == 4);
return 0;
}
|