PTEMS  0.1.0-dev+git.81fd0e4
PolyTopic Element Method Solver
ptems::Polytope< 0 > Class Reference

Specialization of the class for specifying indices of vertices for defining a DIM-dimensional polytope for DIM=0 (point) More...

#include <ptems/polytope.hpp>

Public Types

typedef const std::size_titerator
 Type of iterator over the vertices. More...
 
typedef const std::size_tconst_iterator
 Type of iterator over the vertices. More...
 

Public Member Functions

template<typename It >
 Polytope (It begin, It end)
 Constructs a point from a list of vertex indices (must be exactly one) More...
 
 Polytope (std::size_t index)
 Constructs a point from a vertex index. More...
 
 Polytope (const std::initializer_list< std::size_t > &indices)
 Constructs a point from a list of vertex indices (must be exactly one) More...
 
template<typename V >
bool Validate ([[maybe_unused]] const V &vertexList) const
 Checks if the polytope defines a valid point: More...
 
int Compare (const Polytope &rhs) const
 Compares this point to the specified point with strict ordering. More...
 
std::size_t size () const
 Gets the number of vertices in the polytope. More...
 
std::size_t operator[] (std::size_t idx) const
 Gets the specified vertex of the polytope. More...
 
const_iterator begin () const
 Gets begin iterator over the list of vertices of the polytope. More...
 
const_iterator cbegin () const
 Gets begin iterator over the list of vertices of the polytope. More...
 
const_iterator end () const
 Gets end iterator over the list of vertices of the polytope. More...
 
const_iterator cend () const
 Gets begin iterator over the list of vertices of the polytope. More...
 

Detailed Description

Specialization of the class for specifying indices of vertices for defining a DIM-dimensional polytope for DIM=0 (point)

Member Typedef Documentation

◆ const_iterator

Type of iterator over the vertices.

◆ iterator

typedef const std::size_t* ptems::Polytope< 0 >::iterator

Type of iterator over the vertices.

Constructor & Destructor Documentation

◆ Polytope() [1/3]

template<typename It >
ptems::Polytope< 0 >::Polytope ( It  begin,
It  end 
)
inline

Constructs a point from a list of vertex indices (must be exactly one)

Exceptions
std::invalid_argumentIf the list is not exactly one element long
Template Parameters
Typeof iterator over list of vertices
Parameters
beginThe iterator to the start of the list of vertex indices
endThe iterator to the end of the list of vertex indices

◆ Polytope() [2/3]

ptems::Polytope< 0 >::Polytope ( std::size_t  index)
inline

Constructs a point from a vertex index.

Parameters
indexThe index of the vertex

◆ Polytope() [3/3]

ptems::Polytope< 0 >::Polytope ( const std::initializer_list< std::size_t > &  indices)
inline

Constructs a point from a list of vertex indices (must be exactly one)

Exceptions
std::invalid_argumentIf the list is not exactly one element long
Parameters
indicesThe list of vertex indices

Member Function Documentation

◆ begin()

const_iterator ptems::Polytope< 0 >::begin ( ) const
inline

Gets begin iterator over the list of vertices of the polytope.

◆ cbegin()

const_iterator ptems::Polytope< 0 >::cbegin ( ) const
inline

Gets begin iterator over the list of vertices of the polytope.

◆ cend()

const_iterator ptems::Polytope< 0 >::cend ( ) const
inline

Gets begin iterator over the list of vertices of the polytope.

◆ Compare()

int ptems::Polytope< 0 >::Compare ( const Polytope< 0 > &  rhs) const
inline

Compares this point to the specified point with strict ordering.

Parameters
rhsThe right hand line to compare to
Returns
0 if vertex index of this point is equal to index of rhs vertex; -1 if vertex index of this point is less than index of rhs vertex; 1 if vertex index of this point is greater than index of rhs vertex;

◆ end()

const_iterator ptems::Polytope< 0 >::end ( ) const
inline

Gets end iterator over the list of vertices of the polytope.

◆ operator[]()

std::size_t ptems::Polytope< 0 >::operator[] ( std::size_t  idx) const
inline

Gets the specified vertex of the polytope.

Exceptions
std::out_of_rangeIf idx is greater than 0
Parameters
idxIndex of vertex to get
Returns
std::size_t The index of the vertex

◆ size()

std::size_t ptems::Polytope< 0 >::size ( ) const
inline

Gets the number of vertices in the polytope.

Returns
1

◆ Validate()

template<typename V >
bool ptems::Polytope< 0 >::Validate ( [[maybe_unused] ] const V &  vertexList) const
inline

Checks if the polytope defines a valid point:

  • Vertex index is valid
Template Parameters
VType of vertex list - must be indexable
Parameters
vertexListList of vertices to look up the polygon vertices in
Returns
true if valid; false otherwise

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