3 #include "MEDMEM_SkyLineArray.hxx"
4 using namespace MEDMEM;
6 int main (int argc, char ** argv) {
8 int NumberOfCell = 3 ; // 1 triangle,1 quadrangle,1 triangle
9 int Size = 10 ; // 10 nodes
11 int * index = new int[NumberOfCell+1] ;
16 int * value = new int[Size] ;
29 MEDSKYLINEARRAY * myArray = new MEDSKYLINEARRAY(NumberOfCell,Size,index,value) ;
31 cout << "Show all 1 :" << endl ;
32 for (int i=1; i<NumberOfCell+1 ; i++) {
33 const int * cell = myArray->getI(i) ;
34 int numberof = myArray->getNumberOfI(i) ;
36 for (int j=0;j<numberof;j++)
37 cout << cell[j] << " " ;
40 cout << "Show all 2 :" << endl ;
41 for (int i=1; i<NumberOfCell+1 ; i++) {
43 int numberof = myArray->getNumberOfI(i) ;
44 for (int j=1;j<numberof+1;j++)
45 cout << myArray->getIJ(i,j) << " " ;
49 MEDSKYLINEARRAY * myArray2 = new MEDSKYLINEARRAY(*myArray) ;
52 cout << "Show all 3 :" << endl ;
53 const int * index2 = myArray2->getIndex() ;
54 for (int i=1; i<=NumberOfCell ; i++) {
56 for (int j=index2[i-1];j<index2[i];j++)
57 cout << myArray2->getIndexValue(j) << " " ;