aGrUM  0.21.0
a C++ library for (probabilistic) graphical models
gum::prm::StructuredBayesBall< GUM_SCALAR > Class Template Reference

<agrum/PRM/structuredBayesBall.h> More...

#include <structuredBayesBall.h>

+ Collaboration diagram for gum::prm::StructuredBayesBall< GUM_SCALAR >:

Public Member Functions

void compute (const PRMInstance< GUM_SCALAR > *i, NodeId n)
 Compute the set or requisite nodes for each required instance given the current set of observations. Discard previous computations. More...
 
void compute (const PRMInstance< GUM_SCALAR > &i, NodeId n)
 Compute the set or requisite nodes for each required instance given the current set of observations. Discard previous computations. More...
 
bool _isHardEvidence_ (const PRMInstance< GUM_SCALAR > *i, NodeId n)
 Returns true if there is a hard evidence on i->get(n). More...
 
Constructors & destructor.
 StructuredBayesBall (const PRMInference< GUM_SCALAR > &inference)
 Default Constructor. More...
 
 ~StructuredBayesBall ()
 Destructor. More...
 
Getters and Setters.
const std::string & key (const PRMInstance< GUM_SCALAR > *i) const
 Returns a unique key w.r.t. d-separation for i. More...
 
const std::string & key (const PRMInstance< GUM_SCALAR > &i) const
 Returns a unique key w.r.t. d-separation for i. More...
 
const Set< NodeId > & requisiteNodes (const PRMInstance< GUM_SCALAR > *i) const
 Returns the set of requisite nodes w.r.t. d-separation for i. More...
 
const Set< NodeId > & requisiteNodes (const PRMInstance< GUM_SCALAR > &i) const
 Returns the set of requisite nodes w.r.t. d-separation for i. More...
 
Size occurrence (const std::string &key) const
 Returns the number of occurrence of the given key, which is the number of PRMInstance<GUM_SCALAR> sharing the same set of requisite nodes. More...
 
float liftRatio () const
 Returns the ratio between the total number of instances and the number of instances with the same configuration. More...
 
bool exists (const PRMInstance< GUM_SCALAR > *i) const
 Returns true if i has requisite nodes. More...
 
bool exists (const PRMInstance< GUM_SCALAR > &i) const
 Returns true if i has requisite nodes. More...
 

Detailed Description

template<typename GUM_SCALAR>
class gum::prm::StructuredBayesBall< GUM_SCALAR >

<agrum/PRM/structuredBayesBall.h>

This class represent the BayesBall algorithm applied on PRMs.

Definition at line 50 of file structuredBayesBall.h.

Member Typedef Documentation

◆ InstanceMap

template<typename GUM_SCALAR >
typedef HashTable< const PRMInstance< GUM_SCALAR >*, MarkMap* > gum::prm::StructuredBayesBall< GUM_SCALAR >::InstanceMap
private

Code alias.

Definition at line 120 of file structuredBayesBall.h.

◆ MarkMap

template<typename GUM_SCALAR >
typedef HashTable< NodeId, std::pair< bool, bool > > gum::prm::StructuredBayesBall< GUM_SCALAR >::MarkMap
private

Code alias.

Definition at line 118 of file structuredBayesBall.h.

Constructor & Destructor Documentation

◆ StructuredBayesBall() [1/2]

template<typename GUM_SCALAR >
INLINE gum::prm::StructuredBayesBall< GUM_SCALAR >::StructuredBayesBall ( const PRMInference< GUM_SCALAR > &  inference)

Default Constructor.

Definition at line 246 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

247  :
248  _inf_(&inference) {
249  GUM_CONSTRUCTOR(StructuredBayesBall);
250  }
StructuredBayesBall(const PRMInference< GUM_SCALAR > &inference)
Default Constructor.
const PRMInference< GUM_SCALAR > * _inf_
The PRM at which model belongs.
+ Here is the call graph for this function:

◆ ~StructuredBayesBall()

template<typename GUM_SCALAR >
gum::prm::StructuredBayesBall< GUM_SCALAR >::~StructuredBayesBall ( )

Destructor.

Definition at line 35 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

35  {
36  GUM_DESTRUCTOR(StructuredBayesBall);
37 
38  for (const auto& elt: _reqMap_)
39  delete elt.second.first;
40  }
HashTable< std::string, std::pair< Set< NodeId > *, Size > > _reqMap_
Associate a Key with the set of requisite nodes associated with it. The Size value is the number of i...
StructuredBayesBall(const PRMInference< GUM_SCALAR > &inference)
Default Constructor.
+ Here is the call graph for this function:

