X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingMemArrayChar.cxx;h=ce3baa868460ce3207a1bf5318cb2030dfec7270;hb=30e370a928f879a1c9be2bd685cda6cabec223cf;hp=96e650be1498ba3449ca9d962dd1d4930c96f66a;hpb=88ca3e0ff493a1511a2b9821d9b847ee85c9f1a7;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingMemArrayChar.cxx b/src/MEDCoupling/MEDCouplingMemArrayChar.cxx index 96e650be1..ce3baa868 100644 --- a/src/MEDCoupling/MEDCouplingMemArrayChar.cxx +++ b/src/MEDCoupling/MEDCouplingMemArrayChar.cxx @@ -2169,6 +2169,25 @@ bool DataArrayByte::isEqualIfNotWhy(const DataArrayChar& other, std::string& rea 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 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 ret(nbt,false); + const char *pt(begin()); + for(int i=0;i