Wildmeshing Toolkit
VisitedArray.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
6 
11 namespace wmtk::simplex::internal {
12 
13 template <typename T, uint64_t ArraySize = 50>
15 {
16 public:
17  bool is_visited(const T& obj);
18 
20 
21 private:
23 };
24 
25 template <typename T, uint64_t ArraySize>
26 inline bool VisitedArray<T, ArraySize>::is_visited(const T& obj)
27 {
28  for (const T& v : m_visited) {
29  if (v == obj) {
30  return true;
31  }
32  }
33  m_visited.emplace_back(obj);
34  return false;
35 }
36 
37 template <typename T, uint64_t ArraySize>
39  -> const wmtk::utils::DynamicArray<T, ArraySize>&
40 {
41  return m_visited;
42 }
43 
44 } // namespace wmtk::simplex::internal
const wmtk::utils::DynamicArray< T, ArraySize > & visited_array() const
wmtk::utils::DynamicArray< T, ArraySize > m_visited
This class is a utility to perform breadth first search on simplices.
Definition: Accessor.hpp:6