◆ StructuredBayesBall() [2/2]

template<typename GUM_SCALAR >
gum::prm::StructuredBayesBall< GUM_SCALAR >::StructuredBayesBall ( const StructuredBayesBall< GUM_SCALAR > &  source)
private

Copy constructor.

Member Function Documentation

◆ _buildHashKey_()

template<typename GUM_SCALAR >
std::string gum::prm::StructuredBayesBall< GUM_SCALAR >::_buildHashKey_ ( const PRMInstance< GUM_SCALAR > *  i,
Set< NodeId > &  req_nodes 
)
private

Builds the HashKey for the given instance and requisite nodes set.

Definition at line 234 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

235  {
236  std::stringstream sBuff;
237  sBuff << i->type().name();
238 
239  for (const auto node: i->type().containerDag().nodes())
240  if (req_nodes.exists(node)) sBuff << "-" << node;
241 
242  return sBuff.str();
243  }
bool exists(const Key &k) const
Indicates whether a given elements belong to the set.
Definition: set_tpl.h:600
+ Here is the call graph for this function:

◆ _clean_()

template<typename GUM_SCALAR >
void gum::prm::StructuredBayesBall< GUM_SCALAR >::_clean_ ( )
private

Cleans this before a new computation.

Definition at line 43 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

43  {
44  for (const auto& elt: _reqMap_)
45  delete elt.second.first;
46 
47  _keyMap_.clear();
48  _reqMap_.clear();
49  }
HashTable< std::string, std::pair< Set< NodeId > *, Size > > _reqMap_
Associate a Key with the set of requisite nodes associated with it. The Size value is the number of i...
HashTable< const PRMInstance< GUM_SCALAR > *, std::pair< std::string, Set< NodeId > *> > _keyMap_
Associate an PRMInstance<GUM_SCALAR> with a unique key w.r.t. d-separation and the set of requisite n...
+ Here is the call graph for this function:

◆ _compute_()

template<typename GUM_SCALAR >
void gum::prm::StructuredBayesBall< GUM_SCALAR >::_compute_ ( const PRMInstance< GUM_SCALAR > *  i,
NodeId  n 
)
private

The real compute method.

Definition at line 77 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

78  {
79  _clean_();
83  _fromChild_(i, n, marks);
84  _fillMaps_(marks);
85 
86  for (const auto& elt: marks)
87  delete elt.second;
88  }
void _fromChild_(const PRMInstance< GUM_SCALAR > *i, NodeId n, InstanceMap &marks)
When the ball is received on i->get(n) from a child.
void _fillMaps_(InstanceMap &marks)
Fill keyMap and reqMap.
void _clean_()
Cleans this before a new computation.
HashTable< const PRMInstance< GUM_SCALAR > *, MarkMap *> InstanceMap
Code alias.
+ Here is the call graph for this function:

◆ _fillMaps_()

template<typename GUM_SCALAR >
void gum::prm::StructuredBayesBall< GUM_SCALAR >::_fillMaps_ ( InstanceMap marks)
private

Fill keyMap and reqMap.

Definition at line 191 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

191  {
192  // First find for each instance it's requisite nodes
193  HashTable< const PRMInstance< GUM_SCALAR >*, Set< NodeId >* > req_map;
194 
195  for (const auto& elt: marks) {
196  Set< NodeId >* req_set = new Set< NodeId >();
197 
198  for (const auto& elt2: *elt.second)
199  if (elt2.second.first) req_set->insert(elt2.first);
200 
201  req_map.insert(elt.first, req_set);
202  }
203 
204  // Remove all instances with 0 requisite nodes
205  Set< const PRMInstance< GUM_SCALAR >* > to_remove;
206 
207  for (const auto& elt: req_map)
208  if (elt.second->size() == 0) to_remove.insert(elt.first);
209 
210  for (const auto remo: to_remove) {
211  delete req_map[remo];
212  req_map.erase(remo);
213  }
214 
215  // Fill _reqMap_ and _keyMap_
216  for (const auto& elt: req_map) {
217  std::string key = _buildHashKey_(elt.first, *elt.second);
218 
219  if (_reqMap_.exists(key)) {
220  _keyMap_.insert(elt.first,
221  std::pair< std::string, Set< NodeId >* >(key, _reqMap_[key].first));
222  _reqMap_[key].second += 1;
223  delete elt.second;
224  req_map[elt.first] = 0;
225  } else {
226  _reqMap_.insert(key, std::pair< Set< NodeId >*, Size >(elt.second, 1));
227  _keyMap_.insert(elt.first, std::pair< std::string, Set< NodeId >* >(key, elt.second));
228  }
229  }
230  }
HashTable< std::string, std::pair< Set< NodeId > *, Size > > _reqMap_
Associate a Key with the set of requisite nodes associated with it. The Size value is the number of i...
HashTable< const PRMInstance< GUM_SCALAR > *, std::pair< std::string, Set< NodeId > *> > _keyMap_
Associate an PRMInstance<GUM_SCALAR> with a unique key w.r.t. d-separation and the set of requisite n...
const std::string & key(const PRMInstance< GUM_SCALAR > *i) const
Returns a unique key w.r.t. d-separation for i.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:47
void insert(const Key &k)
Inserts a new element into the set.
Definition: set_tpl.h:606
std::string _buildHashKey_(const PRMInstance< GUM_SCALAR > *i, Set< NodeId > &req_nodes)
Builds the HashKey for the given instance and requisite nodes set.
+ Here is the call graph for this function:

