1 # ifndef __MEDSKYLINEARRAY_H__
2 # define __MEDSKYLINEARRAY_H__
4 #include "MEDMEM_Exception.hxx"
6 #include "MEDMEM_define.hxx"
8 using MED_EN::med_int ;
15 med_int * _index ; // array of size _count+1 : _index[0]=1 and
16 // _index[_count]=length+1
17 med_int * _value ; // array of size _length
22 MEDSKYLINEARRAY( const MEDSKYLINEARRAY &myArray );
23 MEDSKYLINEARRAY( const med_int count , const med_int length );
25 void setMEDSKYLINEARRAY( const med_int count, const med_int length, med_int* index , med_int* value ) ;
27 inline med_int getNumberOf() const;
28 inline med_int getLength() const;
29 inline med_int* getIndex() const;
30 inline med_int* getValue() const;
31 inline med_int getNumberOfI(int i) const throw (MEDEXCEPTION) ;
32 inline med_int* getI(int i) const throw (MEDEXCEPTION) ;
33 inline med_int getIJ(int i, int j) const throw (MEDEXCEPTION) ;
37 // ---------------------------------------
39 // ---------------------------------------
40 inline med_int MEDSKYLINEARRAY::getNumberOf() const
44 inline med_int MEDSKYLINEARRAY::getLength() const
48 inline med_int* MEDSKYLINEARRAY::getIndex() const
52 inline med_int* MEDSKYLINEARRAY::getValue() const
56 inline med_int MEDSKYLINEARRAY::getNumberOfI(int i) const throw (MEDEXCEPTION)
59 throw MEDEXCEPTION("MEDSKYLINEARRAY::getNumberOfI : argument must be >= 1");
61 throw MEDEXCEPTION("MEDSKYLINEARRAY::getNumberOfI : argument is out of range");
62 return _index[i]-_index[i-1] ;
64 inline med_int* MEDSKYLINEARRAY::getI(int i) const throw (MEDEXCEPTION)
67 throw MEDEXCEPTION("MEDSKYLINEARRAY::getI : argument must be >= 1");
69 throw MEDEXCEPTION("MEDSKYLINEARRAY::getI : argument is out of range");
70 return _value+_index[i-1]-1 ;
72 inline med_int MEDSKYLINEARRAY::getIJ(int i, int j) const throw (MEDEXCEPTION)
75 throw MEDEXCEPTION("MEDSKYLINEARRAY::getIJ : first argument must be >= 1");
77 throw MEDEXCEPTION("MEDSKYLINEARRAY::getIJ : second argument must be >= 1");
79 throw MEDEXCEPTION("MEDSKYLINEARRAY::getIJ : first argument is out of range") ;
81 throw MEDEXCEPTION("MEDSKYLINEARRAY::getIJ : second argument is out of range") ;
82 return _value[_index[i-1]+j-2] ;