4 #include "MEDMEM_ModulusArray.hxx"
6 int main (int argc, char ** argv) {
10 int array[5]={0,1,2,1,4} ;
11 MEDMODULUSARRAY modulusArray(5,array);
13 cout<<"ModuloArray :"<<endl;
14 for(int i=-10;i<15;i++)
15 cout <<" - A["<<i<<"]="<<modulusArray[i]<<endl;
21 int array2[5]={1,4,0,1,2} ;
22 MEDMODULUSARRAY modulusArray2(5,array2) ;
23 cout<<"Same arrays, same order ... ";
24 if ((ret=modulusArray2.compare(modulusArray))!=1)
25 cout << "Error : two arrays must be identical !"<<ret<<endl;
29 int array3[5]={1,2,1,0,4} ;
30 MEDMODULUSARRAY modulusArray3(5,array3) ;
31 cout<<"Same arrays, reverse order ... ";
32 if ((ret=modulusArray3.compare(modulusArray))!=-1)
33 cout << "Error : two arrays are in reverse order !"<<ret<<endl;
37 int array4[6]={1,2,1,0} ;
38 MEDMODULUSARRAY modulusArray4(4,array4) ;
39 cout<<"Different arrays size ... ";
40 if ((ret=modulusArray4.compare(modulusArray))!=0)
41 cout << "Error : two arrays have different size !"<<ret<<endl;
45 int array5[5]={1,2,1,0,1} ;
46 MEDMODULUSARRAY modulusArray5(5,array5) ;
47 cout<<"Different array, same size ... ";
48 if ((ret=modulusArray5.compare(modulusArray))!=0)
49 cout << "Error : two arrays are not be identical !"<<ret<<endl;
57 MEDMODULUSARRAY modulusArray6(1,array6);
59 cout<<"ModuloArray 1 :"<<endl;
60 for(int i=-10;i<15;i++)
61 cout <<" - A["<<i<<"]="<<modulusArray6[i]<<endl;
65 MEDMODULUSARRAY modulusArray7(1,array7);
66 cout<<"Same arrays, same order ... ";
67 if ((ret=modulusArray6.compare(modulusArray7))!=1)
68 cout << "Error : two arrays are identical !"<<ret<<endl;
72 MEDMODULUSARRAY modulusArray8(1,array8);
73 cout<<"Different arrays ... ";
74 if ((ret=modulusArray6.compare(modulusArray8))!=0)
75 cout << "Error : two arrays are different !"<<ret<<endl;
81 int array60[2]={1,2} ;
82 MEDMODULUSARRAY modulusArray60(2,array60);
84 cout<<"ModuloArray 2 :"<<endl;
85 for(int i=-10;i<15;i++)
86 cout <<" - A["<<i<<"]="<<modulusArray60[i]<<endl;
89 int array70[2]={1,2} ;
90 MEDMODULUSARRAY modulusArray70(2,array70);
91 cout<<"Same arrays, same order ... ";
92 if ((ret=modulusArray60.compare(modulusArray70))!=1)
93 cout << "Error : two arrays are identical !"<<ret<<endl;
96 int array80[2]={2,2} ;
97 MEDMODULUSARRAY modulusArray80(2,array80);
98 cout<<"Different arrays ... ";
99 if ((ret=modulusArray60.compare(modulusArray80))!=0)
100 cout << "Error : two arrays are different !"<<ret<<endl;
103 int array90[2]={2,1} ;
104 MEDMODULUSARRAY modulusArray90(2,array90);
105 cout<<"Same arrays, reverse order ... ";
106 if ((ret=modulusArray60.compare(modulusArray90))!=-1)
107 cout << "Error : two arrays are in reverse order !"<<ret<<endl;