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

Public Types

typedef T Type
 

Public Member Functions

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 void reprStream (std::ostream &stream) const =0
 
virtual void reprWithoutNameStream (std::ostream &stream) const
 
virtual void reprZipStream (std::ostream &stream) const =0
 
virtual void reprZipWithoutNameStream (std::ostream &stream) 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 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

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 ()
 

Protected Attributes

MemArray< T > _mem
 
- Protected Attributes inherited from MEDCoupling::DataArray
std::vector< std::string > _info_on_compo
 
std::string _name
 

Additional Inherited Members

- 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)
 

Member Typedef Documentation

◆ Type

template<class T >
typedef T MEDCoupling::DataArrayTemplate< T >::Type

Member Function Documentation

◆ NewFromStdVector()

template<class T >
MCAuto< typename Traits< T >::ArrayTypeCh > MEDCoupling::DataArrayTemplate< T >::NewFromStdVector ( const typename std::vector< T > &  v)
static

◆ NewFromArray()

template<class T >
MCAuto< typename Traits< T >::ArrayTypeCh > MEDCoupling::DataArrayTemplate< T >::NewFromArray ( const T *  arrBegin,
const T *  arrEnd 
)
static

Returns a newly created array containing a copy of the input array defined by [ arrBegin, arrEnd )

◆ explodeComponents()

template<class T >
std::vector< MCAuto< typename Traits< T >::ArrayTypeCh > > MEDCoupling::DataArrayTemplate< T >::explodeComponents

◆ printForDebug()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::printForDebug ( std::ostream &  oss) const

◆ getHeapMemorySizeWithoutChildren()

template<class T >
std::size_t MEDCoupling::DataArrayTemplate< T >::getHeapMemorySizeWithoutChildren
virtual

◆ updateTime()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::updateTime ( ) const
virtual

This method should be called on high level classes as Field or Mesh to take into account modifications done in aggregates objects.

Implements MEDCoupling::TimeLabel.

◆ getNumberOfTuples()

template<class T >
mcIdType MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples ( ) const
virtual

Implements MEDCoupling::DataArray.

