Version: 9.14.0
MEDCoupling::DataArrayTemplateClassic< T > Class Template Reference
Inheritance diagram for MEDCoupling::DataArrayTemplateClassic< T >:
Collaboration diagram for MEDCoupling::DataArrayTemplateClassic< T >:

Public Member Functions

void abs ()
 
void addEqual (const typename Traits< T >::ArrayType *other)
 
void aggregate (const typename Traits< T >::ArrayType *other)
 
void applyLin (T a, T b)
 
void applyLin (T a, T b, std::size_t compoId)
 
Traits< T >::ArrayType * computeAbs () const
 
MCAuto< DataArrayDoubleconvertToDblArr () const
 
MCAuto< DataArrayFloatconvertToFloatArr () const
 
MCAuto< DataArrayInt64convertToInt64Arr () const
 
MCAuto< DataArrayInt > convertToIntArr () const
 
template<class U >
MCAuto< typename Traits< U >::ArrayType > convertToOtherTypeOfArr () const
 
void divideEqual (const typename Traits< T >::ArrayType *other)
 
Traits< T >::ArrayType * duplicateEachTupleNTimes (mcIdType nbTimes) const
 
MCAuto< typename Traits< T >::ArrayType > duplicateNTimes (mcIdType nbTimes) const
 
MCAuto< DataArrayIdType > findIdsGreaterOrEqualTo (T val) const
 
MCAuto< DataArrayIdType > findIdsGreaterThan (T val) const
 
MCAuto< DataArrayIdType > findIdsLowerOrEqualTo (T val) const
 
MCAuto< DataArrayIdType > findIdsLowerThan (T val) const
 
DataArrayIdType * findIdsStrictlyNegative () const
 
Traits< T >::ArrayType * fromNoInterlace () const
 
void iota (T init=(T) 0)
 
void meldWith (const typename Traits< T >::ArrayType *other)
 
void multiplyEqual (const typename Traits< T >::ArrayType *other)
 
Traits< T >::ArrayType * negate () const
 
Traits< T >::ArrayType * performCopyOrIncrRef (bool dCpy) const
 
std::string repr () const
 
std::string reprNotTooLong () const
 
void reprNotTooLongStream (std::ostream &stream) const
 
void reprNotTooLongWithoutNameStream (std::ostream &stream) const
 
void reprStream (std::ostream &stream) const
 
void reprWithoutNameStream (std::ostream &stream) const
 
std::string reprZip () const
 
void reprZipStream (std::ostream &stream) const
 
void reprZipWithoutNameStream (std::ostream &stream) const
 
void substractEqual (const typename Traits< T >::ArrayType *other)
 
Traits< T >::ArrayType * sumPerTuple () const
 
Traits< T >::ArrayType * toNoInterlace () const
 
- Public Member Functions inherited from MEDCoupling::DataArrayTemplate< T >
MemArray< T > & accessToMemArray ()
 
const MemArray< T > & accessToMemArray () const
 
void alloc (std::size_t nbOfTuple, std::size_t nbOfCompo=1)
 
void allocIfNecessary (std::size_t nbOfTuple, std::size_t nbOfCompo)
 
back () const
 
const T * begin () const
 
Traits< T >::ArrayType * changeNbOfComponents (std::size_t newNbOfComp, T dftValue) const
 
void checkAllocated () const
 
void circularPermutation (mcIdType nbOfShift=1)
 
void circularPermutationPerTuple (mcIdType nbOfShift=1)
 
void deepCopyFrom (const DataArrayTemplate< T > &other)
 
void desallocate ()
 
bool empty () const
 
const T * end () const
 
std::vector< MCAuto< typename Traits< T >::ArrayTypeCh > > explodeComponents () const
 
void fillWithValue (T val)
 
void fillWithZero ()
 
front () const
 
const T * getConstPointer () const
 
std::size_t getHeapMemorySizeWithoutChildren () const
 
getIJ (std::size_t tupleId, std::size_t compoId) const
 
getIJSafe (std::size_t tupleId, std::size_t compoId) const
 
getMaxAbsValue (std::size_t &tupleId) const
 
getMaxAbsValueInArray () const
 
getMaxValue (mcIdType &tupleId) const
 
getMaxValueInArray () const
 
getMinValue (mcIdType &tupleId) const
 
getMinValueInArray () const
 
std::size_t getNbOfElemAllocated () const
 
mcIdType getNbOfElems () const
 
mcIdType getNumberOfTuples () const
 
T * getPointer ()
 
T * getPointerSilent ()
 
void getTuple (mcIdType tupleId, T *res) const
 
void * getVoidStarPointer ()
 
template<class InputIterator >
void insertAtTheEnd (InputIterator first, InputIterator last)
 
bool isAllocated () const override
 
void pack () const
 
popBackSilent ()
 
void printForDebug (std::ostream &oss) const
 
void pushBackSilent (T val)
 
template<class InputIterator >
void pushBackValsSilent (InputIterator valsBg, InputIterator valsEnd)
 
void reAlloc (std::size_t newNbOfTuple)
 
void rearrange (std::size_t newNbOfCompo)
 
Traits< T >::ArrayType * renumber (const mcIdType *old2New) const
 
Traits< T >::ArrayType * renumberAndReduce (const mcIdType *old2New, mcIdType newNbOfTuple) const
 
void renumberInPlace (const mcIdType *old2New)
 