◆ _fromChild_()

template<typename GUM_SCALAR >
void gum::prm::StructuredBayesBall< GUM_SCALAR >::_fromChild_ ( const PRMInstance< GUM_SCALAR > *  i,
NodeId  n,
InstanceMap marks 
)
private

When the ball is received on i->get(n) from a child.

Definition at line 91 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

93  {
94  if (!marks.exists(i)) { marks.insert(i, new StructuredBayesBall< GUM_SCALAR >::MarkMap()); }
95 
96  if (!marks[i]->exists(n)) { marks[i]->insert(n, std::pair< bool, bool >(false, false)); }
97 
98  // Sending message to parents
99  switch (i->type().get(n).elt_type()) {
101  if (!_getMark_(marks, i, n).first) {
102  _getMark_(marks, i, n).first = true;
103 
104  for (const auto inst: i->getInstances(n))
105  _fromChild_(inst, inst->get(_getSC_(i, n).lastElt().safeName()).id(), marks);
106  }
107 
108  if (!_getMark_(marks, i, n).second) {
109  _getMark_(marks, i, n).second = true;
110 
111  for (const auto chi: i->type().containerDag().children(n))
112  _fromParent_(i, chi, marks);
113  }
114 
115  break;
116  }
117 
120  if (!_getMark_(marks, i, n).first) {
121  _getMark_(marks, i, n).first = true;
122 
123  if (!_isHardEvidence_(i, n))
124  for (const auto par: i->type().containerDag().parents(n))
125  _fromChild_(i, par, marks);
126  }
127 
128  if (!_getMark_(marks, i, n).second) {
129  _getMark_(marks, i, n).second = true;
130 
131  // In i.
132  for (const auto chi: i->type().containerDag().children(n))
133  _fromParent_(i, chi, marks);
134 
135  // Out of i.
136  try {
137  const auto& refs = i->getRefAttr(n);
138 
139  for (auto iter = refs.begin(); iter != refs.end(); ++iter)
140  _fromParent_(iter->first, iter->first->type().get(iter->second).id(), marks);
141  } catch (NotFound&) {
142  // Not an inverse sc
143  }
144  }
145 
146  break;
147  }
148 
149  default: {
150  // We shouldn't reach any other PRMClassElement<GUM_DATA> than
151  // PRMAttribute
152  // or
153  // PRMSlotChain<GUM_SCALAR>.
154  GUM_ERROR(FatalError, "This case is impossible.")
155  }
156  }
157  }
void _fromParent_(const PRMInstance< GUM_SCALAR > *i, NodeId n, InstanceMap &marks)
When the ball is receive on i->get(n) from a parent.
bool _isHardEvidence_(const PRMInstance< GUM_SCALAR > *i, NodeId n)
Returns true if there is a hard evidence on i->get(n).
void _fromChild_(const PRMInstance< GUM_SCALAR > *i, NodeId n, InstanceMap &marks)
When the ball is received on i->get(n) from a child.
bool exists(const PRMInstance< GUM_SCALAR > *i) const
Returns true if i has requisite nodes.
HashTable< NodeId, std::pair< bool, bool > > MarkMap
Code alias.
const PRMSlotChain< GUM_SCALAR > & _getSC_(const PRMInstance< GUM_SCALAR > *i, NodeId n)
Code alias.
std::pair< bool, bool > & _getMark_(InstanceMap &marks, const PRMInstance< GUM_SCALAR > *i, NodeId n)
Code alias.
#define GUM_ERROR(type, msg)
Definition: exceptions.h:51
+ Here is the call graph for this function:

