6 #ifndef TAPKEE_CONNECTED_H_
7 #define TAPKEE_CONNECTED_H_
14 namespace tapkee_internal
17 template <
class RandomAccessIterator>
18 bool is_connected(RandomAccessIterator begin, RandomAccessIterator end,
28 typedef std::stack<int> DFSStack;
29 typedef std::vector<bool> VisitedVector;
31 VisitedVector visited(N,
false);
36 while (!stack.empty())
38 int current = stack.top();
44 visited[current] =
true;
47 if (nvisited == N)
break;
53 int neighbor = current_neighbors[j];
54 if (!visited[neighbor])
TAPKEE_INTERNAL_VECTOR< tapkee::IndexType > LocalNeighbors
int IndexType
indexing type (non-overridable) set to int for compatibility with OpenMP 2.0
TAPKEE_INTERNAL_VECTOR< tapkee::tapkee_internal::LocalNeighbors > Neighbors
bool is_connected(RandomAccessIterator begin, RandomAccessIterator end, const Neighbors &neighbors)