63 if (
this != &source) {
73 if (
this != &source) {
75 dag_ = std::move(source.dag_);
82 auto g =
dag_.moralGraph();
88 if (
this == &other)
return true;
90 if (
size() != other.
size())
return false;
94 for (
const auto& nid:
nodes()) {
98 for (
const auto& arc:
arcs()) {
Class representing probabilistic DAG model.
Interface-like class encapsulating basic functionalities for a DAGModel.
The base class for all directed edges.
DAG dag_
The DAG of this Directed Graphical Model.
DAGmodel()
Default constructor.
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.
bool hasSameStructure(const DAGmodel &other) const
DAGmodel & operator=(const DAGmodel &source)
Private copy operator.
~DAGmodel() override
Destructor.
bool exists(NodeId node) const final
Return true if this node exists in this graphical model.
UndiGraph moralGraph() const
The node's id are coherent with the variables and nodes of the topology.
const NodeGraphPart & nodes() const final
Returns a named copy of the internal DAG: each node id is assigned the name of the corresponding vari...
NodeId idFromName(std::string_view name) const override
Returns the NodeId of a variable given its name.
DiscreteGraphicalModel & operator=(const DiscreteGraphicalModel &source)
const DiscreteVariable & variable(NodeId id) const override
Returns a constant reference over a variable given its node id.
void _nameNodes_(NodeGraphPart &g) const
Names every node of g using variable(id).name() for each node id in g.
bool exists(const Key &k) const
Indicates whether a given elements belong to the set.
Base class for undirected graphs.
gum is the global namespace for all aGrUM entities