aGrUM  0.20.2
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 122 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 120 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 270 of file structuredBayesBall_tpl.h.

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

271  :
272  inf__(&inference) {
273  GUM_CONSTRUCTOR(StructuredBayesBall);
274  }
const PRMInference< GUM_SCALAR > * inf__
The PRM at which model__ belongs.
StructuredBayesBall(const PRMInference< GUM_SCALAR > &inference)
Default Constructor.
+ 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 257 of file structuredBayesBall_tpl.h.

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

259  {
260  std::stringstream sBuff;
261  sBuff << i->type().name();
262 
263  for (const auto node: i->type().containerDag().nodes())
264  if (req_nodes.exists(node)) sBuff << "-" << node;
265 
266  return sBuff.str();
267  }
bool exists(const Key &k) const
Indicates whether a given elements belong to the set.
Definition: set_tpl.h:626
+ 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< 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...
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...
+ 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 339 of file structuredBayesBall_tpl.h.

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

341  {
342  compute__(i, n);
343  }
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 346 of file structuredBayesBall_tpl.h.

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

348  {
349  compute__(&i, n);
350  }
void compute__(const PRMInstance< GUM_SCALAR > *i, NodeId n)
The real compute method.
+ 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 79 of file structuredBayesBall_tpl.h.

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

81  {
82  clean__();
86  fromChild__(i, n, marks);
87  fillMaps__(marks);
88 
89  for (const auto& elt: marks)
90  delete elt.second;
91  }
void clean__()
Cleans this before a new computation.
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__.
HashTable< const PRMInstance< GUM_SCALAR > *, MarkMap *> InstanceMap
Code alias.
+ 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 327 of file structuredBayesBall_tpl.h.

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

328  {
329  return keyMap__.exists(i);
330  }
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 333 of file structuredBayesBall_tpl.h.

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

334  {
335  return keyMap__.exists(&i);
336  }
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:

◆ fillMaps__()

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

Fill keyMap__ and reqMap__.

Definition at line 212 of file structuredBayesBall_tpl.h.

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

212  {
213  // First find for each instance it's requisite nodes
214  HashTable< const PRMInstance< GUM_SCALAR >*, Set< NodeId >* > req_map;
215 
216  for (const auto& elt: marks) {
217  Set< NodeId >* req_set = new Set< NodeId >();
218 
219  for (const auto& elt2: *elt.second)
220  if (elt2.second.first) req_set->insert(elt2.first);
221 
222  req_map.insert(elt.first, req_set);
223  }
224 
225  // Remove all instances with 0 requisite nodes
226  Set< const PRMInstance< GUM_SCALAR >* > to_remove;
227 
228  for (const auto& elt: req_map)
229  if (elt.second->size() == 0) to_remove.insert(elt.first);
230 
231  for (const auto remo: to_remove) {
232  delete req_map[remo];
233  req_map.erase(remo);
234  }
235 
236  // Fill reqMap__ and keyMap__
237  for (const auto& elt: req_map) {
238  std::string key = buildHashKey__(elt.first, *elt.second);
239 
240  if (reqMap__.exists(key)) {
241  keyMap__.insert(
242  elt.first,
243  std::pair< std::string, Set< NodeId >* >(key, reqMap__[key].first));
244  reqMap__[key].second += 1;
245  delete elt.second;
246  req_map[elt.first] = 0;
247  } else {
248  reqMap__.insert(key, std::pair< Set< NodeId >*, Size >(elt.second, 1));
249  keyMap__.insert(
250  elt.first,
251  std::pair< std::string, Set< NodeId >* >(key, elt.second));
252  }
253  }
254  }
std::string buildHashKey__(const PRMInstance< GUM_SCALAR > *i, Set< NodeId > &req_nodes)
Builds the HashKey for the given instance and requisite nodes set.
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.
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...
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:632
+ 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 94 of file structuredBayesBall_tpl.h.

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

97  {
98  if (!marks.exists(i)) {
99  marks.insert(i, new StructuredBayesBall< GUM_SCALAR >::MarkMap());
100  }
101 
102  if (!marks[i]->exists(n)) {
103  marks[i]->insert(n, std::pair< bool, bool >(false, false));
104  }
105 
106  // Sending message to parents
107  switch (i->type().get(n).elt_type()) {
109  if (!getMark__(marks, i, n).first) {
110  getMark__(marks, i, n).first = true;
111 
112  for (const auto inst: i->getInstances(n))
113  fromChild__(inst,
114  inst->get(getSC__(i, n).lastElt().safeName()).id(),
115  marks);
116  }
117 
118  if (!getMark__(marks, i, n).second) {
119  getMark__(marks, i, n).second = true;
120 
121  for (const auto chi: i->type().containerDag().children(n))
122  fromParent__(i, chi, marks);
123  }
124 
125  break;
126  }
127 
130  if (!getMark__(marks, i, n).first) {
131  getMark__(marks, i, n).first = true;
132 
133  if (!isHardEvidence__(i, n))
134  for (const auto par: i->type().containerDag().parents(n))
135  fromChild__(i, par, marks);
136  }
137 
138  if (!getMark__(marks, i, n).second) {
139  getMark__(marks, i, n).second = true;
140 
141  // In i.
142  for (const auto chi: i->type().containerDag().children(n))
143  fromParent__(i, chi, marks);
144 
145  // Out of i.
146  try {
147  const auto& refs = i->getRefAttr(n);
148 
149  for (auto iter = refs.begin(); iter != refs.end(); ++iter)
150  fromParent__(iter->first,
151  iter->first->type().get(iter->second).id(),
152  marks);
153  } catch (NotFound&) {
154  // Not an inverse sc
155  }
156  }
157 
158  break;
159  }
160 
161  default: {
162  // We shouldn't reach any other PRMClassElement<GUM_DATA> than
163  // PRMAttribute
164  // or
165  // PRMSlotChain<GUM_SCALAR>.
166  GUM_ERROR(FatalError, "This case is impossible.");
167  }
168  }
169  }
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.
const PRMSlotChain< GUM_SCALAR > & getSC__(const PRMInstance< GUM_SCALAR > *i, NodeId n)
Code alias.
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.
void fromParent__(const PRMInstance< GUM_SCALAR > *i, NodeId n, InstanceMap &marks)
When the ball is receive on i->get(n) from a parent.
#define GUM_ERROR(type, msg)
Definition: exceptions.h:54
+ 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 172 of file structuredBayesBall_tpl.h.

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

