aGrUM  0.13.2
BayesBall.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Pierre-Henri WUILLEMIN et Christophe GONZALES *
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  ***************************************************************************/
27 #ifndef GUM_BAYESBALLS_H
28 #define GUM_BAYESBALLS_H
29 
30 #include <utility>
31 
32 #include <agrum/agrum.h>
33 
34 #include <agrum/core/hashTable.h>
35 #include <agrum/core/list.h>
36 #include <agrum/core/sequence.h>
37 
38 #include <agrum/BN/IBayesNet.h>
39 
40 namespace gum {
48  class BayesBall {
49  public:
50  // ############################################################################
52  // ############################################################################
54  private:
56  BayesBall();
57 
59  ~BayesBall();
60 
62  public:
63  // ############################################################################
65  // ############################################################################
67 
74  static void requisiteNodes(const DAG& dag,
75  const NodeSet& query,
76  const NodeSet& hardEvidence,
77  const NodeSet& softEvidence,
78  NodeSet& requisite);
79 
82  template < typename GUM_SCALAR, template < typename > class TABLE >
83  static void relevantPotentials(const IBayesNet< GUM_SCALAR >& bn,
84  const NodeSet& query,
85  const NodeSet& hardEvidence,
86  const NodeSet& softEvidence,
87  Set< const TABLE< GUM_SCALAR >* >& potentials);
88 
90  };
91 
92 } /* namespace gum */
93 
94 #ifndef GUM_NO_INLINE
96 #endif // GUM_NO_INLINE
97 
99 
100 #endif /* GUM_BAYESBALLS_H */
Implementation of the BayesBall class.
Header file of gum::Sequence, a class for storing (ordered) sequences of objects. ...
BayesBall()
Default constructor.
Definition: BayesBall_inl.h:31
static void relevantPotentials(const IBayesNet< GUM_SCALAR > &bn, const NodeSet &query, const NodeSet &hardEvidence, const NodeSet &softEvidence, Set< const TABLE< GUM_SCALAR > * > &potentials)
update a set of potentials, keeping only those d-connected with query variables given evidence ...
Definition: BayesBall_tpl.h:32
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
Implementation of Shachter&#39;s Bayes Balls algorithm.
Definition: BayesBall.h:48
~BayesBall()
Destructor.
Definition: BayesBall_inl.h:34
Generic class for manipulating lists.
Implementation of the BayesBall class.
Base class for dag.
Definition: DAG.h:98
Class hash tables iterators.
static void requisiteNodes(const DAG &dag, const NodeSet &query, const NodeSet &hardEvidence, const NodeSet &softEvidence, NodeSet &requisite)
Fill the &#39;requisite&#39; nodeset with the requisite nodes in dag given a query and evidence.
Definition: BayesBall.cpp:33