|
GraphLibrary
0.0.1
A simple library that implements various graph algorithms.
|
Implements a numerical distance that supports "infinite distance". More...
#include <Distance.hpp>
Public Member Functions | |
| Distance () | |
| Default constructor. More... | |
| Distance (const SCALAR distance) | |
| Constructor with finite distance. More... | |
| Distance (const Distance &)=default | |
| Copy constructor. More... | |
| Distance (Distance &&) noexcept=default | |
| Move constructor. More... | |
| Distance & | operator= (const Distance &)=default |
| Copy assignment. More... | |
| Distance & | operator= (Distance &&) noexcept=default |
| Move assignment. More... | |
| ~Distance ()=default | |
| Destructor. More... | |
| bool | operator== (const Distance &rhs) |
| 'equality' operator More... | |
| bool | operator!= (const Distance &rhs) |
| 'inequality' operator More... | |
| bool | operator< (const Distance &rhs) |
| 'less than' operator More... | |
| bool | operator> (const Distance &rhs) |
| 'greater than' operator More... | |
| Distance | operator+ (const Distance &rhs) |
| 'addition' operator More... | |
| std::string | getDistance () const |
| Gets the distance. More... | |
| SCALAR | scalarDistance () const |
| Gets the numerical value of the distance. If the distance is infinite, returns the maximum value of the Distance type. More... | |
| void | setDistance (SCALAR distance) |
| Allows updating the distance. More... | |
| bool | isInfinite () const |
| Checks whether the distance is infinite. More... | |
| void | setInfinite () const |
| Sets the distance to infinity. More... | |
| bool | isZero () const |
| Checks whether the distance is zero. More... | |
Private Attributes | |
| bool | isInfinite_ |
| SCALAR | distance_ |
Implements a numerical distance that supports "infinite distance".
|
inline |
Default constructor.
|
inline |
Constructor with finite distance.
|
default |
Copy constructor.
|
defaultnoexcept |
Move constructor.
|
default |
Destructor.
|
default |
Copy assignment.
|
defaultnoexcept |
Move assignment.
|
inline |
'equality' operator
| [in] | rhs | Distance that will get compared |
|
inline |
'inequality' operator
| [in] | rhs | Distance that will get compared |
|
inline |
'less than' operator
| [in] | rhs | Distance that will get compared |
|
inline |
'greater than' operator
| [in] | rhs | Distance that will get compared |
|
inline |
|
inline |
Gets the distance.
|
inline |
Gets the numerical value of the distance. If the distance is infinite, returns the maximum value of the Distance type.
|
inline |
Allows updating the distance.
| [in] | distance | New distance. |
|
inline |
Checks whether the distance is infinite.
|
inline |
Sets the distance to infinity.
|
inline |
Checks whether the distance is zero.
|
private |
|
private |