-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrayTest.cpp
More file actions
executable file
·40 lines (37 loc) · 827 Bytes
/
ArrayTest.cpp
File metadata and controls
executable file
·40 lines (37 loc) · 827 Bytes
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
#include "Array.h"
int main(int argc,char**argv){
/*NDimensionVector<int> M(4,15,3,4,5);
int acc[]={2,0,3,2};
M[acc]=5;
cerr<<M[acc]<<endl;*/
Array<int> a;
a.push_back(12);
a.push_back(3);
Array<int> b;
b.push_back(15);
b.push_back(16);
Array<int> c=a+b*a;
cerr<<c<<endl;
Array< Array<int> > _2D;
_2D.push_back(a);
_2D.push_back(b);
cerr<<_2D<<endl;
Array< Array<int> > _2D2;
_2D2.push_back(b);
_2D2.push_back(a);
cerr<<_2D2<<endl;
cerr<<(_2D+_2D2)<<endl;
cerr<<(_2D+a)<<endl;
//test independence
Array< Array<int> > save2D=_2D;
cerr<<(--_2D)<<endl;
cerr<<(save2D)<<endl;
save2D.append(a);
cerr<<getDimensions(save2D)<<endl;
cerr<<getDimensions(a)<<endl;
Array<Array<Array<int > > > threeD;
threeD.append(_2D);
threeD.append(_2D2);
cerr<<threeD<<endl;
cerr<<getDimensions(threeD)<<endl;
}