1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/
20 #include "MEDMEM_SkyLineArray.hxx"
23 using namespace MEDMEM;
25 int main (int argc, char ** argv) {
26 int NumberOfCell = 3 ; // 1 triangle,1 quadrangle,1 triangle
27 int Size = 10 ; // 10 nodes
29 int * index = new int[NumberOfCell+1] ;
34 int * value = new int[Size] ;
47 MEDSKYLINEARRAY * myArray = new MEDSKYLINEARRAY(NumberOfCell,Size,index,value) ;
49 cout << "Show all 1 :" << endl ;
50 for (int i=1; i<NumberOfCell+1 ; i++) {
51 const int * cell = myArray->getI(i) ;
52 int numberof = myArray->getNumberOfI(i) ;
54 for (int j=0;j<numberof;j++)
55 cout << cell[j] << " " ;
58 cout << "Show all 2 :" << endl ;
59 for (int i=1; i<NumberOfCell+1 ; i++) {
61 int numberof = myArray->getNumberOfI(i) ;
62 for (int j=1;j<numberof+1;j++)
63 cout << myArray->getIJ(i,j) << " " ;
67 MEDSKYLINEARRAY * myArray2 = new MEDSKYLINEARRAY(*myArray) ;
70 cout << "Show all 3 :" << endl ;
71 const int * index2 = myArray2->getIndex() ;
72 for (int i=1; i<=NumberOfCell ; i++) {
74 for (int j=index2[i-1];j<index2[i];j++)
75 cout << myArray2->getIndexValue(j) << " " ;