2 #include "MEDMEM_SkyLineArray.hxx"
5 #include "LocalTraceCollector.hxx"
6 #endif /* ifdef _DEBUG_*/
9 using namespace MEDMEM;
11 int main (int argc, char ** argv) {
13 LocalTraceCollector::instance();
14 #endif /* ifdef _DEBUG_*/
16 int NumberOfCell = 3 ; // 1 triangle,1 quadrangle,1 triangle
17 int Size = 10 ; // 10 nodes
19 int * index = new int[NumberOfCell+1] ;
24 int * value = new int[Size] ;
37 MEDSKYLINEARRAY * myArray = new MEDSKYLINEARRAY(NumberOfCell,Size,index,value) ;
39 cout << "Show all 1 :" << endl ;
40 for (int i=1; i<NumberOfCell+1 ; i++) {
41 const int * cell = myArray->getI(i) ;
42 int numberof = myArray->getNumberOfI(i) ;
44 for (int j=0;j<numberof;j++)
45 cout << cell[j] << " " ;
48 cout << "Show all 2 :" << endl ;
49 for (int i=1; i<NumberOfCell+1 ; i++) {
51 int numberof = myArray->getNumberOfI(i) ;
52 for (int j=1;j<numberof+1;j++)
53 cout << myArray->getIJ(i,j) << " " ;
57 MEDSKYLINEARRAY * myArray2 = new MEDSKYLINEARRAY(*myArray) ;
60 cout << "Show all 3 :" << endl ;
61 const int * index2 = myArray2->getIndex() ;
62 for (int i=1; i<=NumberOfCell ; i++) {
64 for (int j=index2[i-1];j<index2[i];j++)
65 cout << myArray2->getIndexValue(j) << " " ;