23#ifndef VULPES_DATASTRUCTURE_INDEX_TRACKER_HPP_
24#define VULPES_DATASTRUCTURE_INDEX_TRACKER_HPP_
38#ifndef INDEX_TRACKER_AS_VECTOR
46template <
typename IndexType>
52 static constexpr IndexType
npos =
static_cast<IndexType
>(-1);
64 operator IndexType()
const;
86 std::is_integral<U>::value,
"Constructor requires integral vector");
92 m_data.push_back(
static_cast<IndexType
>(v));
93 m_V = std::max(
m_V,
static_cast<IndexType
>(v) + 1);
100 for (IndexType i = 0; i <
m_N; ++i) {
125 std::vector<IndexType>
indicesOf(IndexType v,
bool sorted =
true)
const;
133 template <
typename F>
150 friend class Reference;
164template <
typename IndexType>
167 template <
typename U>
169 if constexpr (std::is_same_v<U, IndexType>) {
172 m_data.reserve(data.size());
174 m_data.push_back(
static_cast<IndexType
>(u));
184 std::vector<IndexType>
indicesOf(IndexType v)
const {
185 std::vector<IndexType> result;
186 for (IndexType ocid = 0; ocid <
m_data.size(); ++ocid) {
188 result.push_back(ocid);
194 const auto size()
const {
return m_data.size(); }
197 std::vector<IndexType>
m_data;
Definition crs_map.hpp:36
Definition cell_manager.hpp:38