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

Specialization of the class for specifying indices of vertices for defining a DIM-dimensional polytope for DIM=1 (line) 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 line from a list of vertex indices (must be exactly two) More...
 
 Polytope (std::size_t index1, std::size_t index2)
 Constructs a line from two vertices. More...
 
 Polytope (const std::initializer_list< std::size_t > &indices)
 Constructs a line from a list of vertex indices (must be exactly two) More...
 
template<typename V >
bool Validate ([[maybe_unused]] const V &vertexList) const
 Checks if the polytope defines a valid line: More...
 
int Compare (const Polytope &rhs) const
 Compares this line to the specified line with strict ordering. More...
 
std::set< Polytope< 0 > > Faces () const
 Gets list of faces of the line (vertices) 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=1 (line)

Member Typedef Documentation

◆ const_iterator

Type of iterator over the vertices.

◆ iterator

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

Type of iterator over the vertices.

Constructor & Destructor Documentation

◆ Polytope() [1/3]

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

Constructs a line from a list of vertex indices (must be exactly two)

Exceptions
std::invalid_argumentIf the list is not exactly two elements 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< 1 >::Polytope ( std::size_t  index1,
std::size_t  index2 
)
inline

Constructs a line from two vertices.

Parameters
index1The index of the first vertex
index2The index of the second vertex

◆ Polytope() [3/3]

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

Constructs a line from a list of vertex indices (must be exactly two)

Exceptions
std::invalid_argumentIf the list is not exactly two elements long
Parameters
indicesThe list of vertex indices

Member Function Documentation

◆ begin()

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

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

◆ cbegin()

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

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

◆ cend()

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

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

◆ Compare()

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

Compares this line to the specified line with strict ordering.

Parameters
rhsThe right hand line to compare to
Returns
0 if this polygon is equal to rhs; -1 if the first index if this is less than first index of rhs (or if second less if first equal); 1 if the first index if this is greater than first index of rhs (or if second greater if first equal);

◆ end()

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

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

◆ Faces()

std::set<Polytope<0> > ptems::Polytope< 1 >::Faces ( ) const
inline

Gets list of faces of the line (vertices)

◆ operator[]()

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

Gets the specified vertex of the polytope.

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

◆ size()

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

Gets the number of vertices in the polytope.

Returns
2

◆ Validate()

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

Checks if the polytope defines a valid line:

  • Vertices are valid
  • The length of the line is greater than zero
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: