![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
The base class for all directed edges. More...
#include <graphElements.h>
Public Member Functions | |
Constructors / Destructors | |
| Arc (NodeId tail, NodeId head) | |
| basic constructor. Creates tail -> head. | |
| Arc (const Arc &src) | |
| copy constructor | |
| ~Arc () | |
| destructor | |
Accessors | |
| GUM_NODISCARD NodeId | tail () const |
| returns the tail of the arc | |
| GUM_NODISCARD NodeId | head () const |
| returns the head of the arc | |
| GUM_NODISCARD NodeId | other (NodeId id) const |
| returns an extremal node of an edge given the ID of the other one | |
| GUM_NODISCARD NodeId | first () const |
| returns one extremal node ID (whichever one it is is unspecified) | |
| GUM_NODISCARD NodeId | second () const |
| returns the node ID of the other extremal node ID | |
Operators | |
| Arc & | operator= (const Arc &src) |
| copy operator | |
| bool | operator== (const Arc &src) const =default |
| checks whether two arcs are equal | |
Private Member Functions | |
| void | _setTail_ (NodeId id) |
| modifies the tail of the arc | |
| void | _setHead_ (NodeId id) |
| modifies the head of the arc | |
| void | operator- () |
| reverses the direction of the arc | |
Private Attributes | |
| NodeId | n1 |
| the extremal nodes of the edge (their order is unimportant) | |
| NodeId | n2 |
The base class for all directed edges.
This class is used as a basis for manipulating all directed edges (i.e., edges in which the order of the nodes is meaningful). For instance, in an arrow, one node is near the head and the other one is farther, hence these nodes have different status and swapping the nodes results in reversing the direction of the arrow. Thus, the nodes in an arrow can be thought of as asymmetric and the arrow's graphical representation contains a pointed extremity so as to account for this asymmetry. In aGrUM, the latter is taken into account by Arc.
Definition at line 261 of file graphElements.h.
basic constructor. Creates tail -> head.
References head(), and tail().
Referenced by Arc(), operator=(), and operator==().
| gum::Arc::Arc | ( | const Arc & | src | ) |
| gum::Arc::~Arc | ( | ) |
destructor
|
private |
modifies the head of the arc
|
private |
modifies the tail of the arc
| GUM_NODISCARD NodeId gum::Arc::first | ( | ) | const |
returns one extremal node ID (whichever one it is is unspecified)
References GUM_NODISCARD.
Referenced by gum::BarrenNodesFinder::barrenNodes().
| GUM_NODISCARD NodeId gum::Arc::head | ( | ) | const |
returns the head of the arc
References GUM_NODISCARD.
Referenced by Arc(), gum::BarrenNodesFinder::barrenNodes(), gum::ArcGraphPart::eraseArc(), gum::BayesNet< GUM_SCALAR >::eraseArc(), gum::InfluenceDiagram< GUM_SCALAR >::eraseArc(), gum::DAGCycleDetector::hasCycleFromModifications(), and gum::BayesNet< GUM_SCALAR >::reverseArc().
|
private |
reverses the direction of the arc
checks whether two arcs are equal
Two arcs are considered equal if they have the same head and tail (by same we mean they have the same ID).
References Arc().
| GUM_NODISCARD NodeId gum::Arc::other | ( | NodeId | id | ) | const |
returns an extremal node of an edge given the ID of the other one
References GUM_NODISCARD.
| GUM_NODISCARD NodeId gum::Arc::second | ( | ) | const |
returns the node ID of the other extremal node ID
References GUM_NODISCARD.
| GUM_NODISCARD NodeId gum::Arc::tail | ( | ) | const |
returns the tail of the arc
References GUM_NODISCARD.
Referenced by Arc(), gum::BarrenNodesFinder::barrenNodes(), gum::ArcGraphPart::eraseArc(), gum::BayesNet< GUM_SCALAR >::eraseArc(), gum::InfluenceDiagram< GUM_SCALAR >::eraseArc(), gum::DAGCycleDetector::hasCycleFromModifications(), and gum::BayesNet< GUM_SCALAR >::reverseArc().
|
private |
the extremal nodes of the edge (their order is unimportant)
Definition at line 319 of file graphElements.h.
|
private |
Definition at line 320 of file graphElements.h.