3 #include "MEDMEM_SkyLineArray.hxx"
5 int main (int argc, char ** argv) {
7 int NumberOfCell = 3 ; // 1 triangle,1 quadrangle,1 triangle
8 int Size = 10 ; // 10 nodes
10 int * index = new int[NumberOfCell+1] ;
15 int * value = new int[Size] ;
28 MEDSKYLINEARRAY * myArray = new MEDSKYLINEARRAY(NumberOfCell,Size,index,value) ;
30 cout << "Show all 1 :" << endl ;
31 for (int i=1; i<NumberOfCell+1 ; i++) {
32 const int * cell = myArray->getI(i) ;
33 int numberof = myArray->getNumberOfI(i) ;
35 for (int j=0;j<numberof;j++)
36 cout << cell[j] << " " ;
39 cout << "Show all 2 :" << endl ;
40 for (int i=1; i<NumberOfCell+1 ; i++) {
42 int numberof = myArray->getNumberOfI(i) ;
43 for (int j=1;j<numberof+1;j++)
44 cout << myArray->getIJ(i,j) << " " ;
48 MEDSKYLINEARRAY * myArray2 = new MEDSKYLINEARRAY(*myArray) ;
51 cout << "Show all 3 :" << endl ;
52 const int * index2 = myArray2->getIndex() ;
53 for (int i=1; i<=NumberOfCell ; i++) {
55 for (int j=index2[i-1];j<index2[i];j++)
56 cout << myArray2->getIndexValue(j) << " " ;