Referenced by MEDCoupling::DataArrayDouble::accumulate(), MEDCoupling::DataArrayDouble::accumulatePerChunck(), MEDCoupling::MEDFileUMesh::addNodeGroup(), MEDCoupling::DataArrayDouble::Aggregate(), MEDCoupling::DataArrayDouble::applyFunc(), MEDCoupling::DataArrayDouble::applyFuncFast32(), MEDCoupling::DataArrayDouble::applyFuncFast64(), MEDCoupling::DataArrayDouble::applyFuncNamedCompo(), MEDCoupling::DataArrayDouble::applyFuncOnThis(), MEDCoupling::DataArrayDouble::areIncludedInMe(), MEDCoupling::DataArrayDouble::asArcOfCircle(), MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords(), MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords(), MEDCoupling::DataArrayDouble::buildEuclidianDistanceDenseMatrix(), MEDCoupling::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith(), MEDCoupling::MEDFileUMesh::buildInnerBoundaryAlongM1Group(), MEDCoupling::DataArrayDiscrete< T >::buildPermutationArr(), MEDCoupling::MEDCouplingCurveLinearMesh::checkConsistencyLight(), MEDCoupling::MEDCouplingTwoTimeSteps::checkConsistencyLight(), MEDCoupling::DataArrayDouble::computeBBoxPerTuple(), MEDCoupling::DataArrayDouble::computeNbOfInteractionsWith(), MEDCoupling::DataArrayDouble::computeTupleIdsNearTuples(), MEDCoupling::MEDCouplingIMesh::CondenseFineToCoarse(), MEDCoupling::MEDCouplingIMesh::CondenseFineToCoarseGhost(), MEDCoupling::MEDCouplingUMesh::conformize3D(), MEDCoupling::DataArrayInt64::convertToInt32Arr(), MEDCoupling::DataArrayInt32::convertToInt64Arr(), MEDCoupling::DataArrayDouble::count(), MEDCoupling::DataArrayDouble::CrossProduct(), MEDCoupling::DataArrayDouble::cumSum(), MEDCoupling::DataArrayTemplate< T >::deepCopyFrom(), MEDCoupling::DataArrayDouble::determinant(), MEDCoupling::DataArrayDouble::deviator(), MEDCoupling::MEDCouplingUMesh::distanceToPoints(), MEDCoupling::DataArrayDouble::distanceToTuple(), MEDCoupling::DataArrayDouble::Dot(), MEDCoupling::DataArrayDouble::doublyContractedProduct(), MEDCoupling::DataArrayDouble::eigenValues(), MEDCoupling::DataArrayDouble::eigenVectors(), MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(), MEDCoupling::MEDFileUMesh::extractPart(), MEDCoupling::DataArrayDouble::findClosestTupleId(), MEDCoupling::DataArrayDouble::findCommonTuples(), MEDCoupling::DataArrayDouble::findIdsInRange(), MEDCoupling::DataArrayDouble::findIdsNotInRange(), MEDCoupling::DataArrayDouble::fromCartToCyl(), MEDCoupling::DataArrayDouble::fromCartToCylGiven(), MEDCoupling::DataArrayDouble::fromCartToPolar(), MEDCoupling::DataArrayDouble::fromCartToSpher(), MEDCoupling::DataArrayDouble::fromCylToCart(), MEDCoupling::DataArrayDouble::fromPolarToCart(), MEDCoupling::DataArrayDouble::fromSpherToCart(), MEDCoupling::DataArrayDouble::getAverageValue(), MEDCoupling::MEDCouplingCurveLinearMesh::getCoordinatesOfNode(), MEDCoupling::DataArrayDouble::getDifferentValues(), MEDCoupling::DataArrayDouble::getMinMaxPerComponent(), MEDCoupling::MEDCouplingCMesh::getNodeGridStructure(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::MEDFileUMesh::getNumberOfNodes(), MEDCoupling::MEDFileUMesh::getSizeAtLevel(), MEDCoupling::MEDCouplingCMesh::getTinySerializationInformation(), MEDCoupling::DataArrayDouble::getTinySerializationIntInformation(), MEDCoupling::MEDCouplingTwoTimeSteps::getTinySerializationIntInformation(), MEDCoupling::MEDCouplingFieldDiscretizationKriging::getValueOnMulti(), MEDCoupling::DataArrayDiscrete< T >::indicesOfSubPart(), MEDCoupling::MEDCouplingFieldDiscretization::integral(), MEDCoupling::DataArrayDouble::inverse(), MEDCoupling::DataArrayDouble::isMonotonic(), MEDCoupling::MEDFileUMesh::linearToQuadratic(), MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell(), MEDCoupling::DataArrayDouble::magnitude(), MEDCoupling::DataArrayDouble::Max(), MEDCoupling::DataArrayDouble::maxPerTupleWithCompoId(), MEDCoupling::MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(), MEDCoupling::DataArrayDouble::Min(), MEDCoupling::DataArrayDouble::minimalDistanceTo(), MEDCoupling::MEDCouplingStructuredMesh::MultiplyPartOf(), MEDCoupling::DataArrayDouble::normMaxPerComponent(), MEDCoupling::MEDCouplingFieldDiscretizationKriging::performDrift(), MEDCoupling::MEDCouplingFieldDiscretizationKriging::PerformDriftOfVec(), MEDCoupling::MEDCouplingFieldDiscretizationKriging::PerformDriftRect(), MEDCoupling::DataArrayDouble::Pow(), MEDCoupling::DataArrayDouble::powEqual(), MEDCoupling::MEDFileUMesh::quadraticToLinear(), MEDCoupling::MEDCouplingFieldDiscretization::RenumberEntitiesFromO2NArr(), MEDCoupling::DataArrayDouble::reprCppStream(), MEDCoupling::MEDCoupling1SGTUMesh::reprQuickOverview(), MEDCoupling::MEDCoupling1DGTUMesh::reprQuickOverview(), MEDCoupling::MEDCouplingCMesh::reprQuickOverview(), MEDCoupling::MEDCouplingCurveLinearMesh::reprQuickOverview(), MEDCoupling::DataArrayDouble::reprQuickOverview(), MEDCoupling::MEDCouplingUMesh::reprQuickOverview(), MEDCoupling::DataArrayDouble::reprQuickOverviewData(), MEDCoupling::MEDCouplingCurveLinearMesh::rotate(), MEDCoupling::MEDCouplingCurveLinearMesh::scale(), MEDCoupling::MEDCouplingCMesh::serialize(), MEDCoupling::MEDFileUMesh::setCoords(), MEDCoupling::MEDFileUMesh::setCoordsForced(), MEDCoupling::MEDFileUMesh::setFamilyFieldArr(), MEDCoupling::MEDFileUMesh::setNameFieldAtLevel(), MEDCoupling::DataArrayDouble::setSelectedComponents(), MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFine(), MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFineGhost(), MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFineGhostZone(), MEDCoupling::DataArrayDouble::symmetry3DPlane(), MEDCoupling::DataArrayDouble::toVectorOfBool(), MEDCoupling::DataArrayDouble::trace(), MEDCoupling::MEDFileStructuredMesh::writeStructuredLL(), MEDCoupling::DataArrayDouble::writeVTK(), MEDCoupling::DataArrayDiscrete< T >::writeVTK(), and MEDCoupling::MEDFileUMesh::zipCoords().

◆ getNbOfElems()

◆ empty()

template<class T >
bool MEDCoupling::DataArrayTemplate< T >::empty

Checks the number of tuples.

Returns
bool - true if getNumberOfTuples() == 0, false else.
Exceptions
Ifthis is not allocated.

◆ getVoidStarPointer()

template<class T >
void* MEDCoupling::DataArrayTemplate< T >::getVoidStarPointer ( )
virtual

◆ getConstPointer()

template<class T >
const T* MEDCoupling::DataArrayTemplate< T >::getConstPointer ( ) const

Referenced by MEDCoupling::DataArrayDouble::accumulate(), MEDCoupling::DataArrayDouble::applyFunc(), MEDCoupling::DataArrayDouble::applyFuncNamedCompo(), MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField(), MEDCoupling::DataArrayDouble::buildEuclidianDistanceDenseMatrix(), MEDCoupling::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith(), MEDCoupling::MEDCouplingUMesh::buildOrthogonalField(), MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField(), MEDCoupling::DataArrayDouble::checkNoNullValues(), MEDCoupling::DataArrayDouble::computeBBoxPerTuple(), MEDCoupling::MEDCouplingCMesh::computeCellCenterOfMass(), MEDCoupling::DataArrayDouble::computeTupleIdsNearTuples(), MEDCoupling::MEDCouplingUMesh::conformize3D(), MEDCoupling::MEDCouplingUMesh::convexEnvelop2D(), MEDCoupling::DataArrayDouble::determinant(), MEDCoupling::DataArrayDouble::deviator(), MEDCoupling::DataArrayDouble::distanceToTuple(), MEDCoupling::DataArrayDouble::doubleValue(), MEDCoupling::DataArrayDouble::doublyContractedProduct(), MEDCoupling::DataArrayDouble::eigenValues(), MEDCoupling::DataArrayDouble::eigenVectors(), MEDCoupling::DataArrayDouble::findCommonTuplesAlg(), MEDCoupling::MEDCouplingPointSet::findNodesOnLine(), MEDCoupling::MEDCouplingPointSet::findNodesOnPlane(), MEDCoupling::DataArrayDouble::fromCylToCart(), MEDCoupling::DataArrayDouble::fromPolarToCart(), MEDCoupling::DataArrayDouble::fromSpherToCart(), MEDCoupling::DataArrayDouble::getAverageValue(), MEDCoupling::MEDCouplingCMesh::getBoundingBox(), MEDCoupling::MEDCoupling1SGTUMesh::getBoundingBoxForBBTree(), MEDCoupling::MEDCoupling1DGTUMesh::getBoundingBoxForBBTree(), MEDCoupling::MEDCouplingPointSet::getCaracteristicDimension(), MEDCoupling::MEDCouplingCMesh::getCellContainingPoint(), MEDCoupling::MEDCouplingUMesh::getCellsInBoundingBox(), MEDCoupling::MEDCouplingCMesh::getCoordinatesAndOwner(), MEDCoupling::MEDCouplingPointSet::getCoordinatesOfNode(), MEDCoupling::MEDCouplingUMesh::getMeasureField(), MEDCoupling::DataArrayDouble::getMinMaxPerComponent(), MEDCoupling::MEDCouplingUMesh::getPartMeasureField(), MEDCoupling::DataArrayDouble::inverse(), MEDCoupling::DataArrayDouble::isMonotonic(), MEDCoupling::DataArrayDouble::magnitude(), MEDCoupling::DataArrayDouble::maxPerTupleWithCompoId(), MEDCoupling::DataArrayDouble::norm2(), MEDCoupling::MEDCouplingFieldDiscretization::normL1(), MEDCoupling::MEDCouplingFieldDiscretization::normL2(), MEDCoupling::DataArrayDouble::normMax(), MEDCoupling::DataArrayDouble::normMaxPerComponent(), MEDCoupling::DataArrayDouble::normMin(), MEDCoupling::MEDCouplingFieldDiscretizationKriging::performDrift(), MEDCoupling::MEDCouplingUMesh::project1D(), MEDCoupling::MEDCouplingPointSet::project2DCellOnXY(), MEDCoupling::MEDCouplingFieldDiscretization::RenumberEntitiesFromN2OArr(), MEDCoupling::MEDCouplingFieldDiscretization::RenumberEntitiesFromO2NArr(), MEDCoupling::MEDCouplingPointSet::renumberNodesCenter(), MEDCoupling::DataArrayDouble::reprCppStream(), MEDCoupling::DataArrayDouble::setSelectedComponents(), MEDCoupling::DataArrayDouble::trace(), MEDCoupling::MEDCouplingCMesh::translate(), MEDCoupling::MEDCouplingCMesh::unserialization(), and MEDCoupling::MEDFileStructuredMesh::writeStructuredLL().

◆ begin()

template<class T >
const T* MEDCoupling::DataArrayTemplate< T >::begin ( ) const

Referenced by MEDCoupling::DataArrayDouble::accumulatePerChunck(), MEDCoupling::DataArrayDouble::applyFunc(), MEDCoupling::DataArrayDouble::applyFuncOnThis(), MEDCoupling::MEDCouplingUMesh::are2DCellsNotCorrectlyOriented(), MEDCoupling::MEDCouplingUMesh::arePolyhedronsNotCorrectlyOriented(), MEDCoupling::DataArrayDouble::asArcOfCircle(), MEDCoupling::DataArrayDiscrete< T >::buildPermutationArr(), MEDCoupling::MEDCouplingUMesh::colinearizeEdges(), MEDCoupling::MEDCouplingUMesh::computeCellCenterOfMass(), MEDCoupling::MEDCoupling1SGTUMesh::computeIsoBarycenterOfNodesPerCell(), MEDCoupling::MEDCoupling1DGTUMesh::computeIsoBarycenterOfNodesPerCell(), MEDCoupling::MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell(), MEDCoupling::DataArrayDouble::computeNbOfInteractionsWith(), MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces(), MEDCoupling::DataArrayDouble::computeTupleIdsNearTuples(), MEDCoupling::MEDCouplingIMesh::CondenseFineToCoarse(), MEDCoupling::MEDCouplingIMesh::CondenseFineToCoarseGhost(), MEDCoupling::MEDCouplingUMesh::conformize3D(), MEDCoupling::DataArrayInt64::convertToInt32Arr(), MEDCoupling::DataArrayInt32::convertToInt64Arr(), MEDCoupling::DataArrayDouble::count(), MEDCoupling::DataArrayDouble::CrossProduct(), MEDCoupling::DataArrayDouble::cumSum(), MEDCoupling::DataArrayTemplate< T >::deepCopyFrom(), MEDCoupling::MEDCouplingUMesh::distanceToPoints(), MEDCoupling::DataArrayDouble::Dot(), MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(), MEDCoupling::MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatch(), MEDCoupling::MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatchGhost(), MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells(), MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells(), MEDCoupling::DataArrayDouble::findClosestTupleId(), MEDCoupling::DataArrayDouble::findCommonTuples(), MEDCoupling::DataArrayDouble::findIdsInRange(), MEDCoupling::DataArrayDouble::findIdsNotInRange(), MEDCoupling::DataArrayDouble::fromCartToCyl(), MEDCoupling::DataArrayDouble::fromCartToCylGiven(), MEDCoupling::DataArrayDouble::fromCartToPolar(), MEDCoupling::DataArrayDouble::fromCartToSpher(), MEDCoupling::MEDCouplingUMesh::getAspectRatioField(), MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic(), MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic(), MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast(), MEDCoupling::MEDCouplingMappedExtrudedMesh::getCoordinatesAndOwner(), MEDCoupling::MEDCouplingCurveLinearMesh::getCoordinatesOfNode(), MEDCoupling::MEDCouplingUMesh::getEdgeRatioField(), MEDCoupling::MEDCouplingUMesh::getFastAveragePlaneOfThis(), MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner(), MEDCoupling::MEDCouplingUMesh::getSkewField(), MEDCoupling::MEDCouplingFieldDiscretizationKriging::getValueOnMulti(), MEDCoupling::MEDCouplingUMesh::getWarpField(), MEDCoupling::DataArrayDiscrete< T >::indicesOfSubPart(), MEDCoupling::MEDCouplingFieldDiscretization::integral(), MEDCoupling::MEDCouplingFieldDiscretizationGaussNE::integral(), MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell(), MEDCoupling::DataArrayDouble::Max(), MEDCoupling::DataArrayDouble::Min(), MEDCoupling::DataArrayDouble::minimalDistanceTo(), MEDCoupling::MEDCouplingUMesh::orientCorrectly2DCells(), MEDCoupling::MEDCouplingUMesh::orientCorrectlyPolyhedrons(), MEDCoupling::MEDCouplingFieldDiscretizationKriging::PerformDriftOfVec(), MEDCoupling::MEDCouplingFieldDiscretizationKriging::PerformDriftRect(), MEDCoupling::DataArrayDouble::Pow(), MEDCoupling::DataArrayDouble::powEqual(), MEDCoupling::DataArrayDouble::reprQuickOverviewData(), MEDCoupling::MEDCoupling1SGTUMesh::serialize(), MEDCoupling::MEDCoupling1DGTUMesh::serialize(), MEDCoupling::MEDCouplingCurveLinearMesh::serialize(), MEDCoupling::MEDCouplingMappedExtrudedMesh::serialize(), MEDCoupling::MEDCouplingUMesh::SimplifyPolyhedronCell(), MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFine(), MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFineGhost(), MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFineGhostZone(), MEDCoupling::DataArrayDouble::symmetry3DPlane(), MEDCoupling::MEDCouplingUMesh::tetrahedrize(), MEDCoupling::DataArrayDouble::toVectorOfBool(), MEDCoupling::MEDCoupling1SGTUMesh::unserialization(), MEDCoupling::MEDCoupling1DGTUMesh::unserialization(), MEDCoupling::MEDCouplingCurveLinearMesh::unserialization(), MEDCoupling::MEDCouplingMappedExtrudedMesh::unserialization(), and MEDCoupling::DataArrayDouble::writeVTK().

◆ end()

◆ rwBegin()

template<class T >
T* MEDCoupling::DataArrayTemplate< T >::rwBegin ( )

◆ rwEnd()

template<class T >
T* MEDCoupling::DataArrayTemplate< T >::rwEnd ( )

◆ alloc()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::alloc ( std::size_t  nbOfTuple,
std::size_t  nbOfCompo = 1 
)
virtual

Allocates the raw data in memory. If the memory was already allocated, then it is freed and re-allocated. See an example of this method use here.

Parameters
[in]nbOfTuple- number of tuples of data to allocate.
[in]nbOfCompo- number of components of data to allocate.
Exceptions
IfnbOfTuple < 0 or nbOfCompo < 0.

Implements MEDCoupling::DataArray.

Referenced by MEDCoupling::DataArrayDouble::applyFunc(), MEDCoupling::MEDCouplingCurveLinearMesh::buildOrthogonalField(), MEDCoupling::MEDCouplingCMesh::computeCellCenterOfMass(), MEDCoupling::DataArrayDouble::CrossProduct(), MEDCoupling::DataArrayDouble::determinant(), MEDCoupling::DataArrayDouble::deviator(), MEDCoupling::DataArrayDouble::Dot(), MEDCoupling::DataArrayDouble::doublyContractedProduct(), MEDCoupling::DataArrayDouble::eigenValues(), MEDCoupling::DataArrayDouble::eigenVectors(), MEDCoupling::DataArrayDouble::fromCylToCart(), MEDCoupling::DataArrayDouble::fromPolarToCart(), MEDCoupling::DataArrayDouble::fromSpherToCart(), MEDCoupling::MEDCouplingCMesh::getMeasureField(), MEDCoupling::MEDCouplingIMesh::getMeasureField(), MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner(), MEDCoupling::DataArrayDouble::inverse(), MEDCoupling::DataArrayDouble::magnitude(), MEDCoupling::ParaFIELD::ParaFIELD(), MEDCoupling::MEDCouplingPointSet::renumberNodesCenter(), MEDCoupling::MEDCouplingCMesh::resizeForUnserialization(), MEDCoupling::MEDCouplingIMesh::resizeForUnserialization(), MEDCoupling::MEDCouplingMappedExtrudedMesh::resizeForUnserialization(), MEDCoupling::MEDCouplingPointSet::resizeForUnserialization(), MEDCoupling::DataArrayDouble::resizeForUnserialization(), MEDCoupling::MEDCouplingTwoTimeSteps::resizeForUnserialization(), MEDCoupling::MEDCoupling1SGTUMesh::serialize(), MEDCoupling::MEDCoupling1DGTUMesh::serialize(), MEDCoupling::MEDCouplingCMesh::serialize(), MEDCoupling::MEDCouplingCurveLinearMesh::serialize(), MEDCoupling::MEDCouplingIMesh::serialize(), MEDCoupling::MEDCouplingMappedExtrudedMesh::serialize(), and MEDCoupling::DataArrayDouble::trace().

◆ useArray()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::useArray ( const T *  array,
bool  ownership,
DeallocType  type,
std::size_t  nbOfTuple,
std::size_t  nbOfCompo 
)

Sets a C array to be used as raw data of this. The previously set info of components is retained and re-sized. For more info see Building an array from scratch in C++.

Parameters
[in]array- the C array to be used as raw data of this.
[in]ownership- if true, array will be deallocated at destruction of this.
[in]type- specifies how to deallocate array. If type == MEDCoupling::CPP_DEALLOC, delete [] array; will be called. If type == MEDCoupling::C_DEALLOC, free(array ) will be called.
[in]nbOfTuple- new number of tuples in this.
[in]nbOfCompo- new number of components in this.

◆ useExternalArrayWithRWAccess()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::useExternalArrayWithRWAccess ( const T *  array,
std::size_t  nbOfTuple,
std::size_t  nbOfCompo 
)

◆ getIJSafe()

template<class T >
T MEDCoupling::DataArrayTemplate< T >::getIJSafe ( std::size_t  tupleId,
std::size_t  compoId 
) const

Returns a value located at specified tuple and component. This method is equivalent to DataArrayTemplate<T>::getIJ() except that validity of parameters is checked. So this method is safe but expensive if used to go through all values of this.

Parameters
[in]tupleId- index of tuple of interest.
[in]compoId- index of component of interest.
Returns
double - value located by tupleId and compoId.
Exceptions
Ifthis is not allocated.
Ifcondition ( 0 <= tupleId < this->getNumberOfTuples() ) is violated.
Ifcondition ( 0 <= compoId < this->getNumberOfComponents() ) is violated.

◆ getIJ()

◆ setIJ()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::setIJ ( std::size_t  tupleId,
std::size_t  compoId,
newVal 
)

◆ setIJSilent()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::setIJSilent ( std::size_t  tupleId,
std::size_t  compoId,
newVal 
)

◆ getPointer()

template<class T >
T* MEDCoupling::DataArrayTemplate< T >::getPointer ( )

Referenced by MEDCoupling::DataArrayDouble::applyFunc(), MEDCoupling::DataArrayDouble::applyFuncFast32(), MEDCoupling::DataArrayDouble::applyFuncFast64(), MEDCoupling::DataArrayDouble::applyFuncOnThis(), MEDCoupling::DataArrayDouble::applyInv(), MEDCoupling::DataArrayDouble::applyPow(), MEDCoupling::DataArrayDouble::applyRPow(), MEDCoupling::MEDCouplingCurveLinearMesh::buildOrthogonalField(), MEDCoupling::MEDCouplingCMesh::computeCellCenterOfMass(), MEDCoupling::MEDCoupling1SGTUMesh::computeDiameterField(), MEDCoupling::MEDCouplingUMesh::computeDiameterField(), MEDCoupling::MEDCouplingIMesh::CondenseFineToCoarse(), MEDCoupling::MEDCouplingIMesh::CondenseFineToCoarseGhost(), MEDCoupling::DataArrayDouble::CrossProduct(), MEDCoupling::DataArrayDouble::determinant(), MEDCoupling::DataArrayDouble::deviator(), MEDCoupling::DataArrayDouble::Dot(), MEDCoupling::DataArrayDouble::doublyContractedProduct(), MEDCoupling::DataArrayDouble::eigenValues(), MEDCoupling::DataArrayDouble::eigenVectors(), MEDCoupling::MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatch(), MEDCoupling::MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatchGhost(), MEDCoupling::DataArrayDouble::fromCylToCart(), MEDCoupling::DataArrayDouble::fromPolarToCart(), MEDCoupling::DataArrayDouble::fromSpherToCart(), MEDCoupling::MEDCouplingCMesh::getMeasureField(), MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner(), MEDCoupling::DataArrayDouble::inverse(), MEDCoupling::DataArrayDouble::magnitude(), MEDCoupling::MEDCouplingStructuredMesh::MultiplyPartOf(), MEDCoupling::DataArrayDouble::powEqual(), MEDCoupling::MEDCouplingMappedExtrudedMesh::Project1DMeshes(), MEDCoupling::MEDCouplingFieldDiscretization::RenumberEntitiesFromN2OArr(), MEDCoupling::MEDCouplingFieldDiscretization::RenumberEntitiesFromO2NArr(), MEDCoupling::MEDCouplingPointSet::renumberNodesCenter(), MEDCoupling::MEDCouplingCurveLinearMesh::rotate(), MEDCoupling::MEDCouplingPointSet::rotate2D(), MEDCoupling::MEDCouplingPointSet::rotate3D(), MEDCoupling::MEDCouplingCMesh::scale(), MEDCoupling::MEDCouplingCurveLinearMesh::scale(), MEDCoupling::MEDCouplingPointSet::scale(), MEDCoupling::MEDCoupling1SGTUMesh::serialize(), MEDCoupling::MEDCoupling1DGTUMesh::serialize(), MEDCoupling::MEDCouplingCMesh::serialize(), MEDCoupling::MEDCouplingCurveLinearMesh::serialize(), MEDCoupling::MEDCouplingMappedExtrudedMesh::serialize(), MEDCoupling::DataArrayDouble::setSelectedComponents(), MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFine(), MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFineGhost(), MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFineGhostZone(), MEDCoupling::DataArrayDouble::trace(), MEDCoupling::MEDCouplingCMesh::translate(), MEDCoupling::MEDCouplingCurveLinearMesh::translate(), MEDCoupling::MEDCouplingPointSet::translate(), MEDCoupling::MEDCoupling1SGTUMesh::unserialization(), MEDCoupling::MEDCoupling1DGTUMesh::unserialization(), and MEDCoupling::MEDCouplingMappedExtrudedMesh::unserialization().

◆ getPointerSilent()

template<class T >
T* MEDCoupling::DataArrayTemplate< T >::getPointerSilent ( )

◆ pack()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::pack

This method do not modify content of this. It only modify its memory footprint if the allocated memory is to high regarding real data to store.

See also
DataArray::getHeapMemorySizeWithoutChildren, DataArrayTemplate<T>::reserve

◆ isAllocated()

template<class T >
bool MEDCoupling::DataArrayTemplate< T >::isAllocated
overridevirtual

Checks if raw data is allocated. Read more on the raw data in DataArrays infos for more information.

Returns
bool - true if the raw data is allocated, false else.

Implements MEDCoupling::DataArray.

Referenced by MEDCoupling::MEDCouplingCurveLinearMesh::checkConsistencyLight(), MEDCoupling::DataArrayDouble::computeNbOfInteractionsWith(), MEDCoupling::MEDCouplingIMesh::CondenseFineToCoarse(), MEDCoupling::MEDCouplingIMesh::CondenseFineToCoarseGhost(), MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch(), MEDCoupling::MEDCouplingCartesianAMRMeshGen::createPatchesFromCriterion(), MEDCoupling::DataArrayDouble::doubleValue(), MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(), MEDCoupling::MEDCouplingCartesianAMRMeshGen::fillCellFieldComingFromPatch(), MEDCoupling::MEDCouplingCartesianAMRMeshGen::fillCellFieldComingFromPatchGhost(), MEDCoupling::MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatch(), MEDCoupling::MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatchGhost(), MEDCoupling::MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatchOnlyOnGhostZone(), MEDCoupling::DataArrayDouble::finishUnserialization(), MEDCoupling::MEDCouplingCMesh::getNodeGridStructure(), MEDCoupling::DataArrayDouble::getTinySerializationIntInformation(), MEDCoupling::DataArrayDouble::getTinySerializationStrInformation(), MEDCoupling::MEDCouplingFieldDiscretizationKriging::getValueOnMulti(), MEDCoupling::MEDCouplingPointSet::MergeNodesArray(), MEDCoupling::MEDCouplingStructuredMesh::MultiplyPartOf(), MEDCoupling::MEDCouplingFieldDiscretizationKriging::PerformDriftOfVec(), MEDCoupling::MEDCouplingFieldDiscretizationKriging::PerformDriftRect(), MEDCoupling::MEDCoupling1SGTUMesh::reprQuickOverview(), MEDCoupling::MEDCoupling1DGTUMesh::reprQuickOverview(), MEDCoupling::MEDCouplingCurveLinearMesh::reprQuickOverview(), MEDCoupling::DataArrayDouble::reprQuickOverview(), MEDCoupling::MEDCouplingUMesh::reprQuickOverview(), MEDCoupling::MEDCoupling1SGTUMesh::serialize(), MEDCoupling::MEDCoupling1DGTUMesh::serialize(), MEDCoupling::MEDCouplingCurveLinearMesh::serialize(), MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFine(), MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFineGhost(), and MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFineGhostZone().

◆ checkAllocated()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::checkAllocated
virtual

Checks if raw data is allocated and throws an exception if it is not the case.

Exceptions
Ifthe raw data is not allocated.

Implements MEDCoupling::DataArray.

Referenced by MEDCoupling::DataArrayDouble::accumulate(), MEDCoupling::DataArrayDouble::accumulatePerChunck(), MEDCoupling::DataArrayDouble::applyFunc(), MEDCoupling::DataArrayDouble::applyFuncFast32(), MEDCoupling::DataArrayDouble::applyFuncFast64(), MEDCoupling::DataArrayDouble::applyFuncNamedCompo(), MEDCoupling::DataArrayDouble::applyFuncOnThis(), MEDCoupling::DataArrayDouble::applyInv(), MEDCoupling::DataArrayDouble::applyPow(), MEDCoupling::DataArrayDouble::applyRPow(), MEDCoupling::DataArrayDouble::areIncludedInMe(), MEDCoupling::DataArrayDouble::asArcOfCircle(), MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords(), MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords(), MEDCoupling::DataArrayDouble::buildEuclidianDistanceDenseMatrix(), MEDCoupling::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith(), MEDCoupling::DataArrayDiscrete< T >::buildPermutationArr(), MEDCoupling::DataArrayDouble::cartesianize(), MEDCoupling::DataArrayDouble::computeBBoxPerTuple(), MEDCoupling::DataArrayDouble::computeTupleIdsNearTuples(), MEDCoupling::DataArrayInt64::convertToInt32Arr(), MEDCoupling::DataArrayInt32::convertToInt64Arr(), MEDCoupling::DataArrayDouble::count(), MEDCoupling::DataArrayDouble::cumSum(), MEDCoupling::DataArrayTemplate< T >::deepCopyFrom(), MEDCoupling::DataArrayDouble::determinant(), MEDCoupling::DataArrayDouble::deviator(), MEDCoupling::MEDCouplingUMesh::distanceToPoints(), MEDCoupling::DataArrayDouble::distanceToTuple(), MEDCoupling::DataArrayDouble::Dot(), MEDCoupling::DataArrayDouble::doublyContractedProduct(), MEDCoupling::DataArrayDouble::eigenValues(), MEDCoupling::DataArrayDouble::eigenVectors(), MEDCoupling::DataArrayDouble::findClosestTupleId(), MEDCoupling::DataArrayDouble::findCommonTuples(), MEDCoupling::DataArrayDouble::findIdsInRange(), MEDCoupling::DataArrayDouble::findIdsNotInRange(), MEDCoupling::DataArrayDouble::fromCartToCyl(), MEDCoupling::DataArrayDouble::fromCartToCylGiven(), MEDCoupling::DataArrayDouble::fromCartToPolar(), MEDCoupling::DataArrayDouble::fromCartToSpher(), MEDCoupling::DataArrayDouble::fromCylToCart(), MEDCoupling::DataArrayDouble::fromPolarToCart(), MEDCoupling::DataArrayDouble::fromSpherToCart(), MEDCoupling::DataArrayDouble::getDifferentValues(), MEDCoupling::DataArrayDouble::getMinMaxPerComponent(), MEDCoupling::DataArrayDiscrete< T >::indicesOfSubPart(), MEDCoupling::DataArrayDouble::inverse(), MEDCoupling::DataArrayDouble::isMonotonic(), MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell(), MEDCoupling::DataArrayDouble::magnitude(), MEDCoupling::DataArrayDouble::maxPerTupleWithCompoId(), MEDCoupling::DataArrayDouble::norm2(), MEDCoupling::DataArrayDouble::normMax(), MEDCoupling::DataArrayDouble::normMaxPerComponent(), MEDCoupling::DataArrayDouble::normMin(), MEDCoupling::DataArrayDouble::recenterForMaxPrecision(), MEDCoupling::MEDFileUMesh::setCoords(), MEDCoupling::MEDFileUMesh::setCoordsForced(), MEDCoupling::DataArrayDouble::setSelectedComponents(), MEDCoupling::DataArrayDouble::symmetry3DPlane(), MEDCoupling::DataArrayDouble::toVectorOfBool(), MEDCoupling::DataArrayDouble::trace(), and MEDCoupling::DataArrayDouble::writeVTK().

◆ desallocate()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::desallocate
virtual

This method deallocated this without modification of information relative to the components. After call of this method, DataArrayDouble::isAllocated will return false. If this is already not allocated, this is let unchanged.

Implements MEDCoupling::DataArray.

◆ reserve()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::reserve ( std::size_t  nbOfElems)

This method reserve nbOfElems elements in memory ( nbOfElems*sizeof(T) ) without impacting the number of tuples in this. If this has already been allocated, this method checks that this has only one component. If not an INTERP_KERNEL::Exception will be thrown. If this has not already been allocated, number of components is set to one. This method allows to reduce number of reallocations on invocation of DataArrayDouble::pushBackSilent and DataArrayDouble::pushBackValsSilent on this.

See also
DataArrayDouble::pack, DataArrayDouble::pushBackSilent, DataArrayDouble::pushBackValsSilent

◆ rearrange()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::rearrange ( std::size_t  newNbOfCompo)
virtual

Changes the number of components within this array so that its raw data does not change, instead splitting this data into tuples changes.

Warning
This method erases all (name and unit) component info set before!
Parameters
[in]newNbOfCompo- number of components for this array to have.
Exceptions
Ifthis is not allocated
IfgetNbOfElems() % newNbOfCompo != 0.
IfnewNbOfCompo is lower than 1.
Ifthe rearrange method would lead to a number of tuples higher than 2147483647 (maximal capacity of int32 !).
Warning
This method erases all (name and unit) component info set before!

Implements MEDCoupling::DataArray.

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

◆ transpose()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::transpose

Changes the number of components within this array to be equal to its number of tuples, and inversely its number of tuples to become equal to its number of components. So that its raw data does not change, instead splitting this data into tuples changes.

Warning
This method erases all (name and unit) component info set before!
Do not confuse this method with fromNoInterlace() and toNoInterlace()!
Exceptions
Ifthis is not allocated.
See also
rearrange()

◆ pushBackSilent()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::pushBackSilent ( val)

This method adds at the end of this the single value val. This method do not update its time label to avoid useless incrementation of counter. So the caller is expected to call TimeLabel::declareAsNew on this at the end of the push session.

Parameters
[in]valthe value to be added in this
Exceptions
Ifthis has already been allocated with number of components different from one.
See also
DataArrayDouble::pushBackValsSilent

◆ pushBackValsSilent()

template<class T >
template<class InputIterator >
void MEDCoupling::DataArrayTemplate< T >::pushBackValsSilent ( InputIterator  valsBg,
InputIterator  valsEnd 
)

This method adds at the end of this a series of values [valsBg,valsEnd). This method do not update its time label to avoid useless incrementation of counter. So the caller is expected to call TimeLabel::declareAsNew on this at the end of the push session.

Parameters
[in]valsBg- an array of values to push at the end of this.
[in]valsEnd- specifies the end of the array valsBg, so that the last value of valsBg is valsEnd[ -1 ].
Exceptions
Ifthis has already been allocated with number of components different from one.
See also
DataArrayDouble::pushBackSilent

◆ popBackSilent()

template<class T >
T MEDCoupling::DataArrayTemplate< T >::popBackSilent

This method returns silently ( without updating time label in this ) the last value, if any and suppress it.

Exceptions
Ifthis is already empty.
Ifthis has number of components different from one.

◆ front()

template<class T >
T MEDCoupling::DataArrayTemplate< T >::front

Returns the first value of this.

Returns
double - the last value of this array.
Exceptions
Ifthis is not allocated.
Ifthis->getNumberOfComponents() != 1.
Ifthis->getNumberOfTuples() < 1.

Referenced by MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords().

◆ back()

template<class T >
T MEDCoupling::DataArrayTemplate< T >::back

Returns the last value of this.

Returns
double - the last value of this array.
Exceptions
Ifthis is not allocated.
Ifthis->getNumberOfComponents() != 1.
Ifthis->getNumberOfTuples() < 1.

◆ getNbOfElemAllocated()

template<class T >
std::size_t MEDCoupling::DataArrayTemplate< T >::getNbOfElemAllocated ( ) const
virtual

◆ allocIfNecessary()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::allocIfNecessary ( std::size_t  nbOfTuple,
std::size_t  nbOfCompo 
)

Allocates the raw data in memory. If exactly same memory as needed already allocated, it is not re-allocated.

Parameters
[in]nbOfTuple- number of tuples of data to allocate.
[in]nbOfCompo- number of components of data to allocate.
Exceptions
IfnbOfTuple < 0 or nbOfCompo < 0.

◆ deepCopyFrom()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::deepCopyFrom ( const DataArrayTemplate< T > &  other)

◆ reverse()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::reverse

Reverse the array values.

Exceptions
Ifthis->getNumberOfComponents() < 1.
Ifthis is not allocated.

◆ fillWithValue()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::fillWithValue ( val)

Assign val to all values in this array. To know more on filling arrays see Filling DataArray with values.

Parameters
[in]val- the value to fill with.
Exceptions
Ifthis is not allocated.

Referenced by MEDCoupling::DataArrayDouble::applyFuncOnThis(), and MEDCoupling::MEDCouplingIMesh::getMeasureField().

◆ reAlloc()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::reAlloc ( std::size_t  nbOfTuples)
virtual

Changes number of tuples in the array. If the new number of tuples is smaller than the current number the array is truncated, otherwise the array is extended.

Parameters
[in]nbOfTuples- new number of tuples.
Exceptions
Ifthis is not allocated.
IfnbOfTuples is negative.

Implements MEDCoupling::DataArray.

Referenced by MEDCoupling::MEDCouplingFieldDiscretization::RenumberEntitiesFromN2OArr(), and MEDCoupling::MEDCouplingFieldDiscretization::RenumberEntitiesFromO2NArr().

◆ renumberInPlace()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::renumberInPlace ( const mcIdType *  old2New)
virtual

Permutes values of this array as required by old2New array. The values are permuted so that new[ old2New[ i ]] = old[ i ]. Number of tuples remains the same as in this one. If a permutation reduction is needed, subArray() or selectByTupleId() should be used. For more info on renumbering see Array indexing and numbering.

Parameters
[in]old2New- C array of length equal to this->getNumberOfTuples() giving a new position for i-th old value.

Implements MEDCoupling::DataArray.

◆ renumberInPlaceR()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::renumberInPlaceR ( const mcIdType *  new2Old)
virtual

Permutes values of this array as required by new2Old array. The values are permuted so that new[ i ] = old[ new2Old[ i ]]. Number of tuples remains the same as in this one. For more info on renumbering see Array indexing and numbering.

Parameters
[in]new2Old- C array of length equal to this->getNumberOfTuples() giving a previous position of i-th new value.

Implements MEDCoupling::DataArray.

◆ sort()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::sort ( bool  asc = true)

Sorts values of the array. Warning, this method is not const, it alterates this content.

Parameters
[in]asc- true means ascending order, false, descending.
Exceptions
Ifthis is not allocated.
Ifthis->getNumberOfComponents() != 1.
See also
copySorted

◆ sortPerTuple()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::sortPerTuple ( bool  asc)

Sorts value within every tuple of this array.

Parameters
[in]asc- if true, the values are sorted in ascending order, else, in descending order.
Exceptions
Ifthis is not allocated.

◆ renumber()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplate< T >::renumber ( const mcIdType *  old2New) const

Returns a copy of this array with values permuted as required by old2New array. The values are permuted so that new[ old2New[ i ]] = old[ i ]. Number of tuples in the result array remains the same as in this one. If a permutation reduction is needed, renumberAndReduce() should be used. For more info on renumbering see Array indexing and numbering.

Parameters
[in]old2New- C array of length equal to this->getNumberOfTuples() giving a new position for i-th old value.
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.

◆ renumberR()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplate< T >::renumberR ( const mcIdType *  new2Old) const

Returns a copy of this array with values permuted as required by new2Old array. The values are permuted so that new[ i ] = old[ new2Old[ i ]]. Number of tuples in the result array remains the same as in this one. If a permutation reduction is needed, subArray() or selectByTupleId() should be used. For more info on renumbering see Array indexing and numbering.

Parameters
[in]new2Old- C array of length equal to this->getNumberOfTuples() giving a previous position of i-th new value.
Returns
DataArrayDouble * - the new instance of DataArrayDouble that the caller is to delete using decrRef() as it is no more needed.

◆ renumberAndReduce()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplate< T >::renumberAndReduce ( const mcIdType *  old2New,
mcIdType  newNbOfTuple 
) const

Returns a shorten and permuted copy of this array. The new DataArrayDouble is of size newNbOfTuple and it's values are permuted as required by old2New array. The values are permuted so that new[ old2New[ i ]] = old[ i ] for all old2New[ i ] >= 0. In other words every i-th tuple in this array, for which old2New[ i ] is negative, is missing from the result array. For more info on renumbering see Array indexing and numbering.

Parameters
[in]old2New- C array of length equal to this->getNumberOfTuples() giving a new position for i-th old tuple and giving negative position for for i-th old tuple that should be omitted.
Returns
DataArrayDouble * - the new instance of DataArrayDouble that the caller is to delete using decrRef() as it is no more needed.

Referenced by MEDCoupling::DataArrayDouble::getDifferentValues(), MEDCoupling::MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(), and MEDCoupling::MEDCouplingPointSet::renumberNodes().

◆ changeNbOfComponents()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplate< T >::changeNbOfComponents ( std::size_t  newNbOfComp,
dftValue 
) const

Returns a shorten or extended copy of this array. If newNbOfComp is less than this->getNumberOfComponents() then the result array is shorten as each tuple is truncated to have newNbOfComp components, keeping first components. If newNbOfComp is more than this->getNumberOfComponents() then the result array is expanded as each tuple is populated with dftValue to have newNbOfComp components.

Parameters
[in]newNbOfComp- number of components for the new array to have.
[in]dftValue- value assigned to new values added to the new array.
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.

Referenced by MEDCoupling::MEDCouplingPointSet::changeSpaceDimension(), and MEDCoupling::MEDCouplingUMesh::writeVTKLL().

◆ subArray()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplate< T >::subArray ( mcIdType  tupleIdBg,
mcIdType  tupleIdEnd = -1 
) const

Returns a shorten copy of this array. The new DataArrayDouble contains all tuples starting from the tupleIdBg-th tuple and including all tuples located before the tupleIdEnd-th one. This methods has a similar behavior as std::string::substr(). This method is a specialization of selectByTupleIdSafeSlice().

Parameters
[in]tupleIdBg- index of the first tuple to copy from this array.
[in]tupleIdEnd- index of the tuple before which the tuples to copy are located. If tupleIdEnd == -1, all the tuples till the end of this array are copied.
Returns
DataArrayDouble * - the new instance of DataArrayDouble that the caller is to delete using decrRef() as it is no more needed.
Exceptions
IftupleIdBg < 0.
IftupleIdBg > this->getNumberOfTuples().
IftupleIdEnd != -1 && tupleIdEnd < this->getNumberOfTuples().
See also
DataArrayDouble::selectByTupleIdSafeSlice

◆ selectPartDef()

template<class T >
MCAuto< typename Traits< T >::ArrayTypeCh > MEDCoupling::DataArrayTemplate< T >::selectPartDef ( const PartDefinition *  pd) const

◆ circularPermutation()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::circularPermutation ( mcIdType  nbOfShift = 1)
virtual

◆ circularPermutationPerTuple()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::circularPermutationPerTuple ( mcIdType  nbOfShift = 1)
virtual

◆ reversePerTuple()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::reversePerTuple
virtual

◆ setPartOfValues1()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::setPartOfValues1 ( const typename Traits< T >::ArrayType *  a,
mcIdType  bgTuples,
mcIdType  endTuples,
mcIdType  stepTuples,
mcIdType  bgComp,
mcIdType  endComp,
mcIdType  stepComp,
bool  strictCompoCompare = true 
)

Copy all values from another DataArrayDouble into specified tuples and components of this array. Textual data is not copied. The tree parameters defining set of indices of tuples and components are similar to the tree parameters of the Python function range(start,stop,step).

Parameters
[in]a- the array to copy values from.
[in]bgTuples- index of the first tuple of this array to assign values to.
[in]endTuples- index of the tuple before which the tuples to assign to are located.
[in]stepTuples- index increment to get index of the next tuple to assign to.
[in]bgComp- index of the first component of this array to assign values to.
[in]endComp- index of the component before which the components to assign to are located.
[in]stepComp- index increment to get index of the next component to assign to.
[in]strictCompoCompare- if true (by default), then a->getNumberOfComponents() must be equal to the number of columns to assign to, else an exception is thrown; if false, then it is only required that a->getNbOfElems() equals to number of values to assign to (this condition must be respected even if strictCompoCompare is true). The number of values to assign to is given by following Python expression: nbTargetValues = len(range(bgTuples,endTuples,stepTuples)) * len(range(bgComp,endComp,stepComp)).
Exceptions
Ifa is NULL.
Ifa is not allocated.
Ifthis is not allocated.
Ifparameters specifying tuples and components to assign to do not give a non-empty range of increasing indices.
Ifa->getNbOfElems() != nbTargetValues.
IfstrictCompoCompare == true && a->getNumberOfComponents() != len(range(bgComp,endComp,stepComp)).

Here is a Python example.

References MEDCoupling::DataArray::CheckValueInRangeEx(), and MEDCoupling::DataArray::GetNumberOfItemGivenBES().

◆ setPartOfValuesSimple1()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::setPartOfValuesSimple1 ( a,
mcIdType  bgTuples,
mcIdType  endTuples,
mcIdType  stepTuples,
mcIdType  bgComp,
mcIdType  endComp,
mcIdType  stepComp 
)

Assign a given value to values at specified tuples and components of this array. The tree parameters defining set of indices of tuples and components are similar to the tree parameters of the Python function range(start,stop,step)..

Parameters
[in]a- the value to assign.
[in]bgTuples- index of the first tuple of this array to assign to.
[in]endTuples- index of the tuple before which the tuples to assign to are located.
[in]stepTuples- index increment to get index of the next tuple to assign to.
[in]bgComp- index of the first component of this array to assign to.
[in]endComp- index of the component before which the components to assign to are located.
[in]stepComp- index increment to get index of the next component to assign to.
Exceptions
Ifthis is not allocated.
Ifparameters specifying tuples and components to assign to, do not give a non-empty range of increasing indices or indices are out of a valid range for this array.

Here is a Python example.

References MEDCoupling::DataArray::CheckValueInRangeEx(), and MEDCoupling::DataArray::GetNumberOfItemGivenBES().

◆ setPartOfValues2()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::setPartOfValues2 ( const typename Traits< T >::ArrayType *  a,
const mcIdType *  bgTuples,
const mcIdType *  endTuples,
const mcIdType *  bgComp,
const mcIdType *  endComp,
bool  strictCompoCompare = true 
)

Copy all values from another DataArrayDouble (a) into specified tuples and components of this array. Textual data is not copied. The tuples and components to assign to are defined by C arrays of indices. There are two modes of usage:

  • If a->getNbOfElems() equals to number of values to assign to, then every value of a is assigned to its own location within this array.
  • If a includes one tuple, then all values of a are assigned to the specified components of every specified tuple of this array. In this mode it is required that a->getNumberOfComponents() equals to the number of specified components.
Parameters
[in]a- the array to copy values from.
[in]bgTuples- pointer to an array of tuple indices of this array to assign values of a to.
[in]endTuples- specifies the end of the array bgTuples, so that pointer to a tuple index (pi) varies as this: bgTuples <= pi < endTuples.
[in]bgComp- pointer to an array of component indices of this array to assign values of a to.
[in]endComp- specifies the end of the array bgTuples, so that pointer to a component index (pi) varies as this: bgComp <= pi < endComp.
[in]strictCompoCompare- this parameter is checked only if the mode of usage is the first; if it is true (default), then a->getNumberOfComponents() must be equal to the number of specified columns, else this is not required.
Exceptions
Ifa is NULL.
Ifa is not allocated.
Ifthis is not allocated.
Ifany index of tuple/component given by bgTuples / bgComp is out of a valid range for this array.
Inthe first mode of usage, if strictCompoCompare == true and if a->getNumberOfComponents() != (endComp - bgComp) .
Inthe second mode of usage, if a->getNumberOfTuples() != 1 or a->getNumberOfComponents() != (endComp - bgComp).

Here is a Python example.

References MEDCoupling::DataArray::CheckValueInRange().

◆ setPartOfValuesSimple2()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::setPartOfValuesSimple2 ( a,
const mcIdType *  bgTuples,
const mcIdType *  endTuples,
const mcIdType *  bgComp,
const mcIdType *  endComp 
)

Assign a given value to values at specified tuples and components of this array. The tuples and components to assign to are defined by C arrays of indices.

Parameters
[in]a- the value to assign.
[in]bgTuples- pointer to an array of tuple indices of this array to assign a to.
[in]endTuples- specifies the end of the array bgTuples, so that pointer to a tuple index (pi) varies as this: bgTuples <= pi < endTuples.
[in]bgComp- pointer to an array of component indices of this array to assign a to.
[in]endComp- specifies the end of the array bgTuples, so that pointer to a component index (pi) varies as this: bgComp <= pi < endComp.
Exceptions
Ifthis is not allocated.
Ifany index of tuple/component given by bgTuples / bgComp is out of a valid range for this array.

Here is a Python example.

References MEDCoupling::DataArray::CheckValueInRange().

◆ setPartOfValues3()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::setPartOfValues3 ( const typename Traits< T >::ArrayType *  a,
const mcIdType *  bgTuples,
const mcIdType *  endTuples,
mcIdType  bgComp,
mcIdType  endComp,
mcIdType  stepComp,
bool  strictCompoCompare = true 
)

Copy all values from another DataArrayDouble (a) into specified tuples and components of this array. Textual data is not copied. The tuples to assign to are defined by a C array of indices. The components to assign to are defined by three values similar to parameters of the Python function range(start,stop,step). There are two modes of usage:

  • If a->getNbOfElems() equals to number of values to assign to, then every value of a is assigned to its own location within this array.
  • If a includes one tuple, then all values of a are assigned to the specified components of every specified tuple of this array. In this mode it is required that a->getNumberOfComponents() equals to the number of specified components.
Parameters
[in]a- the array to copy values from.
[in]bgTuples- pointer to an array of tuple indices of this array to assign values of a to.
[in]endTuples- specifies the end of the array bgTuples, so that pointer to a tuple index (pi) varies as this: bgTuples <= pi < endTuples.
[in]bgComp- index of the first component of this array to assign to.
[in]endComp- index of the component before which the components to assign to are located.
[in]stepComp- index increment to get index of the next component to assign to.
[in]strictCompoCompare- this parameter is checked only in the first mode of usage; if strictCompoCompare is true (default), then a->getNumberOfComponents() must be equal to the number of specified columns, else this is not required.
Exceptions
Ifa is NULL.
Ifa is not allocated.
Ifthis is not allocated.
Ifany index of tuple given by bgTuples is out of a valid range for this array.
Inthe first mode of usage, if strictCompoCompare == true and if a->getNumberOfComponents() is unequal to the number of components defined by (bgComp,endComp,stepComp).
Inthe second mode of usage, if a->getNumberOfTuples() != 1 or a->getNumberOfComponents() is unequal to the number of components defined by (bgComp,endComp,stepComp).
Ifparameters specifying components to assign to, do not give a non-empty range of increasing indices or indices are out of a valid range for this array.

Here is a Python example.

References MEDCoupling::DataArray::CheckValueInRange(), MEDCoupling::DataArray::CheckValueInRangeEx(), and MEDCoupling::DataArray::GetNumberOfItemGivenBES().

Referenced by MEDCoupling::DataArray::setPartOfValuesBase3().

◆ setPartOfValuesSimple3()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::setPartOfValuesSimple3 ( a,
const mcIdType *  bgTuples,
const mcIdType *  endTuples,
mcIdType  bgComp,
mcIdType  endComp,
mcIdType  stepComp 
)

Assign a given value to values at specified tuples and components of this array. The tuples to assign to are defined by a C array of indices. The components to assign to are defined by three values similar to parameters of the Python function range(start,stop,step).

Parameters
[in]a- the value to assign.
[in]bgTuples- pointer to an array of tuple indices of this array to assign a to.
[in]endTuples- specifies the end of the array bgTuples, so that pointer to a tuple index (pi) varies as this: bgTuples <= pi < endTuples.
[in]bgComp- index of the first component of this array to assign to.
[in]endComp- index of the component before which the components to assign to are located.
[in]stepComp- index increment to get index of the next component to assign to.
Exceptions
Ifthis is not allocated.
Ifany index of tuple given by bgTuples is out of a valid range for this array.
Ifparameters specifying components to assign to, do not give a non-empty range of increasing indices or indices are out of a valid range for this array.

Here is a Python example.

References MEDCoupling::DataArray::CheckValueInRange(), MEDCoupling::DataArray::CheckValueInRangeEx(), and MEDCoupling::DataArray::GetNumberOfItemGivenBES().

◆ setPartOfValues4()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::setPartOfValues4 ( const typename Traits< T >::ArrayType *  a,
mcIdType  bgTuples,
mcIdType  endTuples,
mcIdType  stepTuples,
const mcIdType *  bgComp,
const mcIdType *  endComp,
bool  strictCompoCompare = true 
)

Copy all values from another DataArrayDouble into specified tuples and components of this array. Textual data is not copied. The tree parameters defining set of indices of tuples and components are similar to the tree parameters of the Python function range(start,stop,step).

Parameters
[in]a- the array to copy values from.
[in]bgTuples- index of the first tuple of this array to assign values to.
[in]endTuples- index of the tuple before which the tuples to assign to are located.
[in]stepTuples- index increment to get index of the next tuple to assign to.
[in]bgComp- pointer to an array of component indices of this array to assign a to.
[in]endComp- specifies the end of the array bgTuples, so that pointer to a component index (pi) varies as this: bgComp <= pi < endComp.
[in]strictCompoCompare- if true (by default), then a->getNumberOfComponents() must be equal to the number of columns to assign to, else an exception is thrown; if false, then it is only required that a->getNbOfElems() equals to number of values to assign to (this condition must be respected even if strictCompoCompare is true). The number of values to assign to is given by following Python expression: nbTargetValues = len(range(bgTuples,endTuples,stepTuples)) * len(range(bgComp,endComp,stepComp)).
Exceptions
Ifa is NULL.
Ifa is not allocated.
Ifthis is not allocated.
Ifparameters specifying tuples and components to assign to do not give a non-empty range of increasing indices.
Ifa->getNbOfElems() != nbTargetValues.
IfstrictCompoCompare == true && a->getNumberOfComponents() != len(range(bgComp,endComp,stepComp)).

References MEDCoupling::DataArray::CheckValueInRange(), MEDCoupling::DataArray::CheckValueInRangeEx(), and MEDCoupling::DataArray::GetNumberOfItemGivenBES().

◆ setPartOfValuesSimple4()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::setPartOfValuesSimple4 ( a,
mcIdType  bgTuples,
mcIdType  endTuples,
mcIdType  stepTuples,
const mcIdType *  bgComp,
const mcIdType *  endComp 
)

◆ setPartOfValuesAdv()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::setPartOfValuesAdv ( const typename Traits< T >::ArrayType *  a,
const DataArrayIdType *  tuplesSelec 
)

Copy some tuples from another DataArrayDouble into specified tuples of this array. Textual data is not copied. Both arrays must have equal number of components. Both the tuples to assign and the tuples to assign to are defined by a DataArrayInt. All components of selected tuples are copied.

Parameters
[in]a- the array to copy values from.
[in]tuplesSelec- the array specifying both source tuples of a and target tuples of this. tuplesSelec has two components, and the first component specifies index of the source tuple and the second one specifies index of the target tuple.
Exceptions
Ifthis is not allocated.
Ifa is NULL.
Ifa is not allocated.
IftuplesSelec is NULL.
IftuplesSelec is not allocated.
Ifthis->getNumberOfComponents() != a->getNumberOfComponents().
IftuplesSelec->getNumberOfComponents() != 2.
Ifany tuple index given by tuplesSelec is out of a valid range for the corresponding (this or a) array.

◆ setContigPartOfSelectedValues()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::setContigPartOfSelectedValues ( mcIdType  tupleIdStart,
const DataArray aBase,
const DataArrayIdType *  tuplesSelec 
)
virtual

Copy some tuples from another DataArrayDouble (aBase) into contiguous tuples of this array. Textual data is not copied. Both arrays must have equal number of components. The tuples to assign to are defined by index of the first tuple, and their number is defined by tuplesSelec->getNumberOfTuples(). The tuples to copy are defined by values of a DataArrayInt. All components of selected tuples are copied.

Parameters
[in]tupleIdStart- index of the first tuple of this array to assign values to.
[in]aBase- the array to copy values from.
[in]tuplesSelec- the array specifying tuples of a to copy.
Exceptions
Ifthis is not allocated.
IfaBase is NULL.
IfaBase is not allocated.
IftuplesSelec is NULL.
IftuplesSelec is not allocated.
Ifthis->getNumberOfComponents() != aBase->getNumberOfComponents().
IftuplesSelec->getNumberOfComponents() != 1.
IftupleIdStart + tuplesSelec->getNumberOfTuples() > this->getNumberOfTuples().
Ifany tuple index given by tuplesSelec is out of a valid range for aBase array.

Implements MEDCoupling::DataArray.

◆ setContigPartOfSelectedValuesSlice()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::setContigPartOfSelectedValuesSlice ( mcIdType  tupleIdStart,
const DataArray aBase,
mcIdType  bg,
mcIdType  end2,
mcIdType  step 
)
virtual

Copy some tuples from another DataArrayDouble (aBase) into contiguous tuples of this array. Textual data is not copied. Both arrays must have equal number of components. The tuples to copy are defined by three values similar to parameters of the Python function range(start,stop,step). The tuples to assign to are defined by index of the first tuple, and their number is defined by number of tuples to copy. All components of selected tuples are copied.

Parameters
[in]tupleIdStart- index of the first tuple of this array to assign values to.
[in]aBase- the array to copy values from.
[in]bg- index of the first tuple to copy of the array aBase.
[in]end2- index of the tuple of aBase before which the tuples to copy are located.
[in]step- index increment to get index of the next tuple to copy.
Exceptions
Ifthis is not allocated.
IfaBase is NULL.
IfaBase is not allocated.
Ifthis->getNumberOfComponents() != aBase->getNumberOfComponents().
IftupleIdStart + len(range(bg,end2,step)) > this->getNumberOfTuples().
Ifparameters specifying tuples to copy, do not give a non-empty range of increasing indices or indices are out of a valid range for the array aBase.

Implements MEDCoupling::DataArray.

References MEDCoupling::DataArray::GetNumberOfItemGivenBES().

◆ getMaxValue()

template<class T >
T MEDCoupling::DataArrayTemplate< T >::getMaxValue ( mcIdType &  tupleId) const

Returns the maximal value and its location within this one-dimensional array.

Parameters
[out]tupleId- index of the tuple holding the maximal value.
Returns
double - the maximal value among all values of this array.
Exceptions
Ifthis->getNumberOfComponents() != 1
Ifthis->getNumberOfTuples() < 1
See also
getMaxAbsValue, getMinValue

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

◆ getMaxValueInArray()

template<class T >
T MEDCoupling::DataArrayTemplate< T >::getMaxValueInArray

Returns the maximal value within this array that is allowed to have more than one component.

Returns
double - the maximal value among all values of this array.
Exceptions
Ifthis is not allocated. If this is empty.
See also
getMaxAbsValueInArray, getMinValueInArray

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

◆ getMaxAbsValue()

template<class T >
T MEDCoupling::DataArrayTemplate< T >::getMaxAbsValue ( std::size_t &  tupleId) const

Returns the maximal absolute value in this and the first occurrence location associated to it.

Returns
the element in this (positive or negative) having the max abs value in this.
Exceptions
Ifthis is not allocated.
Ifthis is non one component array.
Ifthis is empty.

◆ getMaxAbsValueInArray()

template<class T >
T MEDCoupling::DataArrayTemplate< T >::getMaxAbsValueInArray

Returns the maximal absolute value in this.

Exceptions
Ifthis is not allocated.
Ifthis is non one component array.
Ifthis is empty.

◆ getMinValue()

template<class T >
T MEDCoupling::DataArrayTemplate< T >::getMinValue ( mcIdType &  tupleId) const

Returns the minimal value and its location within this one-dimensional array.

Parameters
[out]tupleId- index of the tuple holding the minimal value.
Returns
double - the minimal value among all values of this array.
Exceptions
Ifthis->getNumberOfComponents() != 1
Ifthis->getNumberOfTuples() < 1

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

◆ getMinValueInArray()

template<class T >
T MEDCoupling::DataArrayTemplate< T >::getMinValueInArray

Returns the minimal value within this array that is allowed to have more than one component.

Returns
double - the minimal value among all values of this array.
Exceptions
Ifthis is not allocated.

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

◆ getTuple()

◆ insertAtTheEnd()

template<class T >
template<class InputIterator >
void MEDCoupling::DataArrayTemplate< T >::insertAtTheEnd ( InputIterator  first,
InputIterator  last 
)

◆ SetArrayIn()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::SetArrayIn ( typename Traits< T >::ArrayType *  newArray,
typename Traits< T >::ArrayType *&  arrayToSet 
)
static

Assign pointer to one array to a pointer to another appay. Reference counter of arrayToSet is incremented / decremented.

Parameters
[in]newArray- the pointer to array to assign to arrayToSet.
[in,out]arrayToSet- the pointer to array to assign to.

◆ writeOnPlace()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::writeOnPlace ( std::size_t  id,
element0,
const T *  others,
mcIdType  sizeOfOthers 
)

◆ fillWithZero()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::fillWithZero

Assign zero to all values in this array. To know more on filling arrays see Filling DataArray with values.

Exceptions
Ifthis is not allocated.

Referenced by MEDCoupling::MEDCouplingPointSet::renumberNodesCenter().

◆ accessToMemArray() [1/2]

template<class T >
MemArray<T>& MEDCoupling::DataArrayTemplate< T >::accessToMemArray ( )

◆ accessToMemArray() [2/2]

template<class T >
const MemArray<T>& MEDCoupling::DataArrayTemplate< T >::accessToMemArray ( ) const

◆ writeForDbg()

template<class T >
void MEDCoupling::DataArrayTemplate< T >::writeForDbg ( const std::string &  fileName) const

Write an array in a file for debugging purpose. Do not use it for long term storage. Use it with care.

◆ LoadForDbg()

template<class T >
MCAuto< typename Traits< T >::ArrayTypeCh > MEDCoupling::DataArrayTemplate< T >::LoadForDbg ( const std::string &  fileName)
static

◆ copySortedImpl()

template<class T >
Traits< T >::ArrayTypeCh * MEDCoupling::DataArrayTemplate< T >::copySortedImpl ( bool  asc) const
protected

Sorts values of the array and put the result in a newly allocated returned array. This method does not alterate this content.

Parameters
[in]asc- true means ascending order, false, descending.
Exceptions
Ifthis is not allocated.
Ifthis->getNumberOfComponents() != 1.
See also
sort

◆ mySelectByTupleId() [1/2]

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplate< T >::mySelectByTupleId ( const mcIdType *  new2OldBg,
const mcIdType *  new2OldEnd 
) const
protected

Returns a shorten and permuted copy of this array. The new DataArrayDouble is of size new2OldEnd - new2OldBg and it's values are permuted as required by new2OldBg array. The values are permuted so that new[ i ] = old[ new2OldBg[ i ]]. This method is equivalent to renumberAndReduce() except that convention in input is new2old and not old2new. For more info on renumbering see Array indexing and numbering.

Parameters
[in]new2OldBg- pointer to the beginning of a permutation array that gives a tuple index in this array to fill the i-th tuple in the new array.
[in]new2OldEnd- specifies the end of the permutation array that starts at new2OldBg, so that pointer to a tuple index (pi) varies as this: new2OldBg <= pi < new2OldEnd.
Returns
DataArrayDouble * - the new instance of DataArrayDouble that the caller is to delete using decrRef() as it is no more needed.

◆ mySelectByTupleId() [2/2]

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplate< T >::mySelectByTupleId ( const DataArrayIdType &  di) const
protected

◆ mySelectByTupleIdSafe()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplate< T >::mySelectByTupleIdSafe ( const mcIdType *  new2OldBg,
const mcIdType *  new2OldEnd 
) const
protected

Returns a shorten and permuted copy of this array. The new DataArrayDouble is of size new2OldEnd - new2OldBg and it's values are permuted as required by new2OldBg array. The values are permuted so that new[ i ] = old[ new2OldBg[ i ]]. This method is equivalent to renumberAndReduce() except that convention in input is new2old and not old2new. This method is equivalent to selectByTupleId() except that it prevents coping data from behind the end of this array. For more info on renumbering see Array indexing and numbering.

Parameters
[in]new2OldBg- pointer to the beginning of a permutation array that gives a tuple index in this array to fill the i-th tuple in the new array.
[in]new2OldEnd- specifies the end of the permutation array that starts at new2OldBg, so that pointer to a tuple index (pi) varies as this: new2OldBg <= pi < new2OldEnd.
Returns
DataArrayDouble * - the new instance of DataArrayDouble that the caller is to delete using decrRef() as it is no more needed.
Exceptions
Ifnew2OldEnd - new2OldBg > this->getNumberOfTuples().

Referenced by MEDCoupling::DataArrayFloat::selectByTupleIdSafe(), MEDCoupling::DataArrayDouble::selectByTupleIdSafe(), MEDCoupling::DataArrayInt64::selectByTupleIdSafe(), and MEDCoupling::DataArrayChar::selectByTupleIdSafe().

◆ myKeepSelectedComponents()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplate< T >::myKeepSelectedComponents ( const std::vector< std::size_t > &  compoIds) const
protected

Returns a copy of this array composed of selected components. The new DataArrayDouble has the same number of tuples but includes components specified by compoIds parameter. So that getNbOfElems() of the result array can be either less, same or more than this->getNbOfElems().

Parameters
[in]compoIds- sequence of zero based indices of components to include into the new array.
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.
Ifa component index (i) is not valid: i < 0 || i >= this->getNumberOfComponents().

Here is a Python example.

Referenced by MEDCoupling::DataArrayFloat::keepSelectedComponents(), MEDCoupling::DataArrayDouble::keepSelectedComponents(), MEDCoupling::DataArrayInt64::keepSelectedComponents(), and MEDCoupling::DataArrayChar::keepSelectedComponents().

◆ mySelectByTupleIdSafeSlice()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplate< T >::mySelectByTupleIdSafeSlice ( mcIdType  bg,
mcIdType  end2,
mcIdType  step 
) const
protected

Returns a shorten copy of this array. The new DataArrayDouble contains every (bg + i * step)-th tuple of this array located before the end2-th tuple. Indices of the selected tuples are the same as ones returned by the Python command range( bg, end2, step ). This method is equivalent to selectByTupleIdSafe() except that the input array is not constructed explicitly. For more info on renumbering see Array indexing and numbering.

Parameters
[in]bg- index of the first tuple to copy from this array.
[in]end2- index of the tuple before which the tuples to copy are located.
[in]step- index increment to get index of the next tuple to copy.
Returns
DataArrayDouble * - the new instance of DataArrayDouble that the caller is to delete using decrRef() as it is no more needed.
See also
DataArrayDouble::subArray.

Referenced by MEDCoupling::DataArrayFloat::selectByTupleIdSafeSlice(), MEDCoupling::DataArrayDouble::selectByTupleIdSafeSlice(), MEDCoupling::DataArrayInt64::selectByTupleIdSafeSlice(), and MEDCoupling::DataArrayChar::selectByTupleIdSafeSlice().

◆ mySelectByTupleRanges()

template<class T >
Traits< T >::ArrayType * MEDCoupling::DataArrayTemplate< T >::mySelectByTupleRanges ( const std::vector< std::pair< mcIdType, mcIdType > > &  ranges) const
protected

Returns a shorten copy of this array. The new DataArrayDouble contains ranges of tuples specified by ranges parameter. For more info on renumbering see Array indexing and numbering.

Parameters
[in]ranges- std::vector of std::pair's each of which defines a range of tuples in [begin,end) format.
Returns
DataArrayDouble * - the new instance of DataArrayDouble that the caller is to delete using decrRef() as it is no more needed.
Exceptions
Ifend < begin.
Ifend > this->getNumberOfTuples().
Ifthis is not allocated.

Referenced by MEDCoupling::DataArrayFloat::selectByTupleRanges(), MEDCoupling::DataArrayDouble::selectByTupleRanges(), MEDCoupling::DataArrayInt64::selectByTupleRanges(), and MEDCoupling::DataArrayChar::selectByTupleRanges().

Member Data Documentation

◆ _mem