bux API Reference 1.9.0
Static library of whatever are seen required in general purpose but not directly supported from Modern C++. Or whatever reusable originated from my side projects.
|
#include <PartialOrdering.h>
Public Types | |
typedef std::list< T > | C_ValList |
Public Member Functions | |
template<class T1 , class T2 > | |
bool | addOrder (T1 a, T2 b) |
template<class T2 > | |
bool | anyLeft (const T2 &R) const |
template<class T2 > | |
bool | anyRight (const T2 &L) const |
void | clear () |
std::size_t | depthToLeft (T t) const |
bool | empty () const |
template<class T2 , class F > requires std::constructible_from<T,T2> && std::invocable<F,T> | |
void | getRelated (T2 L, F R, std::size_t maxDepth=0) const |
template<class F > requires std::invocable<F,T> | |
void | getRelated (C_ValList L, F R, std::size_t maxDepth=0) const |
template<class F , class T2 > requires std::constructible_from<T,T2> && std::invocable<F,T> | |
void | getRelated (F L, T2 R, std::size_t maxDepth=0) const |
template<class F > requires std::invocable<F,T> | |
void | getRelated (F L, C_ValList R, std::size_t maxDepth=0) const |
template<class F > requires std::invocable<F,T> | |
void | makeLinear (F apply, E_MakeLinearPolicy policy=MLP_BREADTH_FIRST) const |
bool | related (const T &a, const T &b) const |
DEFINITIONs: Let R be a partial ordering and aRb. Then a is said to be "left-related" to b, and similarly b is "right-related" to a. If no x in fld R satisfies xRa, a is said to be a "leftmost" in R. "Rightmost" is defined similarly.
Definition at line 18 of file PartialOrdering.h.
std::list<T> bux::C_PartialOrdering< T >::C_ValList |
Definition at line 28 of file PartialOrdering.h.
|
nodiscard |
Definition at line 82 of file PartialOrdering.h.
References bux::C_PartialOrdering< T >::related().
bool bux::C_PartialOrdering< T >::anyLeft | ( | const T2 & | R | ) | const |
Definition at line 126 of file PartialOrdering.h.
bool bux::C_PartialOrdering< T >::anyRight | ( | const T2 & | L | ) | const |
Definition at line 137 of file PartialOrdering.h.
|
inline |
Definition at line 38 of file PartialOrdering.h.
std::size_t bux::C_PartialOrdering< T >::depthToLeft | ( | T | t | ) | const |
Definition at line 101 of file PartialOrdering.h.
References bux::C_PartialOrdering< T >::depthToLeft().
Referenced by bux::C_PartialOrdering< T >::depthToLeft().
|
inline |
Definition at line 41 of file PartialOrdering.h.
void bux::C_PartialOrdering< T >::getRelated | ( | C_ValList | L, |
F | R, | ||
std::size_t | maxDepth = 0 ) const |
Definition at line 162 of file PartialOrdering.h.
References bux::addUnique().
void bux::C_PartialOrdering< T >::getRelated | ( | F | L, |
C_ValList | R, | ||
std::size_t | maxDepth = 0 ) const |
Definition at line 187 of file PartialOrdering.h.
References bux::addUnique().
void bux::C_PartialOrdering< T >::getRelated | ( | F | L, |
T2 | R, | ||
std::size_t | maxDepth = 0 ) const |
Definition at line 155 of file PartialOrdering.h.
References bux::C_PartialOrdering< T >::getRelated().
void bux::C_PartialOrdering< T >::getRelated | ( | T2 | L, |
F | R, | ||
std::size_t | maxDepth = 0 ) const |
Definition at line 148 of file PartialOrdering.h.
References bux::C_PartialOrdering< T >::getRelated().
Referenced by bux::C_PartialOrdering< T >::getRelated(), and bux::C_PartialOrdering< T >::getRelated().
void bux::C_PartialOrdering< T >::makeLinear | ( | F | apply, |
E_MakeLinearPolicy | policy = MLP_BREADTH_FIRST ) const |
[in] | apply | Node visitor. |
[in] | policy | How to serialize the lattice ? Breadth first or depth first. |
[Excerpt from here] The usual algorithm for topological sorting has running time linear in the number of nodes plus the number of edges (O(|V|+|E|)
). It uses depth-first search. First, find a list of "start nodes" which have no incoming edges and insert them into a queue Q. Then,
If this algorithm terminates without outputting all the nodes of the graph, it means the graph has at least one cycle and therefore is not a DAG, so the algorithm can report an error.
Definition at line 212 of file PartialOrdering.h.
References bux::addUnique(), bux::MLP_BREADTH_FIRST, and bux::MLP_DEPTH_FIRST.
bool bux::C_PartialOrdering< T >::related | ( | const T & | a, |
const T & | b ) const |
Definition at line 294 of file PartialOrdering.h.
References bux::C_PartialOrdering< T >::related().
Referenced by bux::C_PartialOrdering< T >::addOrder(), and bux::C_PartialOrdering< T >::related().