Lagrange
Loading...
Searching...
No Matches
InverseMapping< Index > Struct Template Reference

A simple struct representing the inverse of a 1-to-many mapping. More...

#include <lagrange/internal/invert_mapping.h>

Public Member Functions

template<typename Func>
void foreach_mapped_to (Index i, Func &&func) const
 Iterate over all source elements mapped to target element i.
 
template<typename Func>
void foreach_mapped_to (Index i, Func &&func)
 Iterate over all source elements mapped to target element i.
 

Public Attributes

std::vector< Index > data
 A flat array of indices of the source elements.
 
std::vector< Index > offsets
 An array of data offset indices. It is of size num_target_elements + 1.
 

Detailed Description

template<typename Index>
struct lagrange::internal::InverseMapping< Index >

A simple struct representing the inverse of a 1-to-many mapping.

Target element i is mapped to source elements with index in the range from mapping.data[mapping.offsets[i]] to mapping.data[mapping.offsets[i+1]].

Template Parameters
IndexMapping index type.
Todo
Write iterator helpers to facilitate iterating over mapped data.

The documentation for this struct was generated from the following file: