Version: 5.1.6

ParaMEDMEM.DataArrayInt Class Reference

#include <MEDCouplingMemArray.hxx>

Inheritance diagram for ParaMEDMEM.DataArrayInt:
Inheritance graph

Public Member Functions

bool isAllocated () const
void checkAllocated () const throw (INTERP_KERNEL::Exception)
DataArrayIntdeepCpy () const
DataArrayIntperformCpy (bool deepCpy) const
void cpyFrom (const DataArrayInt &other) throw (INTERP_KERNEL::Exception)
void alloc (int nbOfTuple, int nbOfCompo)
void allocIfNecessary (int nbOfTuple, int nbOfCompo)
bool isEqual (const DataArrayInt &other) const
bool isEqualWithoutConsideringStr (const DataArrayInt &other) const
bool isEqualWithoutConsideringStrAndOrder (const DataArrayInt &other) const throw (INTERP_KERNEL::Exception)
DataArrayIntbuildPermutationArr (const DataArrayInt &other) const throw (INTERP_KERNEL::Exception)
void sort () throw (INTERP_KERNEL::Exception)
void fillWithZero ()
void fillWithValue (int val)
void iota (int init=0) throw (INTERP_KERNEL::Exception)
std::string repr () const
std::string reprZip () const
void reprStream (std::ostream &stream) const
void reprZipStream (std::ostream &stream) const
void reprWithoutNameStream (std::ostream &stream) const
void reprZipWithoutNameStream (std::ostream &stream) const
void transformWithIndArr (const int *indArrBg, const int *indArrEnd) throw (INTERP_KERNEL::Exception)
DataArrayInttransformWithIndArrR (const int *indArrBg, const int *indArrEnd) const throw (INTERP_KERNEL::Exception)
void splitByValueRange (const int *arrBg, const int *arrEnd, DataArrayInt *&castArr, DataArrayInt *&rankInsideCast, DataArrayInt *&castsPresent) const throw (INTERP_KERNEL::Exception)
DataArrayIntinvertArrayO2N2N2O (int newNbOfElem) const
DataArrayIntinvertArrayN2O2O2N (int oldNbOfElem) const
void reAlloc (int nbOfTuples) throw (INTERP_KERNEL::Exception)
 alloc or useArray should have been called before.
