#include <Triangulation.hpp>
|
| static Index | plus_one (Index j, Index ring_size) |
| |
| static Index | minus_one (Index j, Index ring_size) |
| |
A helper struct; makes addition and subtraction on a ring easier. Each fp::Node stores its next neighbors in a vector Node.nn_ids, where the adjacent members in a vector are also next neighbors of each other. This struct provides a safe way to always access the next or previous member of the nn_ids vector, even if a wraparound is necessary.
- See also
- fp::Node.
- Template Parameters
-
| Index | type that will be used for all integer numbers inside this class/struct. Any data type that satisfies the indexing_number concept is allowed, for example, unsigned int. |
◆ plus_one()
| static Index fp::Neighbors::plus_one |
( |
Index | j, |
|
|
Index | ring_size ) |
|
inlinestatic |
- Parameters
-
| j | index of the j-th next neighbor |
| ring_size | corresponds to the number of elements of Node.nn_ids |
- Returns
j+1 if j < ring_size - 1 and 0 otherwise. I.e., if j is the index of Node.nn_ids, its next neighbor will be stored in j+1 element, unless j is the last element, then its next neighbor will be stored in the 0th element.
◆ minus_one()
| static Index fp::Neighbors::minus_one |
( |
Index | j, |
|
|
Index | ring_size ) |
|
inlinestatic |
- Parameters
-
| j | index of the j-th next neighbor |
| ring_size | corresponds to the number of elements of Node.nn_ids |
- Returns
j-1 if j > 0 and ring_size - 1 otherwise. I.e., if j is the index of Node.nn_ids, its previous next neighbor will be stored in j-1 element, unless j is the 0th element, then its previous next neighbor will be stored in the last element.
The documentation for this struct was generated from the following file: