![]() |
aGrUM 3.0.0
a C++ library for (probabilistic) graphical models
|
<agrum/base/multidim/core/testPolicies/GTestPolicy.h> More...
#include <GTestPolicy.h>
Public Member Functions | |
Constructor/Destrcutor | |
| GTestPolicy () | |
| Constructor. | |
| ~GTestPolicy () override | |
| Destructor. | |
| void * | operator new (size_t s) |
| Allocators and Deallocators redefinition. | |
| void | operator delete (void *p) |
| Constructor. | |
Observation insertion | |
| void | addObservation (Idx iattr, GUM_ELEMENT ivalue) override |
| Comptabilizes the new observation. | |
Test methods | |
| bool | isTestRelevant () const override |
| Returns true if enough observation were made so that the test can be relevant. | |
| void | computeScore () const override |
| Computes the GStat of current variable according to the test. | |
| double | score () const override |
| Returns the performance of current variable according to the test. | |
| double | secondaryscore () const override |
| Returns a second criterion to severe ties. | |
Fusion Methods | |
| void | add (const GTestPolicy< GUM_ELEMENT > &src) |
| Performs the merging of current GTestPolicy instance with given instance. | |
| const ContingencyTable< Idx, GUM_ELEMENT > & | ct () const |
| Returns contingency table (needed for the merging of GTestPolicy instances). | |
Miscelleanous Methods | |
| std::string | toString () const |
Observation methods | |
| Idx | nbObservation () const |
| Comptabilizes the new observation. | |
Fusion Methods | |
| void | add (const ITestPolicy< GUM_ELEMENT > &src) |
Protected Member Functions | |
| bool | isModified_ () const |
Private Attributes | |
| ContingencyTable< Idx, GUM_ELEMENT > | _conTab_ |
| The contingency table used to keeps records of all observation. | |
| double | _GStat_ |
| bool | _isModified_ |
| Booleans indicating if we have to re eval test. | |
| Idx | _nbObs_ |
<agrum/base/multidim/core/testPolicies/GTestPolicy.h>
G implements a test policy that follows the G statistic
Definition at line 74 of file GTestPolicy.h.
| gum::GTestPolicy< GUM_ELEMENT >::GTestPolicy | ( | ) |
Constructor.
Definition at line 136 of file GTestPolicy_tpl.h.
References GTestPolicy(), gum::ITestPolicy< GUM_ELEMENT >::ITestPolicy(), _conTab_, and _GStat_.
Referenced by GTestPolicy(), ~GTestPolicy(), add(), operator delete(), and operator new().
|
override |
Destructor.
Definition at line 141 of file GTestPolicy_tpl.h.
References GTestPolicy().
| void gum::GTestPolicy< GUM_ELEMENT >::add | ( | const GTestPolicy< GUM_ELEMENT > & | src | ) |
Performs the merging of current GTestPolicy instance with given instance.
Definition at line 130 of file GTestPolicy_tpl.h.
References GTestPolicy(), _conTab_, gum::ITestPolicy< GUM_ELEMENT >::add(), and ct().
|
inherited |
Definition at line 86 of file ITestPolicy_tpl.h.
References ITestPolicy(), _isModified_, _nbObs_, and nbObservation().
Referenced by gum::Chi2TestPolicy< GUM_ELEMENT >::add(), gum::GTestPolicy< GUM_ELEMENT >::add(), and gum::LeastSquareTestPolicy< GUM_ELEMENT >::add().
|
overridevirtual |
Comptabilizes the new observation.
Reimplemented from gum::ITestPolicy< GUM_ELEMENT >.
Definition at line 69 of file GTestPolicy_tpl.h.
References _conTab_, and gum::ITestPolicy< GUM_ELEMENT >::addObservation().
|
overridevirtual |
Computes the GStat of current variable according to the test.
Reimplemented from gum::ITestPolicy< GUM_ELEMENT >.
Definition at line 82 of file GTestPolicy_tpl.h.
References _conTab_, _GStat_, gum::ITestPolicy< GUM_ELEMENT >::computeScore(), and gum::ITestPolicy< GUM_ELEMENT >::nbObservation().
Referenced by score(), and secondaryscore().
| const ContingencyTable< Idx, GUM_ELEMENT > & gum::GTestPolicy< GUM_ELEMENT >::ct | ( | ) | const |
Returns contingency table (needed for the merging of GTestPolicy instances).
Definition at line 162 of file GTestPolicy_tpl.h.
References _conTab_.
Referenced by add().
|
protectedinherited |
Definition at line 97 of file ITestPolicy_tpl.h.
References _isModified_.
Referenced by gum::Chi2TestPolicy< GUM_ELEMENT >::score(), gum::GTestPolicy< GUM_ELEMENT >::score(), gum::LeastSquareTestPolicy< GUM_ELEMENT >::score(), gum::Chi2TestPolicy< GUM_ELEMENT >::secondaryscore(), gum::GTestPolicy< GUM_ELEMENT >::secondaryscore(), and gum::LeastSquareTestPolicy< GUM_ELEMENT >::secondaryscore().
|
overridevirtual |
Returns true if enough observation were made so that the test can be relevant.
Implements gum::ITestPolicy< GUM_ELEMENT >.
Definition at line 157 of file GTestPolicy_tpl.h.
References _conTab_, and gum::ITestPolicy< GUM_ELEMENT >::nbObservation().
|
inherited |
Comptabilizes the new observation.
Definition at line 76 of file ITestPolicy_tpl.h.
References _nbObs_.
Referenced by add(), gum::Chi2TestPolicy< GUM_ELEMENT >::computeScore(), gum::GTestPolicy< GUM_ELEMENT >::computeScore(), gum::LeastSquareTestPolicy< GUM_ELEMENT >::computeScore(), gum::Chi2TestPolicy< GUM_ELEMENT >::isTestRelevant(), gum::GTestPolicy< GUM_ELEMENT >::isTestRelevant(), and gum::LeastSquareTestPolicy< GUM_ELEMENT >::isTestRelevant().
| void gum::GTestPolicy< GUM_ELEMENT >::operator delete | ( | void * | p | ) |
Constructor.
Definition at line 152 of file GTestPolicy_tpl.h.
References GTestPolicy(), gum::SmallObjectAllocator::deallocate(), and gum::SmallObjectAllocator::instance().
| void * gum::GTestPolicy< GUM_ELEMENT >::operator new | ( | size_t | s | ) |
Allocators and Deallocators redefinition.
Definition at line 147 of file GTestPolicy_tpl.h.
References GTestPolicy(), gum::SmallObjectAllocator::allocate(), and gum::SmallObjectAllocator::instance().
|
overridevirtual |
Returns the performance of current variable according to the test.
Implements gum::ITestPolicy< GUM_ELEMENT >.
Definition at line 111 of file GTestPolicy_tpl.h.
References _conTab_, _GStat_, computeScore(), gum::ITestPolicy< GUM_ELEMENT >::isModified_(), gum::ChiSquare::probaChi2(), and score().
Referenced by score().
|
overridevirtual |
Returns a second criterion to severe ties.
Implements gum::ITestPolicy< GUM_ELEMENT >.
Definition at line 124 of file GTestPolicy_tpl.h.
References _GStat_, computeScore(), and gum::ITestPolicy< GUM_ELEMENT >::isModified_().
| std::string gum::GTestPolicy< GUM_ELEMENT >::toString | ( | ) | const |
Definition at line 167 of file GTestPolicy_tpl.h.
References _conTab_, _GStat_, and gum::ITestPolicy< GUM_ELEMENT >::toString().
|
private |
The contingency table used to keeps records of all observation.
Definition at line 173 of file GTestPolicy.h.
Referenced by GTestPolicy(), add(), addObservation(), computeScore(), ct(), isTestRelevant(), score(), and toString().
|
mutableprivate |
Definition at line 174 of file GTestPolicy.h.
Referenced by GTestPolicy(), computeScore(), score(), secondaryscore(), and toString().
|
mutableprivateinherited |
Booleans indicating if we have to re eval test.
Definition at line 175 of file ITestPolicy.h.
Referenced by ITestPolicy(), add(), addObservation(), computeScore(), and isModified_().
|
privateinherited |
Definition at line 178 of file ITestPolicy.h.
Referenced by ITestPolicy(), add(), addObservation(), nbObservation(), and toString().