37 const std::set<T> &inputSet )
42 bool isValid = std::is_same<dftfe::uInt, T>::value ||
43 std::is_same<dftfe::uInt, T>::value;
46 "OptimizedIndexSet expects the template parameter to be of type dftfe::uInt or unsigned long int.");
47 if (!inputSet.empty())
49 typename std::set<T>::const_iterator itLastRange = inputSet.begin();
50 typename std::set<T>::const_iterator itPrev = inputSet.begin();
51 typename std::set<T>::const_iterator it = itPrev;
53 for (; it != inputSet.end(); ++it)
55 bool isContiguous = ((*it - 1) == *(itPrev));
126 template <
typename T>
void getPosition(const T &index, dftfe::uInt &pos, bool &found) const
Definition OptimizedIndexSet.t.cc:82
std::vector< T > d_contiguousRanges
Definition OptimizedIndexSet.h:73
std::vector< dftfe::uInt > d_numEntriesBefore
Definition OptimizedIndexSet.h:77
OptimizedIndexSet(const std::set< T > &inputSet=std::set< T >())
Constructor.
Definition OptimizedIndexSet.t.cc:36
dftfe::uInt d_numContiguousRanges
Store the number of contiguous ranges in the input set of indices.
Definition OptimizedIndexSet.h:64
void throwException(bool condition, std::string msg="")
Definition pseudoPotentialToDftfeConverter.cc:34
std::uint32_t uInt
Definition TypeConfig.h:10