◆ _fromParent_()

template<typename GUM_SCALAR >
void gum::prm::StructuredBayesBall< GUM_SCALAR >::_fromParent_ ( const PRMInstance< GUM_SCALAR > *  i,
NodeId  n,
InstanceMap marks 
)
private

When the ball is receive on i->get(n) from a parent.

Definition at line 160 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

162  {
163  if (!marks.exists(i)) { marks.insert(i, new StructuredBayesBall< GUM_SCALAR >::MarkMap()); }
164 
165  if (!marks[i]->exists(n)) { marks[i]->insert(n, std::pair< bool, bool >(false, false)); }
166 
167  // Concerns only PRMAttribute (because of the hard evidence)
168  if ((_isHardEvidence_(i, n)) && (!_getMark_(marks, i, n).first)) {
169  _getMark_(marks, i, n).first = true;
170 
171  for (const auto par: i->type().containerDag().parents(n))
172  _fromChild_(i, par, marks);
173  } else if (!_getMark_(marks, i, n).second) {
174  _getMark_(marks, i, n).second = true;
175 
176  // In i.
177  for (const auto chi: i->type().containerDag().children(n))
178  _fromParent_(i, chi, marks);
179 
180  // Out of i.
181  try {
182  for (auto iter = i->getRefAttr(n).begin(); iter != i->getRefAttr(n).end(); ++iter)
183  _fromParent_(iter->first, iter->first->type().get(iter->second).id(), marks);
184  } catch (NotFound&) {
185  // Not an inverse sc
186  }
187  }
188  }
void _fromParent_(const PRMInstance< GUM_SCALAR > *i, NodeId n, InstanceMap &marks)
When the ball is receive on i->get(n) from a parent.
bool _isHardEvidence_(const PRMInstance< GUM_SCALAR > *i, NodeId n)
Returns true if there is a hard evidence on i->get(n).
void _fromChild_(const PRMInstance< GUM_SCALAR > *i, NodeId n, InstanceMap &marks)
When the ball is received on i->get(n) from a child.
bool exists(const PRMInstance< GUM_SCALAR > *i) const
Returns true if i has requisite nodes.
HashTable< NodeId, std::pair< bool, bool > > MarkMap
Code alias.
std::pair< bool, bool > & _getMark_(InstanceMap &marks, const PRMInstance< GUM_SCALAR > *i, NodeId n)
Code alias.
+ Here is the call graph for this function:

◆ _getMark_()

template<typename GUM_SCALAR >
INLINE std::pair< bool, bool > & gum::prm::StructuredBayesBall< GUM_SCALAR >::_getMark_ ( InstanceMap marks,
const PRMInstance< GUM_SCALAR > *  i,
NodeId  n 
)
private

Code alias.

Definition at line 332 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

334  {
335  return (*(marks[i]))[n];
336  }
+ Here is the call graph for this function:

◆ _getSC_()

template<typename GUM_SCALAR >
INLINE const PRMSlotChain< GUM_SCALAR > & gum::prm::StructuredBayesBall< GUM_SCALAR >::_getSC_ ( const PRMInstance< GUM_SCALAR > *  i,
NodeId  n 
)
private

Code alias.

Definition at line 326 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

326  {
327  return static_cast< const PRMSlotChain< GUM_SCALAR >& >(i->type().get(n));
328  }
+ Here is the call graph for this function:

◆ _isHardEvidence_()

template<typename GUM_SCALAR >
bool gum::prm::StructuredBayesBall< GUM_SCALAR >::_isHardEvidence_ ( const PRMInstance< GUM_SCALAR > *  i,
NodeId  n 
)

Returns true if there is a hard evidence on i->get(n).

Definition at line 52 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

