Version: 9.14.0
MEDCoupling::DataArrayTools< T > Class Template Reference

Static Public Member Functions

static mcIdType GetNumberOfItemGivenBES (T begin, T end, T step, const std::string &msg)
 
static mcIdType GetNumberOfItemGivenBESRelative (T begin, T end, T step, const std::string &msg)
 
static mcIdType GetPosOfItemGivenBESRelativeNoThrow (T value, T begin, T end, T step)
 
static void GetSlice (T start, T stop, T step, mcIdType sliceId, mcIdType nbOfSlices, T &startSlice, T &stopSlice)
 

Member Function Documentation

◆ GetSlice()

template<class T >
void MEDCoupling::DataArrayTools< T >::GetSlice ( start,
stop,
step,
mcIdType  sliceId,
mcIdType  nbOfSlices,
T &  startSlice,
T &  stopSlice 
)
static

This method is useful to slice work among a pool of threads or processes. begin, end step is the input whole slice of work to perform, typically it is a whole slice of tuples of DataArray or cells, nodes of a mesh...

The input sliceId should be an id in [0, nbOfSlices) that specifies the slice of work.

Parameters
[in]start- the start of the input slice of the whole work to perform split into slices.
[in]stop- the stop of the input slice of the whole work to perform split into slices.
[in]step- the step (that can be <0) of the input slice of the whole work to perform split into slices.
[in]sliceId- the slice id considered
[in]nbOfSlices- the number of slices (typically the number of cores on which the work is expected to be sliced)
[out]startSlice- the start of the slice considered
[out]stopSlice- the stop of the slice consided
Exceptions
Ifstep == 0
IfnbOfSlices not > 0
IfsliceId not in [0,nbOfSlices)

References MEDCoupling::DataArrayTools< T >::GetNumberOfItemGivenBESRelative().

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

◆ GetNumberOfItemGivenBES()

template<class T >
mcIdType MEDCoupling::DataArrayTools< T >::GetNumberOfItemGivenBES ( begin,
end,
step,
const std::string &  msg 
)
static

◆ GetNumberOfItemGivenBESRelative()

◆ GetPosOfItemGivenBESRelativeNoThrow()

template<class T >
mcIdType MEDCoupling::DataArrayTools< T >::GetPosOfItemGivenBESRelativeNoThrow ( value,
begin,
end,
step 
)
static