void renumberInPlaceR (const mcIdType *new2Old)
 
Traits< T >::ArrayType * renumberR (const mcIdType *new2Old) const
 
void reserve (std::size_t nbOfElems)
 
void reverse ()
 
void reversePerTuple ()
 
T * rwBegin ()
 
T * rwEnd ()
 
MCAuto< typename Traits< T >::ArrayTypeCh > selectPartDef (const PartDefinition *pd) const
 
void setContigPartOfSelectedValues (mcIdType tupleIdStart, const DataArray *aBase, const DataArrayIdType *tuplesSelec)
 
void setContigPartOfSelectedValuesSlice (mcIdType tupleIdStart, const DataArray *aBase, mcIdType bg, mcIdType end2, mcIdType step)
 
void setIJ (std::size_t tupleId, std::size_t compoId, T newVal)
 
void setIJSilent (std::size_t tupleId, std::size_t compoId, T newVal)
 
void setPartOfValues1 (const typename Traits< T >::ArrayType *a, mcIdType bgTuples, mcIdType endTuples, mcIdType stepTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp, bool strictCompoCompare=true)
 
void setPartOfValues2 (const typename Traits< T >::ArrayType *a, const mcIdType *bgTuples, const mcIdType *endTuples, const mcIdType *bgComp, const mcIdType *endComp, bool strictCompoCompare=true)
 
void setPartOfValues3 (const typename Traits< T >::ArrayType *a, const mcIdType *bgTuples, const mcIdType *endTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp, bool strictCompoCompare=true)
 
void setPartOfValues4 (const typename Traits< T >::ArrayType *a, mcIdType bgTuples, mcIdType endTuples, mcIdType stepTuples, const mcIdType *bgComp, const mcIdType *endComp, bool strictCompoCompare=true)
 
void setPartOfValuesAdv (const typename Traits< T >::ArrayType *a, const DataArrayIdType *tuplesSelec)
 
void setPartOfValuesSimple1 (T a, mcIdType bgTuples, mcIdType endTuples, mcIdType stepTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp)
 
void setPartOfValuesSimple2 (T a, const mcIdType *bgTuples, const mcIdType *endTuples, const mcIdType *bgComp, const mcIdType *endComp)
 
void setPartOfValuesSimple3 (T a, const mcIdType *bgTuples, const mcIdType *endTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp)
 
void setPartOfValuesSimple4 (T a, mcIdType bgTuples, mcIdType endTuples, mcIdType stepTuples, const mcIdType *bgComp, const mcIdType *endComp)
 
void sort (bool asc=true)
 
void sortPerTuple (bool asc)
 
Traits< T >::ArrayType * subArray (mcIdType tupleIdBg, mcIdType tupleIdEnd=-1) const
 
void transpose ()
 
void updateTime () const
 
void useArray (const T *array, bool ownership, DeallocType type, std::size_t nbOfTuple, std::size_t nbOfCompo)
 
void useExternalArrayWithRWAccess (const T *array, std::size_t nbOfTuple, std::size_t nbOfCompo)
 
void writeForDbg (const std::string &fileName) const
 
void writeOnPlace (std::size_t id, T element0, const T *others, mcIdType sizeOfOthers)
 
- Public Member Functions inherited from MEDCoupling::DataArray
bool areInfoEquals (const DataArray &other) const
 
bool areInfoEqualsIfNotWhy (const DataArray &other, std::string &reason) const
 
virtual DataArraybuildNewEmptyInstance () const =0
 
void checkNbOfComps (std::size_t nbOfCompo, const std::string &msg) const
 
void checkNbOfElems (mcIdType nbOfElems, const std::string &msg) const
 
void checkNbOfTuples (mcIdType nbOfTuples, const std::string &msg) const
 
void checkNbOfTuplesAndComp (const DataArray &other, const std::string &msg) const
 
void checkNbOfTuplesAndComp (mcIdType nbOfTuples, std::size_t nbOfCompo, const std::string &msg) const
 
void copyPartOfStringInfoFrom (const DataArray &other, const std::vector< std::size_t > &compoIds)
 
void copyPartOfStringInfoFrom2 (const std::vector< std::size_t > &compoIds, const DataArray &other)
 
virtual DataArraycopySorted (bool asc=true) const =0
 
void copyStringInfoFrom (const DataArray &other)
 
std::string cppRepr (const std::string &varName) const
 
virtual DataArraydeepCopy () const =0
 
std::vector< const BigMemoryObject * > getDirectChildrenWithNull () const
 
std::string getInfoOnComponent (std::size_t i) const
 
std::vector< std::string > & getInfoOnComponents ()
 
const std::vector< std::string > & getInfoOnComponents () const
 
std::string getName () const
 
std::size_t getNumberOfComponents () const
 
std::string getUnitOnComponent (std::size_t i) const
 
std::vector< std::string > getUnitsOnComponent () const
 
std::string getVarOnComponent (std::size_t i) const
 
std::vector< std::string > getVarsOnComponent () const
 
virtual DataArraykeepSelectedComponents (const std::vector< std::size_t > &compoIds) const =0
 
virtual void reprCppStream (const std::string &varName, std::ostream &stream) const =0
 
virtual void reprQuickOverview (std::ostream &stream) const =0
 
virtual void reprQuickOverviewData (std::ostream &stream, std::size_t maxNbOfByteInRepr) const =0
 