53  {
54  try {
55  typename PRMInference< GUM_SCALAR >::Chain chain = std::make_pair(i, &(i->get(n)));
56 
57  if (_inf_->hasEvidence(chain)) {
58  const Potential< GUM_SCALAR >* e = _inf_->evidence(i)[n];
59  Instantiation inst(e);
60  Size count = 0;
61 
62  for (inst.setFirst(); !inst.end(); inst.inc()) {
63  if ((e->get(inst) == (GUM_SCALAR)1.0))
64  ++count;
65  else if (e->get(inst) != (GUM_SCALAR)0.0)
66  return false;
67  }
68 
69  return (count == 1);
70  }
71 
72  return false;
73  } catch (NotFound&) { return false; }
74  }
std::pair< const PRMInstance< GUM_SCALAR > *, const PRMAttribute< GUM_SCALAR > *> Chain
Code alias.
Definition: PRMInference.h:55
const PRMInference< GUM_SCALAR > * _inf_
The PRM at which model belongs.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:47
+ Here is the call graph for this function:

◆ compute() [1/2]

template<typename GUM_SCALAR >
INLINE void gum::prm::StructuredBayesBall< GUM_SCALAR >::compute ( const PRMInstance< GUM_SCALAR > *  i,
NodeId  n 
)

Compute the set or requisite nodes for each required instance given the current set of observations. Discard previous computations.

Definition at line 313 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

314  {
315  _compute_(i, n);
316  }
void _compute_(const PRMInstance< GUM_SCALAR > *i, NodeId n)
The real compute method.
+ Here is the call graph for this function:

◆ compute() [2/2]

template<typename GUM_SCALAR >
INLINE void gum::prm::StructuredBayesBall< GUM_SCALAR >::compute ( const PRMInstance< GUM_SCALAR > &  i,
NodeId  n 
)

Compute the set or requisite nodes for each required instance given the current set of observations. Discard previous computations.

Definition at line 319 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

320  {
321  _compute_(&i, n);
322  }
void _compute_(const PRMInstance< GUM_SCALAR > *i, NodeId n)
The real compute method.
+ Here is the call graph for this function:

◆ exists() [1/2]

template<typename GUM_SCALAR >
INLINE bool gum::prm::StructuredBayesBall< GUM_SCALAR >::exists ( const PRMInstance< GUM_SCALAR > *  i) const

Returns true if i has requisite nodes.

Definition at line 302 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

302  {
303  return _keyMap_.exists(i);
304  }
HashTable< const PRMInstance< GUM_SCALAR > *, std::pair< std::string, Set< NodeId > *> > _keyMap_
Associate an PRMInstance<GUM_SCALAR> with a unique key w.r.t. d-separation and the set of requisite n...
+ Here is the call graph for this function:

◆ exists() [2/2]

template<typename GUM_SCALAR >
INLINE bool gum::prm::StructuredBayesBall< GUM_SCALAR >::exists ( const PRMInstance< GUM_SCALAR > &  i) const

Returns true if i has requisite nodes.

Definition at line 308 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

308  {
309  return _keyMap_.exists(&i);
310  }
HashTable< const PRMInstance< GUM_SCALAR > *, std::pair< std::string, Set< NodeId > *> > _keyMap_
Associate an PRMInstance<GUM_SCALAR> with a unique key w.r.t. d-separation and the set of requisite n...
+ Here is the call graph for this function:

◆ key() [1/2]

template<typename GUM_SCALAR >
INLINE const std::string & gum::prm::StructuredBayesBall< GUM_SCALAR >::key ( const PRMInstance< GUM_SCALAR > *  i) const

Returns a unique key w.r.t. d-separation for i.

Definition at line 268 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

268  {
269  return _keyMap_[i].first;
270  }
HashTable< const PRMInstance< GUM_SCALAR > *, std::pair< std::string, Set< NodeId > *> > _keyMap_
Associate an PRMInstance<GUM_SCALAR> with a unique key w.r.t. d-separation and the set of requisite n...
+ Here is the call graph for this function:

◆ key() [2/2]

template<typename GUM_SCALAR >
INLINE const std::string & gum::prm::StructuredBayesBall< GUM_SCALAR >::key ( const PRMInstance< GUM_SCALAR > &  i) const

Returns a unique key w.r.t. d-separation for i.

Definition at line 274 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

274  {
275  return _keyMap_[&i].first;
276  }
HashTable< const PRMInstance< GUM_SCALAR > *, std::pair< std::string, Set< NodeId > *> > _keyMap_
Associate an PRMInstance<GUM_SCALAR> with a unique key w.r.t. d-separation and the set of requisite n...
+ Here is the call graph for this function:

◆ liftRatio()

template<typename GUM_SCALAR >
INLINE float gum::prm::StructuredBayesBall< GUM_SCALAR >::liftRatio ( ) const

Returns the ratio between the total number of instances and the number of instances with the same configuration.