DataArrayDoubleconvertToDblArr () const
DataArrayIntfromNoInterlace () const throw (INTERP_KERNEL::Exception)
DataArrayInttoNoInterlace () const throw (INTERP_KERNEL::Exception)
void renumberInPlace (const int *old2New)
void renumberInPlaceR (const int *new2Old)
DataArrayIntrenumber (const int *old2New) const
DataArrayIntrenumberR (const int *new2Old) const
DataArrayIntrenumberAndReduce (const int *old2NewBg, int newNbOfTuple) const
DataArrayIntselectByTupleId (const int *new2OldBg, const int *new2OldEnd) const
DataArrayIntselectByTupleIdSafe (const int *new2OldBg, const int *new2OldEnd) const throw (INTERP_KERNEL::Exception)
DataArrayIntselectByTupleId2 (int bg, int end, int step) const throw (INTERP_KERNEL::Exception)
DataArrayIntcheckAndPreparePermutation () const throw (INTERP_KERNEL::Exception)
void changeSurjectiveFormat (int targetNb, DataArrayInt *&arr, DataArrayInt *&arrI) const throw (INTERP_KERNEL::Exception)
DataArrayIntbuildPermArrPerLevel () const throw (INTERP_KERNEL::Exception)
bool isIdentity () const
bool isUniform (int val) const
DataArrayIntsubstr (int tupleIdBg, int tupleIdEnd=-1) const throw (INTERP_KERNEL::Exception)
void rearrange (int newNbOfCompo) throw (INTERP_KERNEL::Exception)
DataArrayIntchangeNbOfComponents (int newNbOfComp, int dftValue) const throw (INTERP_KERNEL::Exception)
DataArrayIntkeepSelectedComponents (const std::vector< int > &compoIds) const throw (INTERP_KERNEL::Exception)
void meldWith (const DataArrayInt *other) throw (INTERP_KERNEL::Exception)
void setSelectedComponents (const DataArrayInt *a, const std::vector< int > &compoIds) throw (INTERP_KERNEL::Exception)
void setPartOfValues1 (const DataArrayInt *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw (INTERP_KERNEL::Exception)
void setPartOfValuesSimple1 (int a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp) throw (INTERP_KERNEL::Exception)
void setPartOfValues2 (const DataArrayInt *a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp, bool strictCompoCompare=true) throw (INTERP_KERNEL::Exception)
void setPartOfValuesSimple2 (int a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp) throw (INTERP_KERNEL::Exception)
void setPartOfValues3 (const DataArrayInt *a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true) throw (INTERP_KERNEL::Exception)
void setPartOfValuesSimple3 (int a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp) throw (INTERP_KERNEL::Exception)
void getTuple (int tupleId, int *res) const
int getIJ (int tupleId, int compoId) const
void setIJ (int tupleId, int compoId, int newVal)
void setIJSilent (int tupleId, int compoId, int newVal)
intgetPointer ()
const intgetConstPointer () const
DataArrayIntgetIdsEqual (int val) const throw (INTERP_KERNEL::Exception)
DataArrayIntgetIdsNotEqual (int val) const throw (INTERP_KERNEL::Exception)
DataArrayIntgetIdsEqualList (const std::vector< int > &vals) const throw (INTERP_KERNEL::Exception)
DataArrayIntgetIdsNotEqualList (const std::vector< int > &vals) const throw (INTERP_KERNEL::Exception)
bool presenceOfValue (const std::vector< int > &vals) const throw (INTERP_KERNEL::Exception)
int getMaxValue (int &tupleId) const throw (INTERP_KERNEL::Exception)
int getMinValue (int &tupleId) const throw (INTERP_KERNEL::Exception)
void applyLin (int a, int b, int compoId) throw (INTERP_KERNEL::Exception)
void applyLin (int a, int b) throw (INTERP_KERNEL::Exception)
void applyInv (int numerator) throw (INTERP_KERNEL::Exception)
void applyDivideBy (int val) throw (INTERP_KERNEL::Exception)
void applyModulus (int val) throw (INTERP_KERNEL::Exception)
void applyRModulus (int val) throw (INTERP_KERNEL::Exception)
DataArrayIntbuildComplement (int nbOfElement) const throw (INTERP_KERNEL::Exception)
DataArrayIntbuildSubstraction (const DataArrayInt *other) const throw (INTERP_KERNEL::Exception)
DataArrayIntbuildUnion (const DataArrayInt *other) const throw (INTERP_KERNEL::Exception)
DataArrayIntbuildIntersection (const DataArrayInt *other) const throw (INTERP_KERNEL::Exception)
DataArrayIntdeltaShiftIndex () const throw (INTERP_KERNEL::Exception)
void computeOffsets () throw (INTERP_KERNEL::Exception)
void computeOffsets2 () throw (INTERP_KERNEL::Exception)
DataArrayIntbuildExplicitArrByRanges (const DataArrayInt *offsets) const throw (INTERP_KERNEL::Exception)
std::set< intgetDifferentValues () const throw (INTERP_KERNEL::Exception)
void useArray (const int *array, bool ownership, DeallocType type, int nbOfTuple, int nbOfCompo)
void writeOnPlace (int id, int element0, const int *others, int sizeOfOthers)
void addEqual (const DataArrayInt *other) throw (INTERP_KERNEL::Exception)
void substractEqual (const DataArrayInt *other) throw (INTERP_KERNEL::Exception)
void multiplyEqual (const DataArrayInt *other) throw (INTERP_KERNEL::Exception)
void divideEqual (const DataArrayInt *other) throw (INTERP_KERNEL::Exception)
void modulusEqual (const DataArrayInt *other) throw (INTERP_KERNEL::Exception)
void updateTime () const
 nothing to do here because this class does not aggregate any TimeLabel instance.
void getTinySerializationIntInformation (std::vector< int > &tinyInfo) const
void getTinySerializationStrInformation (std::vector< std::string > &tinyInfo) const
bool resizeForUnserialization (const std::vector< int > &tinyInfoI)
void finishUnserialization (const std::vector< int > &tinyInfoI, const std::vector< std::string > &tinyInfoS)
 DataArrayInt ()

Static Public Member Functions

static DataArrayIntNew ()
static void SetArrayIn (DataArrayInt *newArray, DataArrayInt *&arrayToSet)
static DataArrayIntAggregate (const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2)
static DataArrayIntAggregate (const std::vector< const DataArrayInt * > &a) throw (INTERP_KERNEL::Exception)
static DataArrayIntMeld (const DataArrayInt *a1, const DataArrayInt *a2) throw (INTERP_KERNEL::Exception)
static DataArrayIntMeld (const std::vector< const DataArrayInt * > &a) throw (INTERP_KERNEL::Exception)
static DataArrayIntMakePartition (const std::vector< const DataArrayInt * > &groups, int newNb, std::vector< std::vector< int > > &fidsOfGroups)
static DataArrayIntBuildUnion (const std::vector< const DataArrayInt * > &a) throw (INTERP_KERNEL::Exception)
static DataArrayIntBuildIntersection (const std::vector< const DataArrayInt * > &a) throw (INTERP_KERNEL::Exception)
static DataArrayIntAdd (const DataArrayInt *a1, const DataArrayInt *a2) throw (INTERP_KERNEL::Exception)
static DataArrayIntSubstract (const DataArrayInt *a1, const DataArrayInt *a2) throw (INTERP_KERNEL::Exception)
static DataArrayIntMultiply (const DataArrayInt *a1, const DataArrayInt *a2) throw (INTERP_KERNEL::Exception)
static DataArrayIntDivide (const DataArrayInt *a1, const DataArrayInt *a2) throw (INTERP_KERNEL::Exception)
static DataArrayIntModulus (const DataArrayInt *a1, const DataArrayInt *a2) throw (INTERP_KERNEL::Exception)
static intCheckAndPreparePermutation (const int *start, const int *end)

Data Fields

MemArray< int_mem

Constructor & Destructor Documentation

ParaMEDMEM.DataArrayInt.DataArrayInt (  ) 

Member Function Documentation

DataArrayInt * DataArrayInt::New (  )  [static]
bool DataArrayInt::isAllocated (  )  const
void DataArrayInt::checkAllocated (  )  const throw (INTERP_KERNEL::Exception)
DataArrayInt * DataArrayInt::deepCpy (  )  const
DataArrayInt * DataArrayInt::performCpy ( bool  deepCpy  )  const
void DataArrayInt::cpyFrom ( const DataArrayInt other  )  throw (INTERP_KERNEL::Exception)
void DataArrayInt::alloc ( int  nbOfTuple,
int  nbOfCompo 
)
void DataArrayInt::allocIfNecessary ( int  nbOfTuple,
int  nbOfCompo 
)
bool DataArrayInt::isEqual ( const DataArrayInt other  )  const
bool DataArrayInt::isEqualWithoutConsideringStr ( const DataArrayInt other  )  const
bool DataArrayInt::isEqualWithoutConsideringStrAndOrder ( const DataArrayInt other  )  const throw (INTERP_KERNEL::Exception)
DataArrayInt * DataArrayInt::buildPermutationArr ( const DataArrayInt other  )  const throw (INTERP_KERNEL::Exception)

This method expects that 'this' and 'other' have the same number of tuples and exactly one component both. If not an exception will be thrown. This method retrieves a newly created array with same number of tuples than 'this' and 'other' with one component. The returned array 'ret' contains the correspondance from 'this' to 'other' that is to say for every i so that 0<=i<getNumberOfTuples() other.getIJ(i,0)==this->getIJ(ret->getIJ(i),0) If such permutation is not possible because it exists some elements in 'other' not in 'this', an exception will be thrown.

References Med_Gen_test.it, ParaMEDMEM.DataArrayInt.New(), and testMEDMEM.ret.

void DataArrayInt::sort (  )  throw (INTERP_KERNEL::Exception)
void DataArrayInt::fillWithZero (  ) 
void DataArrayInt::fillWithValue ( int  val  ) 
void DataArrayInt::iota ( int  init = 0  )  throw (INTERP_KERNEL::Exception)

References init.

std::string DataArrayInt::repr (  )  const
std::string DataArrayInt::reprZip (  )  const
void DataArrayInt::reprStream ( std::ostream &  stream  )  const
void DataArrayInt::reprZipStream ( std::ostream &  stream  )  const
void DataArrayInt::reprWithoutNameStream ( std::ostream &  stream  )  const
void DataArrayInt::reprZipWithoutNameStream ( std::ostream &  stream  )  const
void DataArrayInt::transformWithIndArr ( const int indArrBg,
const int indArrEnd 
) throw (INTERP_KERNEL::Exception)
DataArrayInt * DataArrayInt::transformWithIndArrR ( const int indArrBg,
const int indArrEnd 
) const throw (INTERP_KERNEL::Exception)
void DataArrayInt::splitByValueRange ( const int arrBg,
const int arrEnd,
DataArrayInt *&  castArr,
DataArrayInt *&  rankInsideCast,
DataArrayInt *&  castsPresent 
) const throw (INTERP_KERNEL::Exception)

'this' should be allocated and with numberOfComponents set to one. If not an exception will be thrown. This method takes as input an array defined by ['arrBg','arrEnd'). The size of the array (std.distance(arrBg,arrEnd)) is equal to the number of cast + 1. The values contained in ['arrBg','arrEnd') should be sorted ascendently. No check of this will be done. If not the result is not waranted. For each cast j the value range that defines the cast is equal to [arrBg[j],arrBg[j+1]). This method returns three arrays (to be managed by the caller). This method is typically usefull for entity number spliting by types for example. Example : If 'this' contains [6,5,0,3,2,7,8,1,4] and if ['arrBg','arrEnd') contains [0,4,9] then the output of this method will be :

  • 'castArr' : [1,1,0,0,0,1,1,0,1]
  • 'rankInsideCast' : [2,1,0,3,2,3,4,1,0]
  • 'return' : [0,1]
Parameters:
castArr is a returned param has the same number of tuples than 'this' and number of components set to one. In case of sucess, this param contains for each tuple in 'this' in which cast it holds.
rankInsideCast is an another returned param has the same number of tuples than 'this' and number of components set to one too. In case of sucess, this param contains for each tuple its rank inside its cast.
castsPresent the casts that 'this' contains.
Exceptions:
if a value in 'this' is greater or equal to the last value of ['arrBg','arrEnd')

References med_test1.end, and ParaMEDMEM.DataArrayInt.New().

DataArrayInt * DataArrayInt::invertArrayO2N2N2O ( int  newNbOfElem  )  const

This method invert array 'di' that is a conversion map from Old to New numbering to New to Old numbering.

References ParaMEDMEM.DataArrayInt.alloc(), ParaMEDMEM.DataArrayInt.getConstPointer(), ParaMEDMEM.DataArray.getNumberOfTuples(), ParaMEDMEM.DataArrayInt.getPointer(), ParaMEDMEM.DataArrayInt.New(), and testMEDMEM.ret.

DataArrayInt * DataArrayInt::invertArrayN2O2O2N ( int  oldNbOfElem  )  const

This method invert array 'di' that is a conversion map from New to old numbering to Old to New numbering.

References ParaMEDMEM.DataArrayInt.alloc(), MEDMEM.fill(), ParaMEDMEM.DataArrayInt.getConstPointer(), ParaMEDMEM.DataArray.getNumberOfTuples(), ParaMEDMEM.DataArrayInt.getPointer(), ParaMEDMEM.DataArrayInt.New(), and testMEDMEM.ret.

void DataArrayInt::reAlloc ( int  nbOfTuples  )  throw (INTERP_KERNEL::Exception)

alloc or useArray should have been called before.

DataArrayDouble * DataArrayInt::convertToDblArr (  )  const
DataArrayInt * DataArrayInt::fromNoInterlace (  )  const throw (INTERP_KERNEL::Exception)
DataArrayInt * DataArrayInt::toNoInterlace (  )  const throw (INTERP_KERNEL::Exception)
void DataArrayInt::renumberInPlace ( const int old2New  ) 
void DataArrayInt::renumberInPlaceR ( const int new2Old  ) 
DataArrayInt * DataArrayInt::renumber ( const int old2New  )  const

This method expects that 'this' is allocated, if not an exception is thrown. This method in case of success returns a newly created array the user should deal with. In the case of having a renumber array in "old to new" format. More info on renumbering here.

References ParaMEDMEM.DataArrayInt.alloc(), ParaMEDMEM.DataArray.copyStringInfoFrom(), ParaMEDMEM.DataArrayInt.getConstPointer(), ParaMEDMEM.DataArray.getNumberOfComponents(), ParaMEDMEM.DataArray.getNumberOfTuples(), ParaMEDMEM.DataArrayInt.getPointer(), ParaMEDMEM.DataArrayInt.New(), and testMEDMEM.ret.

DataArrayInt * DataArrayInt::renumberR ( const int new2Old  )  const
DataArrayInt * DataArrayInt::renumberAndReduce ( const int old2New,
int  newNbOfTuple 
) const

Idem DataArrayDouble.renumber method except that the number of tuples is reduced. That is to say that it is expected that newNbOfTuple<this->getNumberOfTuples(). ['old2New','old2New'+getNumberOfTuples()) defines a range containing old to new array. For every negative value in ['old2NewBg','old2New'getNumberOfTuples()) the corresponding tuple is omitted.

References ParaMEDMEM.DataArrayInt.alloc(), ParaMEDMEM.DataArray.copyStringInfoFrom(), ParaMEDMEM.DataArrayInt.getConstPointer(), ParaMEDMEM.DataArray.getNumberOfComponents(), ParaMEDMEM.DataArray.getNumberOfTuples(), ParaMEDMEM.DataArrayInt.getPointer(), ParaMEDMEM.DataArrayInt.New(), and testMEDMEM.ret.

DataArrayInt * DataArrayInt::selectByTupleId ( const int new2OldBg,
const int new2OldEnd 
) const

This method is a generalization of DataArrayDouble.substr method because a not contigous range can be specified here. This method is equavalent to DataArrayInt.renumberAndReduce except that convention in input is new2old and not old2new.

References ParaMEDMEM.DataArrayInt.alloc(), ParaMEDMEM.DataArray.copyStringInfoFrom(), ParaMEDMEM.DataArrayInt.getConstPointer(), ParaMEDMEM.DataArray.getNumberOfComponents(), ParaMEDMEM.DataArrayInt.getPointer(), med_test2.nbComp, ParaMEDMEM.DataArrayInt.New(), and testMEDMEM.ret.

DataArrayInt * DataArrayInt::selectByTupleIdSafe ( const int new2OldBg,
const int new2OldEnd 
) const throw (INTERP_KERNEL::Exception)

This method is equivalent to DataArrayInt.selectByTupleId except that an analyze to the content of input range to check that it will not lead to memory corruption !

References med_test2.nbComp, ParaMEDMEM.DataArrayInt.New(), and testMEDMEM.ret.

DataArrayInt * DataArrayInt::selectByTupleId2 ( int  bg,
int  end,
int  step 
) const throw (INTERP_KERNEL::Exception)

Idem than DataArrayInt.selectByTupleIdSafe except that the input array is not constructed explicitely. The convention is as python one. ['bg','end') with steps of 'step'. Returns a newly created array.

References med_test1.end, med_test2.nbComp, ParaMEDMEM.DataArrayInt.New(), and testMEDMEM.ret.

DataArrayInt * DataArrayInt::checkAndPreparePermutation (  )  const throw (INTERP_KERNEL::Exception)

This method works only for arrays having single component. If this contains the array a1 containing [9,10,0,6,4,11,3,7] this method returns an array a2 [5,6,0,3,2,7,1,4]. By doing a1.renumber(a2) the user will obtain array a3 equal to a1 sorted. This method is useful for renumbering (in MED file for example). This method is used by MEDCouplingFieldDouble.renumberCells when check is set to true. This method throws an exception if more 2 or more elements in 'this' are same.

References ParaMEDMEM.DataArrayInt.checkAllocated(), ParaMEDMEM.DataArrayInt.CheckAndPreparePermutation(), ParaMEDMEM.CPP_DEALLOC, ParaMEDMEM.DataArrayInt.getConstPointer(), ParaMEDMEM.DataArray.getNumberOfComponents(), ParaMEDMEM.DataArray.getNumberOfTuples(), ParaMEDMEM.DataArrayInt.New(), testMEDMEM.ret, and ParaMEDMEM.DataArrayInt.useArray().

void DataArrayInt::changeSurjectiveFormat ( int  targetNb,
DataArrayInt *&  arr,
DataArrayInt *&  arrI 
) const throw (INTERP_KERNEL::Exception)

This method makes the assumption that 'this' is correctly set, and has exactly one component. If not an exception will be thrown. Given a sujective application defined by 'this' from a set of size this->getNumberOfTuples() to a set of size targetNb. 'targetNb'<this->getNumberOfTuples(). 'this' should be surjective that is to say for each id in [0,'targetNb') it exists at least one tupleId tid so that this->getIJ(tid,0)==id. If not an exception will be thrown. This method returns 2 newly allocated arrays 'arr' and 'arrI', corresponding respectively to array and its corresponding index. This method is usefull for methods that returns old2New numbering concecutive to a reduction ( MEDCouplingUMesh.zipConnectivityTraducer, MEDCouplingUMesh.zipConnectivityTraducer for example) Example : if 'this' equals [0,3,2,3,2,2,1,2] this method will return arrI=[0,1,2,6,8] arr=[0, 6, 2,4,5,7, 1,3] That is to say elt id 2 has arrI[2+1]-arrI[2]=4 places in 'this'. The corresponding tuple ids are [2,4,5,7].

References ParaMEDMEM.DataArrayInt.New(), and testMEDMEM.ret.

DataArrayInt * DataArrayInt::buildPermArrPerLevel (  )  const throw (INTERP_KERNEL::Exception)

This method expects that 'this' is allocated and with only one component. If not an exception will be thrown. This method returns a newly created array with 'this->getNumberOfTuples()' tuples and 1 component. This methods returns an 'old2New' corresponding array that allows to follow the following rules :

  • Lower a value in tuple in 'this' is, higher is its priority.
  • If two tuples i and j have same value if i<j then ret[i]<ret[j]
  • The first tuple with the lowest value will have the value 0, inversely the last tuple with highest value will have value 'this->getNumberOfTuples()-1'

Example if 'this' contains the following array : [2,0,1,1,0,1,2,0,1,1,0,0] this method returns [10,0,5,6,1,7,11,2,8,9,3,4]

References ParaMEDMEM.DataArrayInt.checkAllocated(), ParaMEDMEM.DataArrayInt.getConstPointer(), ParaMEDMEM.DataArray.getNumberOfComponents(), ParaMEDMEM.DataArray.getNumberOfTuples(), Med_Gen_test.it, TestMedCorba2.m, ParaMEDMEM.DataArrayInt.New(), and testMEDMEM.ret.

bool DataArrayInt::isIdentity (  )  const

This method checks that 'this' is with numberofcomponents == 1 and that it is equal to stdext.iota() of size getNumberOfTuples. This method is particalary usefull for DataArrayInt instances that represents a renumbering array to check the real need in renumbering.

References ParaMEDMEM.DataArrayInt.getConstPointer(), ParaMEDMEM.DataArray.getNumberOfComponents(), and ParaMEDMEM.DataArray.getNumberOfTuples().

bool DataArrayInt::isUniform ( int  val  )  const
DataArrayInt * DataArrayInt::substr ( int  tupleIdBg,
int  tupleIdEnd = -1 
) const throw (INTERP_KERNEL::Exception)

This methods has a similar behaviour than std.string.substr. This method returns a newly created DataArrayInt that is part of this with same number of components. The intervall is specified by [tupleIdBg,tupleIdEnd) except if tupleIdEnd ==-1 in this case the [tupleIdBg,this->end()) will be kept. This method check that interval is valid regarding this, if not an exception will be thrown.

References ParaMEDMEM.DataArrayInt.alloc(), ParaMEDMEM.DataArray.copyStringInfoFrom(), ParaMEDMEM.DataArrayInt.getPointer(), med_test2.nbComp, ParaMEDMEM.DataArrayInt.New(), and testMEDMEM.ret.

void DataArrayInt::rearrange ( int  newNbOfCompo  )  throw (INTERP_KERNEL::Exception)

Contrary to DataArrayInt.changeNbOfComponents method this method is not const. The content This method do not change the content of data but changes the splitting of this data seen by the caller. This method makes the assumption that 'this' is already allocated. If not an exception will be thrown. This method checks that getNbOfElems()newNbOfCompo==0. If not an exception will be throw ! This method erases all components info set before call !

DataArrayInt * DataArrayInt::changeNbOfComponents ( int  newNbOfComp,
int  dftValue 
) const throw (INTERP_KERNEL::Exception)

This method builds a new instance of DataArrayInt (to deal with) that is reduction or an extension of 'this'. if 'newNbOfComp' < this->getNumberOfComponents() a reduction is done and for each tuple 'newNbOfComp' first components are kept. If 'newNbOfComp' > this->getNumberOfComponents() an extension is done, and for each components i such that i > getNumberOfComponents() 'dftValue' parameter is taken.

References ParaMEDMEM.DataArrayInt.alloc(), ParaMEDMEM.DataArrayInt.getPointer(), ParaMEDMEM.DataArrayInt.New(), testMEDMEM.ret, ParaMEDMEM.DataArray.setInfoOnComponent(), and ParaMEDMEM.DataArray.setName().

DataArrayInt * DataArrayInt::keepSelectedComponents ( const std::vector< int > &  compoIds  )  const throw (INTERP_KERNEL::Exception)
void DataArrayInt::meldWith ( const DataArrayInt other  )  throw (INTERP_KERNEL::Exception)

This method melds the components of 'this' with components of 'other'. After this call in case of success, 'this' will contain a number of components equal to the sum of 'this' before the call and the number of components of 'other'. This method expects that 'this' and 'other' have exactly the same number of tuples. If not an exception is thrown.

References ParaMEDMEM.CPP_DEALLOC.

void DataArrayInt::setSelectedComponents ( const DataArrayInt a,
const std::vector< int > &  compoIds 
) throw (INTERP_KERNEL::Exception)
void DataArrayInt::setPartOfValues1 ( const DataArrayInt a,
int  bgTuples,
int  endTuples,
int  stepTuples,
int  bgComp,
int  endComp,
int  stepComp,
bool  strictCompoCompare = true 
) throw (INTERP_KERNEL::Exception)

This method performs a partial assignment of 'this' using 'a' as input. Other input parameters specifies the subpart being considered by the assignment. 'strictCompoCompare' specifies if DataArray 'a' should have exactly same number of components and tuples than 'this' (true) or not (false). By default set to true with maximal test.

References testGaussLocalization.a, ParaMEDMEM.DataArray.CheckClosingParInRange(), ParaMEDMEM.DataArray.CheckValueInRange(), ParaMEDMEM.DataArray.GetNumberOfItemGivenBES(), medcorba_test.msg, and med_test2.nbComp.

void DataArrayInt::setPartOfValuesSimple1 ( int  a,
int  bgTuples,
int  endTuples,
int  stepTuples,
int  bgComp,
int  endComp,
int  stepComp 
) throw (INTERP_KERNEL::Exception)

This method performs a partial assignment of 'this' using 'a' as input. Other input parameters specifies the subpart being considered by the assignment.

References testGaussLocalization.a, ParaMEDMEM.DataArray.CheckClosingParInRange(), ParaMEDMEM.DataArray.CheckValueInRange(), ParaMEDMEM.DataArray.GetNumberOfItemGivenBES(), medcorba_test.msg, and med_test2.nbComp.

void DataArrayInt::setPartOfValues2 ( const DataArrayInt a,
const int bgTuples,
const int endTuples,
const int bgComp,
const int endComp,
bool  strictCompoCompare = true 
) throw (INTERP_KERNEL::Exception)

This method performs a partial assignment of 'this' using 'a' as input. Other input parameters specifies the subpart being considered by the assignment. 'strictCompoCompare' specifies if DataArray 'a' should have exactly same number of components and tuples than 'this' (true) or not (false). By default set to true with maximal test.

References testGaussLocalization.a, ParaMEDMEM.DataArray.CheckValueInRange(), medcorba_test.msg, and med_test2.nbComp.

void DataArrayInt::setPartOfValuesSimple2 ( int  a,
const int bgTuples,
const int endTuples,
const int bgComp,
const int endComp 
) throw (INTERP_KERNEL::Exception)

This method performs a partial assignment of 'this' using 'a' as input. Other input parameters specifies the subpart being considered by the assignment.

References testGaussLocalization.a, ParaMEDMEM.DataArray.CheckValueInRange(), and med_test2.nbComp.

void DataArrayInt::setPartOfValues3 ( const DataArrayInt a,
const int bgTuples,
const int endTuples,
int  bgComp,
int  endComp,
int  stepComp,
bool  strictCompoCompare = true 
) throw (INTERP_KERNEL::Exception)

This method performs a partial assignment of 'this' using 'a' as input. Other input parameters specifies the subpart being considered by the assignment. 'strictCompoCompare' specifies if DataArray 'a' should have exactly same number of components and tuples than 'this' (true) or not (false). By default set to true with maximal test.

References testGaussLocalization.a, ParaMEDMEM.DataArray.CheckClosingParInRange(), ParaMEDMEM.DataArray.CheckValueInRange(), ParaMEDMEM.DataArray.GetNumberOfItemGivenBES(), medcorba_test.msg, and med_test2.nbComp.

void DataArrayInt::setPartOfValuesSimple3 ( int  a,
const int bgTuples,
const int endTuples,
int  bgComp,
int  endComp,
int  stepComp 
) throw (INTERP_KERNEL::Exception)

This method performs a partial assignment of 'this' using 'a' as input. Other input parameters specifies the subpart being considered by the assignment.

References testGaussLocalization.a, ParaMEDMEM.DataArray.CheckClosingParInRange(), ParaMEDMEM.DataArray.CheckValueInRange(), ParaMEDMEM.DataArray.GetNumberOfItemGivenBES(), medcorba_test.msg, and med_test2.nbComp.

void ParaMEDMEM.DataArrayInt.getTuple ( int  tupleId,
int res 
) const
int ParaMEDMEM.DataArrayInt.getIJ ( int  tupleId,
int  compoId 
) const
void ParaMEDMEM.DataArrayInt.setIJ ( int  tupleId,
int  compoId,
int  newVal 
)
void ParaMEDMEM.DataArrayInt.setIJSilent ( int  tupleId,
int  compoId,
int  newVal 
)
int* ParaMEDMEM.DataArrayInt.getPointer (  ) 
void DataArrayInt::SetArrayIn ( DataArrayInt newArray,
DataArrayInt *&  arrayToSet 
) [static]
const int* ParaMEDMEM.DataArrayInt.getConstPointer (  )  const
DataArrayInt * DataArrayInt::getIdsEqual ( int  val  )  const throw (INTERP_KERNEL::Exception)
DataArrayInt * DataArrayInt::getIdsNotEqual ( int  val  )  const throw (INTERP_KERNEL::Exception)
DataArrayInt * DataArrayInt::getIdsEqualList ( const std::vector< int > &  vals  )  const throw (INTERP_KERNEL::Exception)
DataArrayInt * DataArrayInt::getIdsNotEqualList ( const std::vector< int > &  vals  )  const throw (INTERP_KERNEL::Exception)
bool DataArrayInt::presenceOfValue ( const std::vector< int > &  vals  )  const throw (INTERP_KERNEL::Exception)

This method expects to be called when number of components of this is equal to one. This method returns true if it exists a tuple so that the value is contained in 'vals'. If not any tuple contains one of the values contained in 'vals' false is returned.

int DataArrayInt::getMaxValue ( int tupleId  )  const throw (INTERP_KERNEL::Exception)
int DataArrayInt::getMinValue ( int tupleId  )  const throw (INTERP_KERNEL::Exception)
void DataArrayInt::applyLin ( int  a,
int  b,
int  compoId 
) throw (INTERP_KERNEL::Exception)
void DataArrayInt::applyLin ( int  a,
int  b 
) throw (INTERP_KERNEL::Exception)
void DataArrayInt::applyInv ( int  numerator  )  throw (INTERP_KERNEL::Exception)

This method applies the operation 'numerator/x' for each element 'x' in 'this'. If there is a value in 'this' exactly equal to 0. an exception is thrown. Warning if presence of null this is modified for each values previous than place where exception was thrown !

void DataArrayInt::applyDivideBy ( int  val  )  throw (INTERP_KERNEL::Exception)
void DataArrayInt::applyModulus ( int  val  )  throw (INTERP_KERNEL::Exception)
void DataArrayInt::applyRModulus ( int  val  )  throw (INTERP_KERNEL::Exception)

This method applies the operation 'numeratorx' for each element 'x' in 'this'. If there is a value in 'this' exactly equals or lower than 0. an exception is thrown. Warning if presence of null this is modified for each values previous than place where exception was thrown !

DataArrayInt * DataArrayInt::Aggregate ( const DataArrayInt a1,
const DataArrayInt a2,
int  offsetA2 
) [static]
DataArrayInt * DataArrayInt::Aggregate ( const std::vector< const DataArrayInt * > &  a  )  throw (INTERP_KERNEL::Exception) [static]
DataArrayInt * DataArrayInt::Meld ( const DataArrayInt a1,
const DataArrayInt a2 
) throw (INTERP_KERNEL::Exception) [static]
DataArrayInt * DataArrayInt::Meld ( const std::vector< const DataArrayInt * > &  a  )  throw (INTERP_KERNEL::Exception) [static]
DataArrayInt * DataArrayInt::MakePartition ( const std::vector< const DataArrayInt * > &  groups,
int  newNb,
std::vector< std::vector< int > > &  fidsOfGroups 
) [static]

This method create a minimal partition of groups 'groups' the std.iota array of size 'newNb'. This method returns an array of size 'newNb' that specifies for each item at which familyId it owns to, and this method returns for each group the familyId it contains. If an id so that id<newNb and that appears in no groups will appears with 0 in return array.

Parameters:
groups in arrays specifying ids of each groups.
newNb specifies size of whole set. Must be at least equal to max eltid in 'groups'.
Returns:
an array of size newNb specifying fid of each item.

References ParaMEDMEM.DataArrayInt.alloc(), med_test1.end, MEDMEM.fill(), ParaMEDMEM.DataArrayInt.getPointer(), ParaMEDMEM.DataArrayInt.New(), and testMEDMEM.ret.

DataArrayInt * DataArrayInt::BuildUnion ( const std::vector< const DataArrayInt * > &  a  )  throw (INTERP_KERNEL::Exception) [static]
DataArrayInt * DataArrayInt::BuildIntersection ( const std::vector< const DataArrayInt * > &  a  )  throw (INTERP_KERNEL::Exception) [static]
DataArrayInt * DataArrayInt::buildComplement ( int  nbOfElement  )  const throw (INTERP_KERNEL::Exception)
DataArrayInt * DataArrayInt::buildSubstraction ( const DataArrayInt other  )  const throw (INTERP_KERNEL::Exception)
DataArrayInt * DataArrayInt::buildUnion ( const DataArrayInt other  )  const throw (INTERP_KERNEL::Exception)
DataArrayInt * DataArrayInt::buildIntersection ( const DataArrayInt other  )  const throw (INTERP_KERNEL::Exception)
DataArrayInt * DataArrayInt::deltaShiftIndex (  )  const throw (INTERP_KERNEL::Exception)

This method could be usefull for returned DataArrayInt marked as index. Some methods that generate such DataArrayInt instances:

References ParaMEDMEM.DataArrayInt.alloc(), ParaMEDMEM.DataArrayInt.checkAllocated(), ParaMEDMEM.DataArrayInt.getConstPointer(), ParaMEDMEM.DataArray.getNumberOfComponents(), ParaMEDMEM.DataArray.getNumberOfTuples(), ParaMEDMEM.DataArrayInt.getPointer(), ParaMEDMEM.DataArrayInt.New(), and testMEDMEM.ret.

void DataArrayInt::computeOffsets (  )  throw (INTERP_KERNEL::Exception)

This method performs the work on itself. This method works on array with number of component equal to one and allocated. If not an exception is thrown. This method conserves the number of tuples and number of components (1). No reallocation is done. For an array [3,5,1,2,0,8] it becomes [0,3,8,9,11,11]. For each i>0 new[i]=new[i-1]+old[i-1] for i==0 new[i]=0. This could be usefull for allToAllV in MPI with contiguous policy.

References ParaMEDMEM.DataArrayInt.checkAllocated(), ParaMEDMEM.TimeLabel.declareAsNew(), ParaMEDMEM.DataArray.getNumberOfComponents(), ParaMEDMEM.DataArray.getNumberOfTuples(), and ParaMEDMEM.DataArrayInt.getPointer().

void DataArrayInt::computeOffsets2 (  )  throw (INTERP_KERNEL::Exception)

Idem DataArrayInt.computeOffsets method execpt that 'this' changes its number of tuples. After the call in case of success new number of tuples is equal to old number of tuples +1. The content in 'this' for the first old number of tuples is exactly the same than those given by DataArrayInt.computeOffsets method. For an array [3,5,1,2,0,8] it becomes [0,3,8,9,11,11,19].

References ParaMEDMEM.DataArrayInt.checkAllocated(), ParaMEDMEM.CPP_DEALLOC, ParaMEDMEM.TimeLabel.declareAsNew(), ParaMEDMEM.DataArrayInt.getConstPointer(), ParaMEDMEM.DataArray.getNumberOfComponents(), ParaMEDMEM.DataArray.getNumberOfTuples(), testMEDMEM.ret, and ParaMEDMEM.DataArrayInt.useArray().

DataArrayInt * DataArrayInt::buildExplicitArrByRanges ( const DataArrayInt offsets  )  const throw (INTERP_KERNEL::Exception)

This method works on array with number of component equal to one and allocated. If not an exception is thrown. 'offsets' should be monotic ascendently. If not, an exception will be thrown. This method retrives a newly created DataArrayInt instance with 1 component and this->getNumberOfTuples()-1 tuples. If 'this' contains [0,2,3] and 'offsets' [0,3,6,10,14,20] the returned array will contain [0,1,2,6,7,8,9,10,11,12,13]

References ParaMEDMEM.DataArrayInt.New(), and testMEDMEM.ret.

std::set< int > DataArrayInt::getDifferentValues (  )  const throw (INTERP_KERNEL::Exception)
void DataArrayInt::useArray ( const int array,
bool  ownership,
DeallocType  type,
int  nbOfTuple,
int  nbOfCompo 
)
void ParaMEDMEM.DataArrayInt.writeOnPlace ( int  id,
int  element0,
const int others,
int  sizeOfOthers 
)
DataArrayInt * DataArrayInt::Add ( const DataArrayInt a1,
const DataArrayInt a2 
) throw (INTERP_KERNEL::Exception) [static]
void DataArrayInt::addEqual ( const DataArrayInt other  )  throw (INTERP_KERNEL::Exception)
DataArrayInt * DataArrayInt::Substract ( const DataArrayInt a1,
const DataArrayInt a2 
) throw (INTERP_KERNEL::Exception) [static]
void DataArrayInt::substractEqual ( const DataArrayInt other  )  throw (INTERP_KERNEL::Exception)
DataArrayInt * DataArrayInt::Multiply ( const DataArrayInt a1,
const DataArrayInt a2 
) throw (INTERP_KERNEL::Exception) [static]
void DataArrayInt::multiplyEqual ( const DataArrayInt other  )  throw (INTERP_KERNEL::Exception)
DataArrayInt * DataArrayInt::Divide ( const DataArrayInt a1,
const DataArrayInt a2 
) throw (INTERP_KERNEL::Exception) [static]
void DataArrayInt::divideEqual ( const DataArrayInt other  )  throw (INTERP_KERNEL::Exception)
DataArrayInt * DataArrayInt::Modulus ( const DataArrayInt a1,
const DataArrayInt a2 
) throw (INTERP_KERNEL::Exception) [static]
void DataArrayInt::modulusEqual ( const DataArrayInt other  )  throw (INTERP_KERNEL::Exception)
void ParaMEDMEM.DataArrayInt.updateTime (  )  const [virtual]

nothing to do here because this class does not aggregate any TimeLabel instance.

Implements ParaMEDMEM.TimeLabel.

int * DataArrayInt::CheckAndPreparePermutation ( const int start,
const int end 
) [static]
void DataArrayInt::getTinySerializationIntInformation ( std::vector< int > &  tinyInfo  )  const

Useless method for end user. Only for MPI/Corba/File serialsation for multi arrays class. Server side.

References ParaMEDMEM.DataArray.getNumberOfComponents(), ParaMEDMEM.DataArray.getNumberOfTuples(), and ParaMEDMEM.DataArrayInt.isAllocated().

void DataArrayInt::getTinySerializationStrInformation ( std::vector< std::string > &  tinyInfo  )  const

Useless method for end user. Only for MPI/Corba/File serialsation for multi arrays class. Server side.

References ParaMEDMEM.DataArray.getInfoOnComponent(), ParaMEDMEM.DataArray.getName(), ParaMEDMEM.DataArray.getNumberOfComponents(), and ParaMEDMEM.DataArrayInt.isAllocated().

bool DataArrayInt::resizeForUnserialization ( const std::vector< int > &  tinyInfoI  ) 

Useless method for end user. Only for MPI/Corba/File serialsation for multi arrays class. This method returns if a feeding is needed.

References ParaMEDMEM.DataArrayInt.alloc(), and medClient_test.nbOfComp.

void DataArrayInt::finishUnserialization ( const std::vector< int > &  tinyInfoI,
const std::vector< std::string > &  tinyInfoS 
)

Useless method for end user. Only for MPI/Corba/File serialsation for multi arrays class. This method returns if a feeding is needed.

References ParaMEDMEM.DataArray.getNumberOfComponents(), ParaMEDMEM.DataArrayInt.isAllocated(), ParaMEDMEM.DataArray.setInfoOnComponent(), and ParaMEDMEM.DataArray.setName().


Field Documentation