120 for (
const auto id:
ids)
205 const std::vector< std::string >& soids)
const {
210 const std::vector< std::string >& soids)
const {
215 std::string_view Yname,
216 const std::vector< std::string >& Znames)
const {
221 const std::vector< std::string >& Ynames,
222 const std::vector< std::string >& Znames)
const {
Class representing probabilistic DAG model.
bool existsArc(const Arc &arc) const
indicates whether a given arc exists
Size sizeArcs() const
indicates the number of arcs stored within the ArcGraphPart
const NodeSet & parents(NodeId id) const
returns the set of nodes with arc ingoing to a given node
NodeSet children(const NodeSet &ids) const
returns the set of nodes which consists in the node and its parents returns the set of children of a ...
const ArcSet & arcs() const
returns the set of arcs stored within the ArcGraphPart
NodeId idFromName(std::string_view name) const override
bool dSeparation(NodeId X, NodeId Y, const NodeSet &Z) const
check if node X and node Y are independent given nodes Z (in the sense of d-separation)
NodeSet minimalCondSet(NodeId target, const NodeSet &soids) const
UndiGraph moralizedAncestralGraph(const NodeSet &nodes) const
build a UndiGraph by moralizing the Ancestral Graph of a set of Nodes
NodeProperty< NodeId > connectedComponents() const
Returns the weakly connected components of the underlying DAG. Each node maps to the id of its compon...
NodeSet family(const NodeId id) const final
returns the parents of a node and the node
DAG dag_
The DAG of this Directed Graphical Model.
const ArcSet & arcs() const
return true if the arc tail->head exists in the DAGmodel
Size size() const final
Returns the number of variables in this Directed Graphical Model.
Size sizeArcs() const
Returns the number of arcs in this Directed Graphical Model.
Sequence< NodeId > topologicalOrder() const
The topological order stays the same as long as no variable or arcs are added or erased src the topol...
NodeSet minimalCondSet(NodeId target, const NodeSet &soids) const
bool existsArc(const NodeId tail, const NodeId head) const
return true if the arc tail->head exists in the DAGmodel
DAG dag() const
Returns a named copy of the internal DAG: each node id is assigned the name of the corresponding vari...
void _checkNodeExists_(NodeId id) const
UndiGraph moralizedAncestralGraph(const NodeSet &nodes) const
build a UndiGraph by moralizing the Ancestral Graph of a set of Nodes
const NodeSet & children(const NodeId id) const
returns the set of nodes with arc outgoing from a given node
bool exists(NodeId node) const final
Return true if this node exists in this graphical model.
const NodeSet & parents(const NodeId id) const
returns the set of nodes with arc ingoing to a given node
bool isIndependent(NodeId X, NodeId Y, const NodeSet &Z) const final
check if node X and node Y are independent given nodes Z
NodeSet descendants(const NodeId id) const
returns the set of nodes with directed path outgoing from a given node
const NodeGraphPart & nodes() const final
Returns a named copy of the internal DAG: each node id is assigned the name of the corresponding vari...
NodeSet ancestors(const NodeId id) const
returns the set of nodes with directed path ingoing to a given node
const DAG & internalDag() const
Returns a const reference to the internal (unnamed) DAG. O(1), no copy. Use for stable references or ...
NodeSet ancestors(NodeId id) const
returns the set of all ancestors of id (nodes from which id is reachable)
NodeSet family(NodeId id) const
returns { id } ∪ parents(id)
NodeProperty< NodeId > connectedComponents() const
returns a property {node:id of weakly connected component}
Sequence< NodeId > topologicalOrder() const
Build and return a topological order.
NodeSet descendants(NodeId id) const
returns the set of all descendants of id (nodes reachable from id)
NodeId idFromName(std::string_view name) const override
Returns the NodeId of a variable given its name.
const VariableNodeMap & variableNodeMap() const override
Returns a constant reference to the VariableNodeMap of this model.
void _nameNodes_(NodeGraphPart &g) const
Names every node of g using variable(id).name() for each node id in g.
std::vector< NodeId > ids(const std::vector< std::string > &names) const
transform a vector of names into a vector of nodeId
std::vector< std::string > names(const std::vector< NodeId > &ids) const
transform a vector of NodeId in a vector of names
NodeSet nodeset(const std::vector< std::string > &names) const
transform a vector of names into a NodeSet
Class for node sets in graph.
Size size() const
alias for sizeNodes
bool exists(const NodeId id) const
alias for existsNode
Exception : the element we looked for cannot be found.
bool empty() const noexcept
Indicates whether the set is the empty set.
Base class for undirected graphs.
bool exists(NodeId id) const
Return true if id matches a node.
#define GUM_ERROR(type, msg)
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
Set< Arc > ArcSet
Some typdefs and define for shortcuts ...
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
gum is the global namespace for all aGrUM entities