![]() |
aGrUM 3.2.0
a C++ library for (probabilistic) graphical models
|
A parent's value in gum::KTBN::fillCPT(): a modality index or a modality label. More...
#include <agrum/KTBN/KTBN.h>
Public Member Functions | |
| template<std::integral T> | |
| KTBNModality (T modality) | |
| From a modality index. | |
| KTBNModality (const char *modality) | |
| From a modality label. | |
| KTBNModality (std::string modality) | |
| From a modality label. | |
| Idx | toIndex (const DiscreteVariable &var) const |
Resolves this value to a modality index of var, looking the label up when one was given. | |
Public Attributes | |
| bool | isLabel |
| Whether the value was spelled as a label rather than an index. | |
| Idx | index {} |
| The index, when isLabel is false. | |
| std::string | label |
| The label, when isLabel is true. | |
A parent's value in gum::KTBN::fillCPT(): a modality index or a modality label.
Implicitly built from either spelling, so a single fillCPT() signature serves both and one parent map may mix them:
RangeVariable over 2..5, 2 is the third modality (the one labelled "4") while "2" is the first. Quote the value whenever you mean the label.Idx vs std::string) would be ambiguous for every braced argument, a braced list having no type to resolve on — hence this wrapper. | gum::KTBNModality::KTBNModality | ( | T | modality | ) |
From a modality index.
Definition at line 71 of file KTBN_tpl.h.
| gum::KTBNModality::KTBNModality | ( | const char * | modality | ) |
From a modality label.
| gum::KTBNModality::KTBNModality | ( | std::string | modality | ) |
From a modality label.
| Idx gum::KTBNModality::toIndex | ( | const DiscreteVariable & | var | ) | const |
Resolves this value to a modality index of var, looking the label up when one was given.
| NotFound | / OutOfBounds if the index is out of var's domain or the label is not one of its modalities (which of the two is raised for an unknown label depends on the variable type). |
Referenced by gum::KTBNInference< GUM_SCALAR >::addIntervention(), and gum::KTBNInference< GUM_SCALAR >::addObservation().
| Idx gum::KTBNModality::index {} |
The index, when isLabel is false.
Definition at line 118 of file KTBN.h.
Referenced by KTBNModality().
| bool gum::KTBNModality::isLabel |
Whether the value was spelled as a label rather than an index.
Definition at line 116 of file KTBN.h.
Referenced by KTBNModality().
| std::string gum::KTBNModality::label |