68 return dag_.existsArc(tail, head);
110 }
catch ([[maybe_unused]] gum::NotFound& e) {
return false; }
147 return dag_.minimalCondSet(target, soids);
151 return dag_.minimalCondSet(targets, soids);
155 const std::vector< std::string >& soids)
const {
160 const std::vector< std::string >& soids)
const {
Class representing probabilistic DAG model.
NodeSet descendants(NodeId id) const
returns the set of nodes with directed path outgoing from a given node
NodeSet ancestors(NodeId id) const
returns the set of nodes with directed path ingoing to a given node
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)
UndiGraph moralizedAncestralGraph(const NodeSet &nodes) const
build a UndiGraph by moralizing the Ancestral Graph of a set of Nodes
const DAG & dag() const
Returns a constant reference to the dag of this Bayes Net.
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
virtual 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
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
bool exists(const std::string &name) const final
Returns a constant reference to the dag of this Bayes Net.
const NodeGraphPart & nodes() const final
Returns a constant reference to the dag of this Bayes Net.
NodeSet ancestors(const NodeId id) const
returns the set of nodes with directed path ingoing to a given node
Sequence< NodeId > topologicalOrder() const
Build and return a topological order.
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
virtual NodeId idFromName(const std::string &name) const =0
Getter by name.
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
Base class for undirected graphs.
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 ...
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
gum is the global namespace for all aGrUM entities