16#include <lagrange/utils/assert.h>
17#include <lagrange/utils/span.h>
31template <
typename Index>
35 using ValueArray = std::vector<Index>;
36 using IndexArray = std::vector<size_t>;
50 : m_data(std::move(data))
51 , m_indices(std::move(indices))
71 i + 1 < m_indices.size(),
72 "Invalid index, perhaps adjacency list is uninitialized?");
73 return {m_data.data() + m_indices[i], m_indices[i + 1] - m_indices[i]};
86 i + 1 < m_indices.size(),
87 "Invalid index, perhaps adjacency list is uninitialized?");
88 return m_indices[i + 1] - m_indices[i];
Adjacency list.
Definition: AdjacencyList.h:33
span< const Index > get_neighbors(size_t i) const
Get adjacency list of entry i.
Definition: AdjacencyList.h:68
AdjacencyList(ValueArray data, IndexArray indices)
Initialize adjacency list data.
Definition: AdjacencyList.h:49
size_t get_num_entries() const
Get total number of entries.
Definition: AdjacencyList.h:59
size_t get_num_neighbors(size_t i) const
Get the number of neighbors of a given entry.
Definition: AdjacencyList.h:83
#define la_runtime_assert(...)
Runtime assertion check.
Definition: assert.h:169
::nonstd::span< T, Extent > span
A bounds-safe view for sequences of objects.
Definition: span.h:27
Main namespace for Lagrange.
Definition: AABBIGL.h:30