48 template < GUM_DiGraphable G >
55 template < GUM_DiGraphable G >
61 template < GUM_MixedGraphable G >
67 for (
const auto node: Z)
68 if (moral.existsNode(node)) moral.eraseNode(node);
69 return !moral.hasUndirectedPath(X, Y);
72 template < GUM_MixedGraphable G >
80 for (
const auto node: Z)
81 if (moral.existsNode(node)) moral.eraseNode(node);
83 const auto cc = moral.chainComponents();
86 for (
const auto node: X)
87 if (moral.existsNode(node)) Xcc.
insert(cc[node]);
88 for (
const auto node: Y)
89 if (moral.existsNode(node)) Ycc.
insert(cc[node]);
91 return (Xcc * Ycc).empty();
d-Separation and c-Separation tests for aGrUM graphs.
Exception: at least one argument passed to a function is not what was expected.
bool exists(const Key &k) const
Indicates whether a given elements belong to the set.
void insert(const Key &k)
Inserts a new element into the set.
#define GUM_ERROR(type, msg)
Size NodeId
Type for node ids.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
bool cSeparated(const G &g, NodeId X, NodeId Y, const NodeSet &Z)
Returns true iff X and Y are c-separated by Z in g.
UndiGraph moralizedAncestralGraph(const G &g, const NodeSet &query)
Returns the moralized ancestral graph of query in g.
bool dSeparated(const G &g, NodeId X, NodeId Y, const NodeSet &Z)
Returns true iff X and Y are d-separated by Z in g.
NodeSet dConnected(const G &g, const NodeSet &query, const NodeSet &Zhard=NodeSet(), const NodeSet &Zsoft=NodeSet())
Returns all nodes d-connected to query given evidence.