MEDCOUPLING_EXPORT virtual void setContigPartOfSelectedValues2(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step) throw(INTERP_KERNEL::Exception) = 0;
MEDCOUPLING_EXPORT virtual DataArray *selectByTupleRanges(const std::vector<std::pair<int,int> >& ranges) const throw(INTERP_KERNEL::Exception) = 0;
MEDCOUPLING_EXPORT virtual DataArray *keepSelectedComponents(const std::vector<int>& compoIds) const throw(INTERP_KERNEL::Exception) = 0;
+ MEDCOUPLING_EXPORT virtual DataArray *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const = 0;
+ MEDCOUPLING_EXPORT virtual DataArray *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const throw(INTERP_KERNEL::Exception) = 0;
+ MEDCOUPLING_EXPORT virtual DataArray *selectByTupleId2(int bg, int end2, int step) const throw(INTERP_KERNEL::Exception) = 0;
MEDCOUPLING_EXPORT void checkNbOfTuples(int nbOfTuples, const char *msg) const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT void checkNbOfComps(int nbOfCompo, const char *msg) const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT void checkNbOfTuplesAndComp(const DataArray& other, const char *msg) const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
+ MEDCOUPLING_EXPORT DataArrayChar *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const;
MEDCOUPLING_EXPORT DataArrayChar *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT DataArrayChar *selectByTupleId2(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
return ret.retn();
}
+/*!
+ * Returns a shorten and permuted copy of \a this array. The new DataArrayChar is
+ * of size \a new2OldEnd - \a new2OldBg and it's values are permuted as required by
+ * \a new2OldBg array.
+ * The values are permuted so that \c new[ i ] = \c old[ \a new2OldBg[ i ]].
+ * This method is equivalent to renumberAndReduce() except that convention in input is
+ * \c new2old and \b not \c old2new.
+ * For more info on renumbering see \ref MEDCouplingArrayRenumbering.
+ * \param [in] new2OldBg - pointer to the beginning of a permutation array that gives a
+ * tuple index in \a this array to fill the i-th tuple in the new array.
+ * \param [in] new2OldEnd - specifies the end of the permutation array that starts at
+ * \a new2OldBg, so that pointer to a tuple index (\a pi) varies as this:
+ * \a new2OldBg <= \a pi < \a new2OldEnd.
+ * \return DataArrayChar * - the new instance of DataArrayChar that the caller
+ * is to delete using decrRef() as it is no more needed.
+ */
+DataArrayChar *DataArrayChar::selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const
+{
+ return selectByTupleIdSafe(new2OldBg,new2OldEnd);
+}
+
/*!
* Returns a shorten and permuted copy of \a this array. The new DataArrayChar is
* of size \a new2OldEnd - \a new2OldBg and it's values are permuted as required by
* components.
* \param [in] newNbOfComp - number of components for the new array to have.
* \param [in] dftValue - value assigned to new values added to the new array.
- * \return DataArrayDouble * - the new instance of DataArrayDouble that the caller
+ * \return DataArrayChar * - the new instance of DataArrayChar that the caller
* is to delete using decrRef() as it is no more needed.
* \throw If \a this is not allocated.
*/
* all values of \a this.
* \param [in] tupleId - index of tuple of interest.
* \param [in] compoId - index of component of interest.
- * \return double - value located by \a tupleId and \a compoId.
+ * \return char - value located by \a tupleId and \a compoId.
* \throw If \a this is not allocated.
* \throw If condition <em>( 0 <= tupleId < this->getNumberOfTuples() )</em> is violated.
* \throw If condition <em>( 0 <= compoId < this->getNumberOfComponents() )</em> is violated.
/*!
* Returns the maximal value and its location within \a this one-dimensional array.
* \param [out] tupleId - index of the tuple holding the maximal value.
- * \return double - the maximal value among all values of \a this array.
+ * \return char - the maximal value among all values of \a this array.
* \throw If \a this->getNumberOfComponents() != 1
* \throw If \a this->getNumberOfTuples() < 1
*/
/*!
* Returns the only one value in \a this, if and only if number of elements
* (nb of tuples * nb of components) is equal to 1, and that \a this is allocated.
- * \return double - the sole value stored in \a this array.
+ * \return char - the sole value stored in \a this array.
* \throw If at least one of conditions stated above is not fulfilled.
*/
char DataArrayByte::byteValue() const throw(INTERP_KERNEL::Exception)
/*!
* Returns the only one value in \a this, if and only if number of elements
* (nb of tuples * nb of components) is equal to 1, and that \a this is allocated.
- * \return double - the sole value stored in \a this array.
+ * \return char - the sole value stored in \a this array.
* \throw If at least one of conditions stated above is not fulfilled.
*/
char DataArrayAsciiChar::asciiCharValue() const throw(INTERP_KERNEL::Exception)
%newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
%newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
%newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
-%newobject ParaMEDMEM::DataArray::selectByTupleRanges;
%newobject ParaMEDMEM::DataArray::deepCpy;
+%newobject ParaMEDMEM::DataArray::selectByTupleRanges;
+%newobject ParaMEDMEM::DataArray::selectByTupleId;
+%newobject ParaMEDMEM::DataArray::selectByTupleIdSafe;
+%newobject ParaMEDMEM::DataArray::selectByTupleId2;
%newobject ParaMEDMEM::DataArrayInt::New;
%newobject ParaMEDMEM::DataArrayInt::__iter__;
%newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
%newobject ParaMEDMEM::DataArrayInt::substr;
%newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
%newobject ParaMEDMEM::DataArrayInt::accumulatePerChunck;
-%newobject ParaMEDMEM::DataArrayInt::selectByTupleId;
-%newobject ParaMEDMEM::DataArrayInt::selectByTupleIdSafe;
-%newobject ParaMEDMEM::DataArrayInt::selectByTupleId2;
%newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
%newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
%newobject ParaMEDMEM::DataArrayInt::renumber;
%newobject ParaMEDMEM::DataArrayChar::renumber;
%newobject ParaMEDMEM::DataArrayChar::renumberR;
%newobject ParaMEDMEM::DataArrayChar::renumberAndReduce;
-%newobject ParaMEDMEM::DataArrayChar::selectByTupleIdSafe;
-%newobject ParaMEDMEM::DataArrayChar::selectByTupleId2;
%newobject ParaMEDMEM::DataArrayChar::changeNbOfComponents;
%newobject ParaMEDMEM::DataArrayChar::getIdsEqual;
%newobject ParaMEDMEM::DataArrayChar::getIdsNotEqual;
%newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
%newobject ParaMEDMEM::DataArrayDouble::accumulatePerChunck;
%newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
-%newobject ParaMEDMEM::DataArrayDouble::selectByTupleId;
-%newobject ParaMEDMEM::DataArrayDouble::selectByTupleIdSafe;
-%newobject ParaMEDMEM::DataArrayDouble::selectByTupleId2;
%newobject ParaMEDMEM::DataArrayDouble::negate;
%newobject ParaMEDMEM::DataArrayDouble::applyFunc;
%newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
virtual std::size_t getNbOfElems() const throw(INTERP_KERNEL::Exception);
virtual std::size_t getNbOfElemAllocated() const throw(INTERP_KERNEL::Exception);
virtual DataArray *deepCpy() const throw(INTERP_KERNEL::Exception);
+ virtual DataArray *selectByTupleId2(int bg, int end2, int step) const throw(INTERP_KERNEL::Exception);
void checkNbOfTuples(int nbOfTuples, const char *msg) const throw(INTERP_KERNEL::Exception);
void checkNbOfComps(int nbOfCompo, const char *msg) const throw(INTERP_KERNEL::Exception);
void checkNbOfTuplesAndComp(const DataArray& other, const char *msg) const throw(INTERP_KERNEL::Exception);
return self->selectByTupleRanges(ranges);
}
+ virtual DataArray *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ {
+ void *da=0;
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ if (!SWIG_IsOK(res1))
+ {
+ int size;
+ INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
+ return self->selectByTupleId(tmp,tmp+size);
+ }
+ else
+ {
+ DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
+ if(!da2)
+ throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+ da2->checkAllocated();
+ return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
+ }
+ }
+
+ virtual DataArray *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
+ {
+ void *da=0;
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ if (!SWIG_IsOK(res1))
+ {
+ int size;
+ INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
+ return self->selectByTupleIdSafe(tmp,tmp+size);
+ }
+ else
+ {
+ DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
+ if(!da2)
+ throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+ da2->checkAllocated();
+ return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
+ }
+ }
+
virtual PyObject *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
{
std::vector<int> tmp;
DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
DataArrayDouble *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
DataArrayDouble *toNoInterlace() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *selectByTupleId2(int bg, int end2, int step) const throw(INTERP_KERNEL::Exception);
DataArrayDouble *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
void transpose() throw(INTERP_KERNEL::Exception);
}
}
- DataArrayDouble *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
- {
- void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
- if (!SWIG_IsOK(res1))
- {
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- return self->selectByTupleId(tmp,tmp+size);
- }
- else
- {
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
- if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
- da2->checkAllocated();
- return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
- }
- }
-
- DataArrayDouble *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
- {
- void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
- if (!SWIG_IsOK(res1))
- {
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- return self->selectByTupleIdSafe(tmp,tmp+size);
- }
- else
- {
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
- if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
- da2->checkAllocated();
- return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
- }
- }
-
PyObject *minimalDistanceTo(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception)
{
int thisTupleId,otherTupleId;
}
}
- DataArrayInt *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
- {
- void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
- if (!SWIG_IsOK(res1))
- {
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- return self->selectByTupleId(tmp,tmp+size);
- }
- else
- {
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
- if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
- da2->checkAllocated();
- return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
- }
- }
-
- DataArrayInt *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
- {
- void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
- if (!SWIG_IsOK(res1))
- {
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- return self->selectByTupleIdSafe(tmp,tmp+size);
- }
- else
- {
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
- if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
- da2->checkAllocated();
- return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
- }
- }
-
void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
{
std::vector<int> tmp;
DataArrayChar *renumber(const int *old2New) const throw(INTERP_KERNEL::Exception);
DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
- DataArrayChar *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const throw(INTERP_KERNEL::Exception);
- DataArrayChar *selectByTupleId2(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
}
}
- DataArrayChar *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
- {
- void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
- if (!SWIG_IsOK(res1))
- {
- int size;
- INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
- return self->selectByTupleIdSafe(tmp,tmp+size);
- }
- else
- {
- DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
- if(!da2)
- throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
- da2->checkAllocated();
- return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
- }
- }
-
static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
{
std::vector<const ParaMEDMEM::DataArrayChar *> tmp;