* \throw If a component index (\a i) is not valid:
* \a i < 0 || \a i >= \a this->getNumberOfComponents().
*
+ * \if ENABLE_EXAMPLES
* \ref py_mcdataarrayint_keepselectedcomponents "Here is a Python example".
+ * \endif
*/
-DataArray *DataArrayChar::keepSelectedComponents(const std::vector<int>& compoIds) const
+DataArrayChar *DataArrayChar::keepSelectedComponents(const std::vector<int>& compoIds) const
{
checkAllocated();
MEDCouplingAutoRefCountObjectPtr<DataArrayChar> ret(buildEmptySpecializedDAChar());
* \throw If \a this is not allocated.
* \throw If \a this and \a other arrays have different number of tuples.
*
+ * \if ENABLE_EXAMPLES
* \ref cpp_mcdataarrayint_meldwith "Here is a C++ example".
*
* \ref py_mcdataarrayint_meldwith "Here is a Python example".
+ * \endif
*/
void DataArrayChar::meldWith(const DataArrayChar *other)
{
* \throw If \a strictCompoCompare == \a true && \a a->getNumberOfComponents() !=
* \c len(\c range(\a bgComp,\a endComp,\a stepComp)).
*
+ * \if ENABLE_EXAMPLES
* \ref py_mcdataarrayint_setpartofvalues1 "Here is a Python example".
+ * \endif
*/
void DataArrayChar::setPartOfValues1(const DataArrayChar *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare)
{
* non-empty range of increasing indices or indices are out of a valid range
* for \this array.
*
+ * \if ENABLE_EXAMPLES
* \ref py_mcdataarrayint_setpartofvaluessimple1 "Here is a Python example".
+ * \endif
*/
void DataArrayChar::setPartOfValuesSimple1(char a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp)
{
* \throw In the second *mode of usage*, if \a a->getNumberOfTuples() != 1 or
* <em> a->getNumberOfComponents() != (endComp - bgComp)</em>.
*
+ * \if ENABLE_EXAMPLES
* \ref py_mcdataarrayint_setpartofvalues2 "Here is a Python example".
+ * \endif
*/
void DataArrayChar::setPartOfValues2(const DataArrayChar *a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp, bool strictCompoCompare)
{
* \throw If any index of tuple/component given by <em>bgTuples / bgComp</em> is
* out of a valid range for \a this array.
*
+ * \if ENABLE_EXAMPLES
* \ref py_mcdataarrayint_setpartofvaluessimple2 "Here is a Python example".
+ * \endif
*/
void DataArrayChar::setPartOfValuesSimple2(char a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp)
{
* non-empty range of increasing indices or indices are out of a valid range
* for \this array.
*
+ * \if ENABLE_EXAMPLES
* \ref py_mcdataarrayint_setpartofvalues3 "Here is a Python example".
+ * \endif
*/
void DataArrayChar::setPartOfValues3(const DataArrayChar *a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare)
{
* non-empty range of increasing indices or indices are out of a valid range
* for \this array.
*
+ * \if ENABLE_EXAMPLES
* \ref py_mcdataarrayint_setpartofvaluessimple3 "Here is a Python example".
+ * \endif
*/
void DataArrayChar::setPartOfValuesSimple3(char a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp)
{
return DataArrayChar::isEqualIfNotWhy(other,reason);
}
+/*!
+ * This method is \b NOT wrapped into python because it can be useful only for performance reasons in C++ context.
+ * \throw if \a this is not allocated.
+ * \throw if \a this has not exactly one component.
+ */
+std::vector<bool> DataArrayByte::toVectorOfBool() const
+{
+ checkAllocated();
+ if(getNumberOfComponents()!=1)
+ throw INTERP_KERNEL::Exception("DataArrayByte::toVectorOfBool : this method can be used only if this has one component !");
+ int nbt(getNumberOfTuples());
+ std::vector<bool> ret(nbt,false);
+ const char *pt(begin());
+ for(int i=0;i<nbt;i++,pt++)
+ if(*pt!=0)
+ ret[i]=true;
+ return ret;
+}
+
DataArrayByteIterator::DataArrayByteIterator(DataArrayByte *da):_da(da),_pt(0),_tuple_id(0),_nb_comp(0),_nb_tuple(0)
{
if(_da)