52template <
typename T =
unsigned long>
54 static_assert(std::is_unsigned<T>::value && std::is_integral<T>::value,
55 "Vertex map requires an unsigned integral type (e.g. unsigned).");
76 void Reset(
unsigned long nPoint) {
85 inline bool SetIsVertex(
unsigned long iPoint,
bool isVertex) {
87 if (isVertex !=
bool(Map(iPoint))) {
89 Map(iPoint) = T(isVertex);
97 inline bool GetIsVertex(
unsigned long iPoint)
const {
return (Map(iPoint) != 0); }
108 for (
unsigned long iPoint = 0; iPoint < Map.
size(); ++iPoint)
109 if (Map(iPoint) != 0) Map(iPoint) = ++nVertex;
122 assert(isValid &&
"Vertex map is not in valid state.");
123 iVertex = Map(iVertex);
124 if (iVertex == 0)
return false;
A templated vector/matrix object.
A templated matrix/vector-like object.
Definition C2DContainer.hpp:374
C2DContainer & resize(const Index_t size1, const Index_t size2=1) noexcept
Request a change of size.
Definition C2DContainer.hpp:541
size_t size() const noexcept
Definition C2DContainer.hpp:222
A lookup type map, maps indices in a large range to indices in a smaller one.
Definition CVertexMap.hpp:53
void Reset(unsigned long nPoint)
Reset the map for size nPoint, marks every point as not-a-vertex.
Definition CVertexMap.hpp:76
bool GetIsValid() const
Check if the current mapping is valid.
Definition CVertexMap.hpp:66
bool GetIsVertex(unsigned long iPoint) const
Get wheter a point is marked as vertex.
Definition CVertexMap.hpp:97
T GetnVertex() const
Get the number of vertices currently mapped.
Definition CVertexMap.hpp:71
bool SetIsVertex(unsigned long iPoint, bool isVertex)
Set the vertex status of a point.
Definition CVertexMap.hpp:85
T Build()
Build the point to vertex map.
Definition CVertexMap.hpp:102
bool GetVertexIndex(unsigned long &iVertex) const
Convert a point index to vertex index.
Definition CVertexMap.hpp:121