58 for (
const auto arc :
arcs())
64 for (
const auto node :
nodes()) {
65 const auto& par =
parents(node);
67 for (
auto it1 = par.begin(); it1 != par.end(); ++it1) {
70 for (++it2; it2 != par.end(); ++it2) {
79 if (
this != &source) {
122 if (
this == &other)
return true;
124 if (
size() != other.
size())
return false;
128 for (
const auto& nid :
nodes()) {
131 }
catch (
NotFound) {
return false; }
134 for (
const auto& arc :
arcs()) {
DAGmodel & operator=(const DAGmodel &source)
Private copy operator.
const ArcSet & arcs() const
returns the set of nodes with arc ingoing to a given node
virtual void clear()
removes all the nodes and edges from the graph
Virtual base class for PGMs using a DAG.
UndiGraph * __mutableMoralGraph
The moral graph of this Directed Graphical Model.
const NodeSet & parents(const NodeId id) const
returns the set of nodes with arc ingoing to a given node
Size sizeArcs() const
Returns the number of arcs in this Directed Graphical Model.
virtual void addEdge(const NodeId first, const NodeId second)
insert a new edge into the undirected graph
virtual ~DAGmodel()
Destructor.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual NodeId idFromName(const std::string &name) const =0
Getter by name.
HashTable< std::string, std::string > * __propertiesMap
The properties of this Directed Graphical Model. Initialized using a lazy instantiation.
bool hasSameStructure(const DAGmodel &other)
Size size() const
Returns the number of variables in this Directed Graphical Model.
bool exists(const Key &k) const
Indicates whether a given elements belong to the set.
DAG _dag
The DAG of this Directed Graphical Model.
const Sequence< NodeId > & topologicalOrder(bool clear=true) const
The topological order stays the same as long as no variable or arcs are added or erased src the topol...
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void __moralGraph() const
Returns the moral graph of this DAGModel.
The base class for all directed edgesThis class is used as a basis for manipulating all directed edge...
DAGmodel()
Default constructor.
const NodeGraphPart & nodes() const
Returns a constant reference to the dag of this Bayes Net.
virtual const DiscreteVariable & variable(NodeId id) const =0
Returns a constant reference over a variabe given it's node id.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
const Sequence< NodeId > & topologicalOrder(bool clear=true) const
The topological order stays the same as long as no variable or arcs are added or erased src the topol...
const UndiGraph & moralGraph(bool clear=true) const
The node's id are coherent with the variables and nodes of the topology.
Base class for undirected graphs.
void populateNodes(const NodeGraphPart &s)
populateNodes clears *this and fills it with the same nodes as "s"
const DAG & dag() const
Returns a constant reference to the dag of this Bayes Net.