32 #include <agrum/agrum.h> 33 #include <agrum/tools/multidim/instantiation.h> 34 #include <agrum/tools/graphicalModels/graphicalModel.h> 36 #include <agrum/tools/graphs/undiGraph.h> 93 bool exists(NodeId node)
const final;
108 bool existsEdge(
const NodeId node1,
const NodeId node2)
const;
109 bool existsEdge(
const std::string& name1,
const std::string& name2)
const;
120 virtual bool isIndependent(NodeId X, NodeId Y,
const NodeSet& Z)
const final;
123 bool isIndependent(
const NodeSet& X,
const NodeSet& Y,
const NodeSet& Z)
const final;
126 const std::string& Yname,
127 const std::vector< std::string >& Znames)
const {
128 return isIndependent(idFromName(Xname), idFromName(Yname), nodeset(Znames));
131 const std::vector< std::string >& Ynames,
132 const std::vector< std::string >& Znames)
const {
133 return isIndependent(nodeset(Xnames), nodeset(Ynames), nodeset(Znames));
158 #ifndef GUM_NO_INLINE 159 # include <agrum/tools/graphicalModels/UGmodel_inl.h> UGmodel & operator=(const UGmodel &source)
Private copy operator.
UndiGraph graph_
The DAG of this Directed Graphical Model.
const NodeSet & neighbours(const NodeId id) const
returns the neighbours of a node as set of nodes
INLINE void emplace(Args &&... args)
const EdgeSet & edges() const
return true if the edge node1-node2 exists in the UGModel
bool exists(NodeId node) const final
Return true if this node exists in this graphical model.
virtual ~UGmodel()
Destructor.
const NodeSet & neighbours(const std::string &name) const
return true if the edge node1-node2 exists in the UGModel
UGmodel()
Default constructor.
Virtual base class for PGMs using a undirected graph.
bool isIndependent(const std::vector< std::string > &Xnames, const std::vector< std::string > &Ynames, const std::vector< std::string > &Znames) const
return true if the edge node1-node2 exists in the UGModel
virtual bool isIndependent(NodeId X, NodeId Y, const NodeSet &Z) const final
check if X and Y are independent given Z
bool existsEdge(const std::string &name1, const std::string &name2) const
return true if the edge node1-node2 exists in the UGModel
Size sizeEdges() const
Returns the number of arcs in this Directed Graphical Model.
const UndiGraph & graph() const
Returns a constant reference to the dag of this Bayes Net.
bool existsEdge(const NodeId node1, const NodeId node2) const
return true if the edge node1-node2 exists in the UGModel
const NodeGraphPart & nodes() const final
Returns a constant reference to the dag of this Bayes Net.
UGmodel(const UGmodel &source)
Copy constructor.
virtual Size size() const final
Returns the number of variables in this Directed Graphical Model.
bool hasSameStructure(const UGmodel &other)
check if nodes X and nodes Y are independent given nodes Z