Definition at line 296 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

296  {
297  return ((float)_reqMap_.size()) / ((float)_keyMap_.size());
298  }
HashTable< std::string, std::pair< Set< NodeId > *, Size > > _reqMap_
Associate a Key with the set of requisite nodes associated with it. The Size value is the number of i...
HashTable< const PRMInstance< GUM_SCALAR > *, std::pair< std::string, Set< NodeId > *> > _keyMap_
Associate an PRMInstance<GUM_SCALAR> with a unique key w.r.t. d-separation and the set of requisite n...
+ Here is the call graph for this function:

◆ occurrence()

template<typename GUM_SCALAR >
INLINE Size gum::prm::StructuredBayesBall< GUM_SCALAR >::occurrence ( const std::string &  key) const

Returns the number of occurrence of the given key, which is the number of PRMInstance<GUM_SCALAR> sharing the same set of requisite nodes.

Definition at line 291 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

291  {
292  return _reqMap_[key].second;
293  }
HashTable< std::string, std::pair< Set< NodeId > *, Size > > _reqMap_
Associate a Key with the set of requisite nodes associated with it. The Size value is the number of i...
const std::string & key(const PRMInstance< GUM_SCALAR > *i) const
Returns a unique key w.r.t. d-separation for i.
+ Here is the call graph for this function:

◆ operator=()

template<typename GUM_SCALAR >
INLINE StructuredBayesBall< GUM_SCALAR > & gum::prm::StructuredBayesBall< GUM_SCALAR >::operator= ( const StructuredBayesBall< GUM_SCALAR > &  source)
private

Copy operator.

Definition at line 261 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

262  {
263  GUM_ERROR(FatalError, "Not allowed.")
264  }
#define GUM_ERROR(type, msg)
Definition: exceptions.h:51
+ Here is the call graph for this function:

◆ requisiteNodes() [1/2]

template<typename GUM_SCALAR >
INLINE const Set< NodeId > & gum::prm::StructuredBayesBall< GUM_SCALAR >::requisiteNodes ( const PRMInstance< GUM_SCALAR > *  i) const

Returns the set of requisite nodes w.r.t. d-separation for i.

Definition at line 280 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

280  {
281  return *(_keyMap_[i].second);
282  }
HashTable< const PRMInstance< GUM_SCALAR > *, std::pair< std::string, Set< NodeId > *> > _keyMap_
Associate an PRMInstance<GUM_SCALAR> with a unique key w.r.t. d-separation and the set of requisite n...
+ Here is the call graph for this function:

◆ requisiteNodes() [2/2]

template<typename GUM_SCALAR >
INLINE const Set< NodeId > & gum::prm::StructuredBayesBall< GUM_SCALAR >::requisiteNodes ( const PRMInstance< GUM_SCALAR > &  i) const

Returns the set of requisite nodes w.r.t. d-separation for i.

Definition at line 286 of file structuredBayesBall_tpl.h.

References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().

286  {
287  return *(_keyMap_[&i].second);
288  }
HashTable< const PRMInstance< GUM_SCALAR > *, std::pair< std::string, Set< NodeId > *> > _keyMap_
Associate an PRMInstance<GUM_SCALAR> with a unique key w.r.t. d-separation and the set of requisite n...
+ Here is the call graph for this function:

Member Data Documentation

◆ _inf_

template<typename GUM_SCALAR >
const PRMInference< GUM_SCALAR >* gum::prm::StructuredBayesBall< GUM_SCALAR >::_inf_
private

The PRM at which model belongs.

Definition at line 146 of file structuredBayesBall.h.

◆ _keyMap_

template<typename GUM_SCALAR >
HashTable< const PRMInstance< GUM_SCALAR >*, std::pair< std::string, Set< NodeId >* > > gum::prm::StructuredBayesBall< GUM_SCALAR >::_keyMap_
private

Associate an PRMInstance<GUM_SCALAR> with a unique key w.r.t. d-separation and the set of requisite nodes deduced from d-separation analysis.

Definition at line 153 of file structuredBayesBall.h.

◆ _reqMap_

template<typename GUM_SCALAR >
HashTable< std::string, std::pair< Set< NodeId >*, Size > > gum::prm::StructuredBayesBall< GUM_SCALAR >::_reqMap_
private

Associate a Key with the set of requisite nodes associated with it. The Size value is the number of instance with the same key.

Definition at line 157 of file structuredBayesBall.h.


The documentation for this class was generated from the following files: