35 const std::set<T> &inputSet )
40 bool isValid = std::is_same<size_type, T>::value ||
41 std::is_same<global_size_type, T>::value;
44 "OptimizedIndexSet expects the template parameter to be of type unsigned int or unsigned long int.");
45 if (!inputSet.empty())
47 typename std::set<T>::const_iterator itLastRange = inputSet.begin();
48 typename std::set<T>::const_iterator itPrev = inputSet.begin();
49 typename std::set<T>::const_iterator it = itPrev;
51 for (; it != inputSet.end(); ++it)
53 bool isContiguous = ((*it - 1) == *(itPrev));
124 template <
typename T>
size_type d_numContiguousRanges
Store the number of contiguous ranges in the input set of indices.
Definition OptimizedIndexSet.h:64
std::vector< size_type > d_numEntriesBefore
Definition OptimizedIndexSet.h:77
std::vector< T > d_contiguousRanges
Definition OptimizedIndexSet.h:73
void getPosition(const T &index, size_type &pos, bool &found) const
Definition OptimizedIndexSet.t.cc:80
OptimizedIndexSet(const std::set< T > &inputSet=std::set< T >())
Constructor.
Definition OptimizedIndexSet.t.cc:34
void throwException(bool condition, std::string msg="")
Definition pseudoPotentialToDftfeConverter.cc:34
unsigned int size_type
Definition TypeConfig.h:6