virtual DataArrayselectByTupleId (const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const =0
 
virtual DataArrayselectByTupleIdSafe (const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const =0
 
virtual DataArrayselectByTupleIdSafeSlice (mcIdType bg, mcIdType end2, mcIdType step) const =0
 
virtual DataArrayselectByTupleRanges (const std::vector< std::pair< mcIdType, mcIdType > > &ranges) const =0
 
void setInfoAndChangeNbOfCompo (const std::vector< std::string > &info)
 
void setInfoOnComponent (std::size_t i, const std::string &info)
 
void setInfoOnComponents (const std::vector< std::string > &info)
 
void setName (const std::string &name)
 
void setPartOfValuesBase3 (const DataArray *aBase, const mcIdType *bgTuples, const mcIdType *endTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp, bool strictCompoCompare=true)
 
- Public Member Functions inherited from MEDCoupling::RefCountObjectOnly
bool decrRef () const
 
int getRCValue () const
 
void incrRef () const
 
RefCountObjectOnlyoperator= (const RefCountObjectOnly &other)
 
- Public Member Functions inherited from MEDCoupling::BigMemoryObject
std::string debugHeapMemorySize () const
 
std::vector< const BigMemoryObject * > getAllTheProgeny () const
 
virtual std::string getClassName () const
 
std::vector< const BigMemoryObject * > getDirectChildren () const
 
std::size_t getHeapMemorySize () const
 
std::string getHeapMemorySizeStr () const
 
bool isObjectInTheProgeny (const BigMemoryObject *obj) const
 
virtual ~BigMemoryObject ()
 
- Public Member Functions inherited from MEDCoupling::TimeLabel
void declareAsNew () const
 
std::size_t getTimeOfThis () const
 
TimeLabeloperator= (const TimeLabel &other)
 
 TimeLabel (const TimeLabel &other)=default
 

Static Public Member Functions

static Traits< T >::ArrayType * Add (const typename Traits< T >::ArrayType *a1, const typename Traits< T >::ArrayType *a2)
 
static Traits< T >::ArrayType * Divide (const typename Traits< T >::ArrayType *a1, const typename Traits< T >::ArrayType *a2)
 
static Traits< T >::ArrayType * Meld (const std::vector< const typename Traits< T >::ArrayType * > &arr)
 
static Traits< T >::ArrayType * Meld (const typename Traits< T >::ArrayType *a1, const typename Traits< T >::ArrayType *a2)
 
static Traits< T >::ArrayType * Multiply (const typename Traits< T >::ArrayType *a1, const typename Traits< T >::ArrayType *a2)
 
static Traits< T >::ArrayType * Substract (const typename Traits< T >::ArrayType *a1, const typename Traits< T >::ArrayType *a2)
 
- Static Public Member Functions inherited from MEDCoupling::DataArrayTemplate< T >
static MCAuto< typename Traits< T >::ArrayTypeCh > LoadForDbg (const std::string &fileName)
 
static MCAuto< typename Traits< T >::ArrayTypeCh > NewFromArray (const T *arrBegin, const T *arrEnd)
 
static MCAuto< typename Traits< T >::ArrayTypeCh > NewFromStdVector (const typename std::vector< T > &v)
 
static void SetArrayIn (typename Traits< T >::ArrayType *newArray, typename Traits< T >::ArrayType *&arrayToSet)
 
- Static Public Member Functions inherited from MEDCoupling::DataArray
static DataArrayAggregate (const std::vector< const DataArray * > &arrs)
 
static std::string BuildInfoFromVarAndUnit (const std::string &var, const std::string &unit)
 
static std::string GetAxisTypeRepr (MEDCouplingAxisType at)
 
static mcIdType GetNumberOfItemGivenBES (mcIdType begin, mcIdType end, mcIdType step, const std::string &msg)
 
static mcIdType GetNumberOfItemGivenBESRelative (mcIdType begin, mcIdType end, mcIdType step, const std::string &msg)
 
static mcIdType GetPosOfItemGivenBESRelativeNoThrow (mcIdType value, mcIdType begin, mcIdType end, mcIdType step)
 
static void GetSlice (mcIdType start, mcIdType stop, mcIdType step, mcIdType sliceId, mcIdType nbOfSlices, mcIdType &startSlice, mcIdType &stopSlice)
 
static std::string GetUnitFromInfo (const std::string &info)
 
static std::string GetVarNameFromInfo (const std::string &info)
 
static std::vector< std::string > SplitStringInChuncks (const std::string st, std::size_t sz)
 
- Static Public Member Functions inherited from MEDCoupling::BigMemoryObject
static std::size_t GetHeapMemorySizeOfObjs (const std::vector< const BigMemoryObject * > &objs)
 

Protected Member Functions

template<class OP >
MCAuto< DataArrayIdType > findIdsAdv (const OP &op) const
 
- Protected Member Functions inherited from MEDCoupling::DataArrayTemplate< T >
Traits< T >::ArrayTypeCh * copySortedImpl (bool asc) const
 
Traits< T >::ArrayType * myKeepSelectedComponents (const std::vector< std::size_t > &compoIds) const
 
Traits< T >::ArrayType * mySelectByTupleId (const DataArrayIdType &di) const
 
Traits< T >::ArrayType * mySelectByTupleId (const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const
 
Traits< T >::ArrayType * mySelectByTupleIdSafe (const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const
 
Traits< T >::ArrayType * mySelectByTupleIdSafeSlice (mcIdType bg, mcIdType end2, mcIdType step) const
 
Traits< T >::ArrayType * mySelectByTupleRanges (const std::vector< std::pair< mcIdType, mcIdType > > &ranges) const
 
- Protected Member Functions inherited from MEDCoupling::DataArray
 DataArray ()
 
 ~DataArray ()
 
- Protected Member Functions inherited from MEDCoupling::RefCountObject
 RefCountObject ()
 
 RefCountObject (const RefCountObject &other)
 
virtual ~RefCountObject ()
 
- Protected Member Functions inherited from MEDCoupling::RefCountObjectOnly
 RefCountObjectOnly ()
 
 RefCountObjectOnly (const RefCountObjectOnly &other)
 
virtual ~RefCountObjectOnly ()
 
- Protected Member Functions inherited from MEDCoupling::TimeLabel
void forceTimeOfThis (const TimeLabel &other) const
 
 TimeLabel ()
 
void updateTimeWith (const TimeLabel &other) const
 
virtual ~TimeLabel ()
 

Static Protected Member Functions

static Traits< T >::ArrayType * PerformCopyOrIncrRef (bool dCpy, const typename Traits< T >::ArrayType &self)
 
- Static Protected Member Functions inherited from MEDCoupling::DataArray
static void CheckClosingParInRange (mcIdType ref, mcIdType value, const std::string &msg)
 
static void CheckValueInRange (mcIdType ref, mcIdType value, const std::string &msg)
 
static void CheckValueInRangeEx (mcIdType value, mcIdType start, mcIdType end, const std::string &msg)
 
static mcIdType EffectiveCircPerm (mcIdType nbOfShift, mcIdType nbOfTuples)
 

Additional Inherited Members

- Public Types inherited from MEDCoupling::DataArrayTemplate< T >
typedef T Type
 
- Protected Attributes inherited from MEDCoupling::DataArrayTemplate< T >
MemArray< T > _mem
 
- Protected Attributes inherited from MEDCoupling::DataArray
std::vector< std::string > _info_on_compo
 
std::string _name
 

Member Function Documentation

◆ convertToDblArr()

template<class T >
MCAuto< DataArrayDouble > MEDCoupling::DataArrayTemplateClassic< T >::convertToDblArr

Creates a new DataArrayDouble and assigns all (textual and numerical) data of this array to the new one.

Returns
DataArrayDouble * - the new instance of DataArrayInt.

◆ convertToIntArr()

template<class T >
MCAuto< DataArrayInt > MEDCoupling::DataArrayTemplateClassic< T >::convertToIntArr

Creates a new DataArrayInt and assigns all (textual and numerical) data of this array to the new one.

Returns
DataArrayInt * - the new instance of DataArrayInt.

Referenced by MEDCoupling::MEDFileField1TSWithoutSDA::convertToInt().

◆ convertToInt64Arr()

template<class T >
MCAuto< DataArrayInt64 > MEDCoupling::DataArrayTemplateClassic< T >::convertToInt64Arr

Creates a new DataArrayInt64 and assigns all (textual and numerical) data of this array to the new one.

Returns
DataArrayInt * - the new instance of DataArrayInt64.

Referenced by MEDCoupling::MEDFileField1TSWithoutSDA::convertToInt64().

◆ convertToFloatArr()

template<class T >
MCAuto< DataArrayFloat > MEDCoupling::DataArrayTemplateClassic< T >::convertToFloatArr

Creates a new DataArrayFloat and assigns all (textual and numerical) data of this array to the new one.

Returns
DataArrayFloat * - the new instance of DataArrayInt.

◆ applyLin() [1/2]

template<class T >
void MEDCoupling::DataArrayTemplateClassic< T >::applyLin ( a,
b,
std::size_t  compoId 
)

Apply a linear function to a given component of this array, so that an array element (x) becomes $ a * x + b $.

Parameters
[in]a- the first coefficient of the function.
[in]b- the second coefficient of the function.
[in]compoId- the index of component to modify.
Exceptions
Ifthis is not allocated, or compoId is not in [0,this->getNumberOfComponents() ).

Referenced by MEDCoupling::DataArrayDouble::recenterForMaxPrecision().

◆ applyLin() [2/2]

template<class T >
void MEDCoupling::DataArrayTemplateClassic< T >::applyLin ( a,
b 
)

Apply a linear function to all elements of this array, so that an element x becomes $ a * x + b $.

Parameters
[in]a- the first coefficient of the function.
[in]b- the second coefficient of the function.
Exceptions
Ifthis is not allocated.

◆ negate()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplateClassic< T >::negate

Returns a full copy of this array except that sign of all elements is reversed.

Returns
DataArrayDouble * - the new instance of DataArrayDouble containing the same number of tuples and component as this array. The caller is to delete this result array using decrRef() as it is no more needed.
Exceptions
Ifthis is not allocated.

◆ addEqual()

template<class T >
void MEDCoupling::DataArrayTemplateClassic< T >::addEqual ( const typename Traits< T >::ArrayType *  other)

Adds values of another DataArrayDouble to values of this one. There are 3 valid cases.

  1. The arrays have same number of tuples and components. Then each value of other array is added to the corresponding value of this array, i.e.: a [ i, j ] += other [ i, j ].
  2. The arrays have same number of tuples and other array has one component. Then a [ i, j ] += other [ i, 0 ].
  3. The arrays have same number of components and other array has one tuple. Then a [ i, j ] += a2 [ 0, j ].
Parameters
[in]other- an array to add to this one.
Exceptions
Ifother is NULL.
Ifthis->getNumberOfTuples() != other->getNumberOfTuples() and this->getNumberOfComponents() != other->getNumberOfComponents() and other has number of both tuples and components not equal to 1.

Referenced by MEDCoupling::MEDCouplingLinearTime::addEqual().

◆ substractEqual()

template<class T >
void MEDCoupling::DataArrayTemplateClassic< T >::substractEqual ( const typename Traits< T >::ArrayType *  other)

Subtract values of another DataArrayDouble from values of this one. There are 3 valid cases.

  1. The arrays have same number of tuples and components. Then each value of other array is subtracted from the corresponding value of this array, i.e.: a [ i, j ] -= other [ i, j ].
  2. The arrays have same number of tuples and other array has one component. Then a [ i, j ] -= other [ i, 0 ].
  3. The arrays have same number of components and other array has one tuple. Then a [ i, j ] -= a2 [ 0, j ].
Parameters
[in]other- an array to subtract from this one.
Exceptions
Ifother is NULL.
Ifthis->getNumberOfTuples() != other->getNumberOfTuples() and this->getNumberOfComponents() != other->getNumberOfComponents() and other has number of both tuples and components not equal to 1.

Referenced by MEDCoupling::MEDCouplingLinearTime::substractEqual().

◆ multiplyEqual()

template<class T >
void MEDCoupling::DataArrayTemplateClassic< T >::multiplyEqual ( const typename Traits< T >::ArrayType *  other)

Multiply values of another DataArrayDouble to values of this one. There are 3 valid cases.

  1. The arrays have same number of tuples and components. Then each value of other array is multiplied to the corresponding value of this array, i.e. this [ i, j ] *= other [ i, j ].
  2. The arrays have same number of tuples and other array has one component. Then this [ i, j ] *= other [ i, 0 ].
  3. The arrays have same number of components and other array has one tuple. Then this [ i, j ] *= a2 [ 0, j ].
Parameters
[in]other- an array to multiply to this one.
Exceptions
Ifother is NULL.
Ifthis->getNumberOfTuples() != other->getNumberOfTuples() and this->getNumberOfComponents() != other->getNumberOfComponents() and other has number of both tuples and components not equal to 1.

Referenced by MEDCoupling::MEDCouplingLinearTime::multiplyEqual().

◆ divideEqual()

template<class T >
void MEDCoupling::DataArrayTemplateClassic< T >::divideEqual ( const typename Traits< T >::ArrayType *  other)

Divide values of this array by values of another DataArrayDouble. There are 3 valid cases.

  1. The arrays have same number of tuples and components. Then each value of this array is divided by the corresponding value of other one, i.e.: a [ i, j ] /= other [ i, j ].
  2. The arrays have same number of tuples and other array has one component. Then a [ i, j ] /= other [ i, 0 ].
  3. The arrays have same number of components and other array has one tuple. Then a [ i, j ] /= a2 [ 0, j ].

    Warning
    No check of division by zero is performed!
    Parameters
    [in]other- an array to divide this one by.
    Exceptions
    Ifother is NULL.
    Ifthis->getNumberOfTuples() != other->getNumberOfTuples() and this->getNumberOfComponents() != other->getNumberOfComponents() and other has number of both tuples and components not equal to 1.

Referenced by MEDCoupling::MEDCouplingLinearTime::divideEqual().

◆ Substract()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplateClassic< T >::Substract ( const typename Traits< T >::ArrayType *  a1,
const typename Traits< T >::ArrayType *  a2 
)
static

Returns a new DataArrayDouble that is a subtraction of two given arrays. There are 3 valid cases.

  1. The arrays have same number of tuples and components. Then each value of the result array (a) is a subtraction of the corresponding values of a1 and a2, i.e.: a [ i, j ] = a1 [ i, j ] - a2 [ i, j ].
  2. The arrays have same number of tuples and one array, say a2, has one component. Then a [ i, j ] = a1 [ i, j ] - a2 [ i, 0 ].
  3. The arrays have same number of components and one array, say a2, has one tuple. Then a [ i, j ] = a1 [ i, j ] - a2 [ 0, j ].

Info on components is copied either from the first array (in the first case) or from the array with maximal number of elements (getNbOfElems()).

Parameters
[in]a1- an array to subtract from.
[in]a2- an array to subtract.
Returns
DataArrayDouble * - the new instance of DataArrayDouble. The caller is to delete this result array using decrRef() as it is no more needed.
Exceptions
Ifeither a1 or a2 is NULL.
Ifa1->getNumberOfTuples() != a2->getNumberOfTuples() and a1->getNumberOfComponents() != a2->getNumberOfComponents() and none of them has number of tuples or components equal to 1.

Referenced by MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane(), MEDCoupling::MEDCouplingNoTimeLabel::substract(), MEDCoupling::MEDCouplingWithTimeStep::substract(), MEDCoupling::MEDCouplingConstOnTimeInterval::substract(), and MEDCoupling::MEDCouplingLinearTime::substract().

◆ Divide()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplateClassic< T >::Divide ( const typename Traits< T >::ArrayType *  a1,
const typename Traits< T >::ArrayType *  a2 
)
static

Returns a new DataArrayDouble that is a division of two given arrays. There are 3 valid cases.

  1. The arrays have same number of tuples and components. Then each value of the result array (a) is a division of the corresponding values of a1 and a2, i.e.: a [ i, j ] = a1 [ i, j ] / a2 [ i, j ].
  2. The arrays have same number of tuples and one array, say a2, has one component. Then a [ i, j ] = a1 [ i, j ] / a2 [ i, 0 ].
  3. The arrays have same number of components and one array, say a2, has one tuple. Then a [ i, j ] = a1 [ i, j ] / a2 [ 0, j ].

Info on components is copied either from the first array (in the first case) or from the array with maximal number of elements (getNbOfElems()).

Warning
No check of division by zero is performed!
Parameters
[in]a1- a numerator array.
[in]a2- a denominator array.
Returns
DataArrayDouble * - the new instance of DataArrayDouble. The caller is to delete this result array using decrRef() as it is no more needed.
Exceptions
Ifeither a1 or a2 is NULL.
Ifa1->getNumberOfTuples() != a2->getNumberOfTuples() and a1->getNumberOfComponents() != a2->getNumberOfComponents() and none of them has number of tuples or components equal to 1.

Referenced by MEDCoupling::MEDCouplingNoTimeLabel::divide(), MEDCoupling::MEDCouplingWithTimeStep::divide(), MEDCoupling::MEDCouplingConstOnTimeInterval::divide(), and MEDCoupling::MEDCouplingLinearTime::divide().

◆ Add()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplateClassic< T >::Add ( const typename Traits< T >::ArrayType *  a1,
const typename Traits< T >::ArrayType *  a2 
)
static

Returns a new DataArrayDouble that is a sum of two given arrays. There are 3 valid cases.

  1. The arrays have same number of tuples and components. Then each value of the result array (a) is a sum of the corresponding values of a1 and a2, i.e.: a [ i, j ] = a1 [ i, j ] + a2 [ i, j ].
  2. The arrays have same number of tuples and one array, say a2, has one component. Then a [ i, j ] = a1 [ i, j ] + a2 [ i, 0 ].
  3. The arrays have same number of components and one array, say a2, has one tuple. Then a [ i, j ] = a1 [ i, j ] + a2 [ 0, j ].

Info on components is copied either from the first array (in the first case) or from the array with maximal number of elements (getNbOfElems()).

Parameters
[in]a1- an array to sum up.
[in]a2- another array to sum up.
Returns
DataArrayDouble * - the new instance of DataArrayDouble. The caller is to delete this result array using decrRef() as it is no more needed.
Exceptions
Ifeither a1 or a2 is NULL.
Ifa1->getNumberOfTuples() != a2->getNumberOfTuples() and a1->getNumberOfComponents() != a2->getNumberOfComponents() and none of them has number of tuples or components equal to 1.

Referenced by MEDCoupling::MEDCouplingNoTimeLabel::add(), MEDCoupling::MEDCouplingWithTimeStep::add(), MEDCoupling::MEDCouplingConstOnTimeInterval::add(), MEDCoupling::MEDCouplingLinearTime::add(), and MEDFileFieldLin2QuadVisitor::endTimeStepEntry().

◆ Multiply()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplateClassic< T >::Multiply ( const typename Traits< T >::ArrayType *  a1,
const typename Traits< T >::ArrayType *  a2 
)
static

Returns a new DataArrayDouble that is a product of two given arrays. There are 3 valid cases.

  1. The arrays have same number of tuples and components. Then each value of the result array (a) is a product of the corresponding values of a1 and a2, i.e. a [ i, j ] = a1 [ i, j ] * a2 [ i, j ].
  2. The arrays have same number of tuples and one array, say a2, has one component. Then a [ i, j ] = a1 [ i, j ] * a2 [ i, 0 ].
  3. The arrays have same number of components and one array, say a2, has one tuple. Then a [ i, j ] = a1 [ i, j ] * a2 [ 0, j ].

Info on components is copied either from the first array (in the first case) or from the array with maximal number of elements (getNbOfElems()).

Parameters
[in]a1- a factor array.
[in]a2- another factor array.
Returns
DataArrayDouble * - the new instance of DataArrayDouble. The caller is to delete this result array using decrRef() as it is no more needed.
Exceptions
Ifeither a1 or a2 is NULL.
Ifa1->getNumberOfTuples() != a2->getNumberOfTuples() and a1->getNumberOfComponents() != a2->getNumberOfComponents() and none of them has number of tuples or components equal to 1.

Referenced by MEDCoupling::MEDCouplingMesh::computeMeshCenterOfMass(), MEDCoupling::MEDCouplingNoTimeLabel::multiply(), MEDCoupling::MEDCouplingWithTimeStep::multiply(), MEDCoupling::MEDCouplingConstOnTimeInterval::multiply(), and MEDCoupling::MEDCouplingLinearTime::multiply().

◆ Meld() [1/2]

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplateClassic< T >::Meld ( const typename Traits< T >::ArrayType *  a1,
const typename Traits< T >::ArrayType *  a2 
)
static

Returns a new DataArrayDouble by aggregating two given arrays, so that (1) the number of components in the result array is a sum of the number of components of given arrays and (2) the number of tuples in the result array is same as that of each of given arrays. In other words the i-th tuple of result array includes all components of i-th tuples of all given arrays. Number of tuples in the given arrays must be the same.

Parameters
[in]a1- an array to include in the result array.
[in]a2- another array to include in the result array.
Returns
DataArrayDouble * - the new instance of DataArrayDouble. The caller is to delete this result array using decrRef() as it is no more needed.
Exceptions
Ifboth a1 and a2 are NULL.
Ifany given array is not allocated.
Ifa1->getNumberOfTuples() != a2->getNumberOfTuples()

Referenced by MEDCoupling::MEDCouplingNoTimeLabel::meld(), MEDCoupling::MEDCouplingWithTimeStep::meld(), MEDCoupling::MEDCouplingConstOnTimeInterval::meld(), and MEDCoupling::MEDCouplingLinearTime::meld().

◆ Meld() [2/2]

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplateClassic< T >::Meld ( const std::vector< const typename Traits< T >::ArrayType * > &  arr)
static

Returns a new DataArrayDouble by aggregating all given arrays, so that (1) the number of components in the result array is a sum of the number of components of given arrays and (2) the number of tuples in the result array is same as that of each of given arrays. In other words the i-th tuple of result array includes all components of i-th tuples of all given arrays. Number of tuples in the given arrays must be the same.

Parameters
[in]arr- a sequence of arrays to include in the result array.
Returns
DataArrayDouble * - the new instance of DataArrayDouble. The caller is to delete this result array using decrRef() as it is no more needed.
Exceptions
Ifall arrays within arr are NULL.
Ifany given array is not allocated.
IfgetNumberOfTuples() of arrays within arr is different.

◆ findIdsGreaterOrEqualTo()

template<class T >
MCAuto< DataArrayIdType > MEDCoupling::DataArrayTemplateClassic< T >::findIdsGreaterOrEqualTo ( val) const

◆ findIdsGreaterThan()

template<class T >
MCAuto< DataArrayIdType > MEDCoupling::DataArrayTemplateClassic< T >::findIdsGreaterThan ( val) const

◆ findIdsLowerOrEqualTo()

template<class T >
MCAuto< DataArrayIdType > MEDCoupling::DataArrayTemplateClassic< T >::findIdsLowerOrEqualTo ( val) const

◆ findIdsLowerThan()

template<class T >
MCAuto< DataArrayIdType > MEDCoupling::DataArrayTemplateClassic< T >::findIdsLowerThan ( val) const

◆ findIdsStrictlyNegative()

template<class T >
DataArrayIdType * MEDCoupling::DataArrayTemplateClassic< T >::findIdsStrictlyNegative

This method works only on data array with one component. This method returns a newly allocated array storing stored ascendantly of tuple ids in this so that this[id]<0.

Returns
a newly allocated data array that the caller should deal with.
See also
DataArrayInt::findIdsInRange

◆ fromNoInterlace()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplateClassic< T >::fromNoInterlace

Returns a new DataArrayDouble holding the same values as this array but differently arranged in memory. If this array holds 2 components of 3 values: $ x_0,x_1,x_2,y_0,y_1,y_2 $, then the result array holds these values arranged as follows: $ x_0,y_0,x_1,y_1,x_2,y_2 $.

Warning
Do not confuse this method with transpose()!
Returns
DataArrayDouble * - the new instance of DataArrayDouble that the caller is to delete using decrRef() as it is no more needed.
Exceptions
Ifthis is not allocated.

References MEDCoupling::C_DEALLOC.

◆ toNoInterlace()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplateClassic< T >::toNoInterlace

Returns a new DataArrayDouble holding the same values as this array but differently arranged in memory. If this array holds 2 components of 3 values: $ x_0,y_0,x_1,y_1,x_2,y_2 $, then the result array holds these values arranged as follows: $ x_0,x_1,x_2,y_0,y_1,y_2 $.

Warning
Do not confuse this method with transpose()!
Returns
DataArrayDouble * - the new instance of DataArrayDouble that the caller is to delete using decrRef() as it is no more needed.
Exceptions
Ifthis is not allocated.

References MEDCoupling::C_DEALLOC.

Referenced by MEDCoupling::MEDCouplingFieldDiscretizationKriging::performDrift().

◆ meldWith()

template<class T >
void MEDCoupling::DataArrayTemplateClassic< T >::meldWith ( const typename Traits< T >::ArrayType *  other)

Appends components of another array to components of this one, tuple by tuple. So that the number of tuples of this array remains the same and the number of components increases.

Parameters
[in]other- the DataArrayDouble to append to this one.
Exceptions
Ifthis is not allocated.
Ifthis and other arrays have different number of tuples.

Here is a C++ example.

Here is a Python example.

References MEDCoupling::C_DEALLOC.

◆ duplicateEachTupleNTimes()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplateClassic< T >::duplicateEachTupleNTimes ( mcIdType  nbTimes) const
Parameters
[in]nbTimesspecifies the nb of times each tuples in this will be duplicated contiguouly in returned DataArrayDouble instance. nbTimes should be at least equal to 1.
Returns
a newly allocated DataArrayDouble having one component and number of tuples equal to nbTimes * this->getNumberOfTuples.
Exceptions
ifthis is not allocated or if this has not number of components set to one or if nbTimes is lower than 1.

◆ duplicateNTimes()

template<class T >
MCAuto< typename Traits< T >::ArrayType > MEDCoupling::DataArrayTemplateClassic< T >::duplicateNTimes ( mcIdType  nbTimes) const

◆ aggregate()

template<class T >
void MEDCoupling::DataArrayTemplateClassic< T >::aggregate ( const typename Traits< T >::ArrayType *  other)

◆ abs()

template<class T >
void MEDCoupling::DataArrayTemplateClassic< T >::abs

Converts every value of this array to its absolute value. WARNING this method is non const. If a new DataArrayDouble instance should be built containing the result of abs DataArrayDouble::computeAbs should be called instead.

Exceptions
Ifthis is not allocated.
See also
DataArrayDouble::computeAbs

◆ computeAbs()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplateClassic< T >::computeAbs

This method builds a new instance of this object containing the result of std::abs applied of all elements in this. This method is a const method (that do not change any values in this) contrary to DataArrayDouble::abs method.

Returns
DataArrayDouble * - the new instance of DataArrayDouble containing the same number of tuples and component as this array. The caller is to delete this result array using decrRef() as it is no more needed.
Exceptions
Ifthis is not allocated.
See also
DataArrayDouble::abs

◆ performCopyOrIncrRef()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplateClassic< T >::performCopyOrIncrRef ( bool  dCpy) const

Returns either a deep or shallow copy of this array. For more info see Deep copy of DataArray and Shallow copy of DataArray.

Parameters
[in]dCpy- if true, a deep copy is returned, else, a shallow one.
Returns
DataArrayDouble * - either a new instance of DataArrayDouble (if dCpy == true) or this instance (if dCpy == false).

References MEDCoupling::DataArrayTemplateClassic< T >::PerformCopyOrIncrRef().

Referenced by MEDCoupling::MEDCouplingTimeDiscretization::buildNewTimeReprFromThis(), MEDCoupling::MEDCouplingPointSet::MEDCouplingPointSet(), and MEDCoupling::MEDCouplingTwoTimeSteps::MEDCouplingTwoTimeSteps().

◆ sumPerTuple()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplateClassic< T >::sumPerTuple

Computes for each tuple the sum of number of components values in the tuple and return it.

Returns
DataArrayDouble * - the new instance of DataArrayDouble containing the same number of tuples as this array and one component. The caller is to delete this result array using decrRef() as it is no more needed.
Exceptions
Ifthis is not allocated.

◆ iota()

template<class T >
void MEDCoupling::DataArrayTemplateClassic< T >::iota ( init = (T)0)

Set all values in this array so that the i-th element equals to init + i (i starts from zero). To know more on filling arrays see Filling DataArray with values.

Parameters
[in]init- value to assign to the first element of array.
Exceptions
Ifthis->getNumberOfComponents() != 1
Ifthis is not allocated.

◆ reprStream()

template<class T >
void MEDCoupling::DataArrayTemplateClassic< T >::reprStream ( std::ostream &  stream) const
virtual

◆ reprZipStream()

template<class T >
void MEDCoupling::DataArrayTemplateClassic< T >::reprZipStream ( std::ostream &  stream) const
virtual

◆ reprNotTooLongStream()

template<class T >
void MEDCoupling::DataArrayTemplateClassic< T >::reprNotTooLongStream ( std::ostream &  stream) const

◆ reprWithoutNameStream()

◆ reprZipWithoutNameStream()

◆ reprNotTooLongWithoutNameStream()

template<class T >
void MEDCoupling::DataArrayTemplateClassic< T >::reprNotTooLongWithoutNameStream ( std::ostream &  stream) const

◆ repr()

template<class T >
std::string MEDCoupling::DataArrayTemplateClassic< T >::repr

Returns a textual and human readable representation of this instance of DataArrayInt. This text is shown when a DataArrayInt is printed in Python.

Returns
std::string - text describing this DataArrayInt.
See also
reprNotTooLong, reprZip

References MEDCoupling::DataArrayTemplateClassic< T >::reprStream().

◆ reprZip()

◆ reprNotTooLong()

template<class T >
std::string MEDCoupling::DataArrayTemplateClassic< T >::reprNotTooLong

This method is close to repr method except that when this has more than 1000 tuples, all tuples are not printed out to avoid to consume too much space in interpretor.

See also
repr

◆ convertToOtherTypeOfArr()

template<class T >
template<class U >
MCAuto< typename Traits< U >::ArrayType > MEDCoupling::DataArrayTemplateClassic< T >::convertToOtherTypeOfArr

◆ PerformCopyOrIncrRef()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplateClassic< T >::PerformCopyOrIncrRef ( bool  dCpy,
const typename Traits< T >::ArrayType &  self 
)
staticprotected

Returns either a deep or shallow copy of this array. For more info see Deep copy of DataArray and Shallow copy of DataArray.

Parameters
[in]dCpy- if true, a deep copy is returned, else, a shallow one.
Returns
DataArrayDouble * - either a new instance of DataArrayDouble (if dCpy == true) or this instance (if dCpy == false).

Referenced by MEDCoupling::DataArrayTemplateClassic< T >::performCopyOrIncrRef().

◆ findIdsAdv()

template<class T >
template<class OP >
MCAuto< DataArrayIdType > MEDCoupling::DataArrayTemplateClassic< T >::findIdsAdv ( const OP &  op) const
protected