aGrUM  0.14.2
barrenNodesFinder.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES et Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
26 #ifndef GUM_BARREN_NODES_FINDER_H
27 #define GUM_BARREN_NODES_FINDER_H
28 
29 
30 #include <agrum/BN/BayesNet.h>
31 #include <agrum/agrum.h>
32 #include <agrum/graphs/DAG.h>
34 
35 
36 namespace gum {
37 
38 
45  public:
46  // ############################################################################
48  // ############################################################################
50 
52  explicit BarrenNodesFinder(const DAG* dag);
53 
56 
58  BarrenNodesFinder(BarrenNodesFinder&& from) noexcept;
59 
62 
64 
65 
66  // ############################################################################
68  // ############################################################################
70 
73 
76 
78 
79 
80  // ############################################################################
82  // ############################################################################
84 
86  void setDAG(const DAG* new_dag);
87 
89  void setEvidence(const NodeSet* observed_nodes);
90 
92  void setTargets(const NodeSet* target_nodes);
93 
96 
98  ArcProperty< NodeSet > barrenNodes(const CliqueGraph& junction_tree);
99 
101  template < typename GUM_SCALAR >
103  barrenPotentials(const CliqueGraph& junction_tree,
104  const IBayesNet< GUM_SCALAR >& bn);
105 
107 
108  private:
110  const DAG* __dag;
111 
114 
117  };
118 
119 
120 } /* namespace gum */
121 
122 
123 #ifndef GUM_NO_INLINE
125 #endif // GUM_NO_INLINE
126 
127 
129 
130 
131 #endif /* GUM_BARREN_NODES_FINDER_H */
const NodeSet * __observed_nodes
the set of observed nodes
Class representing Bayesian networks.
Class representing the minimal interface for Bayesian Network.
Definition: IBayesNet.h:59
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
The class for generic Hash Tables.
Definition: hashTable.h:676
BarrenNodesFinder & operator=(const BarrenNodesFinder &from)
copy operator
NodeSet barrenNodes()
returns the set of barren nodes
Basic graph of cliques.
Definition: cliqueGraph.h:55
const DAG * __dag
the DAG on which we compute the barren nodes
BarrenNodesFinder(const DAG *dag)
default constructor
void setTargets(const NodeSet *target_nodes)
sets the set of target nodes we are interested in
const NodeSet * __target_nodes
the set of targeted nodes
void setEvidence(const NodeSet *observed_nodes)
sets the observed nodes in the DAG
Detect barren nodes for inference in Bayesian networks.
Basic class for all graphs of cliques (join trees, etc)
Base class for dag.
Definition: DAG.h:99
Base classes for directed acyclic graphs.
void setDAG(const DAG *new_dag)
sets a new DAG
ArcProperty< Set< const Potential< GUM_SCALAR > *> > barrenPotentials(const CliqueGraph &junction_tree, const IBayesNet< GUM_SCALAR > &bn)
returns the set of barren potentials in messages sent in a junction tree