X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FMEDCoupling%2FMEDCouplingMemArrayChar.cxx;h=d363454bb77108e96ae37a6ab66a6d610f70d059;hb=ffe6d640bbaae9d66ac15d1015761d047a495ede;hp=d3872cf2175a56a3ceb7b6be9411cbb6bcf1e3ba;hpb=d841bf0f548baf1321a64cad715c7dff9110dd3b;p=tools%2Fmedcoupling.git
diff --git a/src/MEDCoupling/MEDCouplingMemArrayChar.cxx b/src/MEDCoupling/MEDCouplingMemArrayChar.cxx
index d3872cf21..d363454bb 100644
--- a/src/MEDCoupling/MEDCouplingMemArrayChar.cxx
+++ b/src/MEDCoupling/MEDCouplingMemArrayChar.cxx
@@ -507,6 +507,27 @@ DataArrayChar *DataArrayChar::renumberAndReduce(const int *old2New, int newNbOfT
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
@@ -671,7 +692,7 @@ DataArrayChar *DataArrayChar::substr(int tupleIdBg, int tupleIdEnd) const throw(
* 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.
*/
@@ -1265,7 +1286,7 @@ void DataArrayChar::setPartOfValuesAdv(const DataArrayChar *a, const DataArrayCh
}
/*!
- * Copy some tuples from another DataArrayChar (\a a) into contiguous tuples
+ * Copy some tuples from another DataArrayChar (\a aBase) into contiguous tuples
* of \a 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
@@ -1274,18 +1295,18 @@ void DataArrayChar::setPartOfValuesAdv(const DataArrayChar *a, const DataArrayCh
* All components of selected tuples are copied.
* \param [in] tupleIdStart - index of the first tuple of \a this array to assign
* values to.
- * \param [in] a - the array to copy values from.
- * \param [in] tuplesSelec - the array specifying tuples of \a a to copy.
+ * \param [in] aBase - the array to copy values from.
+ * \param [in] tuplesSelec - the array specifying tuples of \a aBase to copy.
* \throw If \a this is not allocated.
- * \throw If \a a is NULL.
- * \throw If \a a is not allocated.
+ * \throw If \a aBase is NULL.
+ * \throw If \a aBase is not allocated.
* \throw If \a tuplesSelec is NULL.
* \throw If \a tuplesSelec is not allocated.
- * \throw If this->getNumberOfComponents() != a->getNumberOfComponents().
+ * \throw If this->getNumberOfComponents() != aBase->getNumberOfComponents().
* \throw If \a tuplesSelec->getNumberOfComponents() != 1.
* \throw If tupleIdStart + tuplesSelec->getNumberOfTuples() > this->getNumberOfTuples().
* \throw If any tuple index given by \a tuplesSelec is out of a valid range for
- * \a a array.
+ * \a aBase array.
*/
void DataArrayChar::setContigPartOfSelectedValues(int tupleIdStart, const DataArray *aBase, const DataArrayInt *tuplesSelec) throw(INTERP_KERNEL::Exception)
{
@@ -1325,7 +1346,7 @@ void DataArrayChar::setContigPartOfSelectedValues(int tupleIdStart, const DataAr
}
/*!
- * Copy some tuples from another DataArrayChar (\a a) into contiguous tuples
+ * Copy some tuples from another DataArrayChar (\a aBase) into contiguous tuples
* of \a 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
@@ -1335,19 +1356,19 @@ void DataArrayChar::setContigPartOfSelectedValues(int tupleIdStart, const DataAr
* All components of selected tuples are copied.
* \param [in] tupleIdStart - index of the first tuple of \a this array to assign
* values to.
- * \param [in] a - the array to copy values from.
- * \param [in] bg - index of the first tuple to copy of the array \a a.
- * \param [in] end2 - index of the tuple of \a a before which the tuples to copy
+ * \param [in] aBase - the array to copy values from.
+ * \param [in] bg - index of the first tuple to copy of the array \a aBase.
+ * \param [in] end2 - index of the tuple of \a aBase before which the tuples to copy
* are located.
* \param [in] step - index increment to get index of the next tuple to copy.
* \throw If \a this is not allocated.
- * \throw If \a a is NULL.
- * \throw If \a a is not allocated.
- * \throw If this->getNumberOfComponents() != a->getNumberOfComponents().
+ * \throw If \a aBase is NULL.
+ * \throw If \a aBase is not allocated.
+ * \throw If this->getNumberOfComponents() != aBase->getNumberOfComponents().
* \throw If tupleIdStart + len(range(bg,end2,step)) > this->getNumberOfTuples().
* \throw If parameters 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 \a a.
+ * for the array \a aBase.
*/
void DataArrayChar::setContigPartOfSelectedValues2(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step) throw(INTERP_KERNEL::Exception)
{
@@ -1448,7 +1469,7 @@ DataArray *DataArrayChar::selectByTupleRanges(const std::vector( 0 <= tupleId < this->getNumberOfTuples() ) is violated.
* \throw If condition ( 0 <= compoId < this->getNumberOfComponents() ) is violated.
@@ -1689,7 +1710,7 @@ int DataArrayChar::locateValue(const std::vector& vals) const throw(INTERP
/*!
* 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
*/
@@ -1965,7 +1986,7 @@ DataArrayByteIterator *DataArrayByte::iterator()
* \ref MEDCouplingArrayBasicsCopyDeep.
* \return DataArrayByte * - a new instance of DataArrayByte.
*/
-DataArrayByte *DataArrayByte::deepCpy() const
+DataArrayByte *DataArrayByte::deepCpy() const throw(INTERP_KERNEL::Exception)
{
return new DataArrayByte(*this);
}
@@ -1991,7 +2012,7 @@ DataArrayByte *DataArrayByte::performCpy(bool dCpy) const
/*!
* 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)
@@ -2298,7 +2319,7 @@ DataArrayAsciiCharIterator *DataArrayAsciiChar::iterator()
* \ref MEDCouplingArrayBasicsCopyDeep.
* \return DataArrayAsciiChar * - a new instance of DataArrayAsciiChar.
*/
-DataArrayAsciiChar *DataArrayAsciiChar::deepCpy() const
+DataArrayAsciiChar *DataArrayAsciiChar::deepCpy() const throw(INTERP_KERNEL::Exception)
{
return new DataArrayAsciiChar(*this);
}
@@ -2324,7 +2345,7 @@ DataArrayAsciiChar *DataArrayAsciiChar::performCpy(bool dCpy) const
/*!
* 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)