175  {
176  if (!marks.exists(i)) {
177  marks.insert(i, new StructuredBayesBall< GUM_SCALAR >::MarkMap());
178  }
179 
180  if (!marks[i]->exists(n)) {
181  marks[i]->insert(n, std::pair< bool, bool >(false, false));
182  }
183 
184  // Concerns only PRMAttribute (because of the hard evidence)
185  if ((isHardEvidence__(i, n)) && (!getMark__(marks, i, n).first)) {
186  getMark__(marks, i, n).first = true;
187 
188  for (const auto par: i->type().containerDag().parents(n))
189  fromChild__(i, par, marks);
190  } else if (!getMark__(marks, i, n).second) {
191  getMark__(marks, i, n).second = true;
192 
193  // In i.
194  for (const auto chi: i->type().containerDag().children(n))
195  fromParent__(i, chi, marks);
196 
197  // Out of i.
198  try {
199  for (auto iter = i->getRefAttr(n).begin();
200  iter != i->getRefAttr(n).end();
201  ++iter)
202  fromParent__(iter->first,
203  iter->first->type().get(iter->second).id(),
204  marks);
205  } catch (NotFound&) {
206  // Not an inverse sc
207  }
208  }
209  }
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.
void fromParent__(const PRMInstance< GUM_SCALAR > *i, NodeId n, InstanceMap &marks)
When the ball is receive on i->get(n) from a parent.
+ 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 361 of file structuredBayesBall_tpl.h.

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

364  {
365  return (*(marks[i]))[n];
366  }
+ 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 354 of file structuredBayesBall_tpl.h.

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

356  {
357  return static_cast< const PRMSlotChain< GUM_SCALAR >& >(i->type().get(n));
358  }
+ 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().

54  {
55  try {
57  = std::make_pair(i, &(i->get(n)));
58 
59  if (inf__->hasEvidence(chain)) {
60  const Potential< GUM_SCALAR >* e = inf__->evidence(i)[n];
61  Instantiation inst(e);
62  Size count = 0;
63 
64  for (inst.setFirst(); !inst.end(); inst.inc()) {
65  if ((e->get(inst) == (GUM_SCALAR)1.0))
66  ++count;
67  else if (e->get(inst) != (GUM_SCALAR)0.0)
68  return false;
69  }
70 
71  return (count == 1);
72  }
73 
74  return false;
75  } catch (NotFound&) { return false; }
76  }
const PRMInference< GUM_SCALAR > * inf__
The PRM at which model__ belongs.
std::pair< const PRMInstance< GUM_SCALAR > *, const PRMAttribute< GUM_SCALAR > *> Chain
Code alias.
Definition: PRMInference.h:56
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:47
+ 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 292 of file structuredBayesBall_tpl.h.

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

293  {
294  return keyMap__[i].first;
295  }
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 298 of file structuredBayesBall_tpl.h.

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

299  {
300  return keyMap__[&i].first;
301  }
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 322 of file structuredBayesBall_tpl.h.

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

322  {
323  return ((float)reqMap__.size()) / ((float)keyMap__.size());
324  }
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...
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...
+ 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 316 of file structuredBayesBall_tpl.h.

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

317  {
318  return reqMap__[key].second;
319  }
const std::string & key(const PRMInstance< GUM_SCALAR > *i) const
Returns a unique key w.r.t. d-separation for i.
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...
+ 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 286 of file structuredBayesBall_tpl.h.

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

287  {
288  GUM_ERROR(FatalError, "Not allowed.");
289  }
#define GUM_ERROR(type, msg)
Definition: exceptions.h:54
+ 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 304 of file structuredBayesBall_tpl.h.

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

305  {
306  return *(keyMap__[i].second);
307  }
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 310 of file structuredBayesBall_tpl.h.

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

311  {
312  return *(keyMap__[&i].second);
313  }
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 155 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 163 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 167 of file structuredBayesBall.h.


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