![]() |
aGrUM 2.3.2
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. | |
| virtual | ~GTestPolicy () |
| Destructor. | |
| void * | operator new (size_t s) |
| Allocators and Deallocators redefinition. | |
| void | operator delete (void *p) |
| Constructor. | |
Observation insertion | |
| void | addObservation (Idx iattr, GUM_SCALAR ivalue) |
| Comptabilizes the new observation. | |
Test methods | |
| bool | isTestRelevant () const |
| Returns true if enough observation were made so that the test can be relevant. | |
| void | computeScore () const |
| Computes the GStat of current variable according to the test. | |
| double | score () const |
| Returns the performance of current variable according to the test. | |
| double | secondaryscore () const |
| Returns a second criterion to severe ties. | |
Fusion Methods | |
| void | add (const GTestPolicy< GUM_SCALAR > &src) |
| Performs the merging of current GTestPolicy instance with given instance. | |
| const ContingencyTable< Idx, GUM_SCALAR > & | 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_SCALAR > &src) |
Protected Member Functions | |
| bool | isModified_ () const |
Private Attributes | |
| ContingencyTable< Idx, GUM_SCALAR > | _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.
|
inline |
Constructor.
Definition at line 84 of file GTestPolicy.h.
References GTestPolicy(), gum::ITestPolicy< GUM_SCALAR >::ITestPolicy(), _conTab_, and _GStat_.
Referenced by GTestPolicy(), ~GTestPolicy(), add(), and operator delete().
|
inlinevirtual |
Destructor.
Definition at line 91 of file GTestPolicy.h.
References GTestPolicy().
| void gum::GTestPolicy< GUM_SCALAR >::add | ( | const GTestPolicy< GUM_SCALAR > & | src | ) |
Performs the merging of current GTestPolicy instance with given instance.
Definition at line 129 of file GTestPolicy_tpl.h.
References GTestPolicy(), _conTab_, gum::ITestPolicy< GUM_SCALAR >::add(), and ct().
|
inlineinherited |
Definition at line 161 of file ITestPolicy.h.
References ITestPolicy(), _isModified_, _nbObs_, and nbObservation().
Referenced by gum::Chi2TestPolicy< GUM_SCALAR >::add(), gum::GTestPolicy< GUM_SCALAR >::add(), and gum::LeastSquareTestPolicy< GUM_SCALAR >::add().
|
virtual |
Comptabilizes the new observation.
Reimplemented from gum::ITestPolicy< GUM_SCALAR >.
Definition at line 68 of file GTestPolicy_tpl.h.
References _conTab_, and gum::ITestPolicy< GUM_SCALAR >::addObservation().
|
virtual |
Computes the GStat of current variable according to the test.
Reimplemented from gum::ITestPolicy< GUM_SCALAR >.
Definition at line 81 of file GTestPolicy_tpl.h.
References _conTab_, _GStat_, gum::ITestPolicy< GUM_SCALAR >::computeScore(), and gum::ITestPolicy< GUM_SCALAR >::nbObservation().
Referenced by score(), and secondaryscore().
|
inline |
Returns contingency table (needed for the merging of GTestPolicy instances).
Definition at line 166 of file GTestPolicy.h.
References _conTab_.
Referenced by add().
|
inlineprotectedinherited |
Definition at line 186 of file ITestPolicy.h.
References _isModified_.
Referenced by gum::Chi2TestPolicy< GUM_SCALAR >::score(), gum::GTestPolicy< GUM_SCALAR >::score(), gum::LeastSquareTestPolicy< GUM_SCALAR >::score(), gum::Chi2TestPolicy< GUM_SCALAR >::secondaryscore(), gum::GTestPolicy< GUM_SCALAR >::secondaryscore(), and gum::LeastSquareTestPolicy< GUM_SCALAR >::secondaryscore().
|
inlinevirtual |
Returns true if enough observation were made so that the test can be relevant.
Implements gum::ITestPolicy< GUM_SCALAR >.
Definition at line 129 of file GTestPolicy.h.
References _conTab_, and gum::ITestPolicy< GUM_SCALAR >::nbObservation().
|
inlineinherited |
Comptabilizes the new observation.
Definition at line 119 of file ITestPolicy.h.
References _nbObs_.
Referenced by add(), gum::Chi2TestPolicy< GUM_SCALAR >::computeScore(), gum::GTestPolicy< GUM_SCALAR >::computeScore(), gum::LeastSquareTestPolicy< GUM_SCALAR >::computeScore(), gum::Chi2TestPolicy< GUM_SCALAR >::isTestRelevant(), gum::GTestPolicy< GUM_SCALAR >::isTestRelevant(), and gum::LeastSquareTestPolicy< GUM_SCALAR >::isTestRelevant().
|
inline |
Constructor.
Definition at line 101 of file GTestPolicy.h.
References GTestPolicy(), gum::SmallObjectAllocator::deallocate(), and gum::SmallObjectAllocator::instance().
|
inline |
Allocators and Deallocators redefinition.
Definition at line 99 of file GTestPolicy.h.
References gum::SmallObjectAllocator::allocate(), and gum::SmallObjectAllocator::instance().
|
virtual |
Returns the performance of current variable according to the test.
Implements gum::ITestPolicy< GUM_SCALAR >.
Definition at line 110 of file GTestPolicy_tpl.h.
References _conTab_, _GStat_, computeScore(), gum::ITestPolicy< GUM_SCALAR >::isModified_(), gum::ChiSquare::probaChi2(), and score().
Referenced by score().
|
virtual |
Returns a second criterion to severe ties.
Implements gum::ITestPolicy< GUM_SCALAR >.
Definition at line 123 of file GTestPolicy_tpl.h.
References _GStat_, computeScore(), and gum::ITestPolicy< GUM_SCALAR >::isModified_().
Referenced by toString().
|
inline |
Definition at line 176 of file GTestPolicy.h.
References _conTab_, _GStat_, and secondaryscore().
|
private |
The contingency table used to keeps records of all observation.
Definition at line 189 of file GTestPolicy.h.
Referenced by GTestPolicy(), add(), addObservation(), computeScore(), ct(), isTestRelevant(), score(), and toString().
|
mutableprivate |
Definition at line 190 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 190 of file ITestPolicy.h.
Referenced by ITestPolicy(), add(), addObservation(), computeScore(), and isModified_().
|
privateinherited |
Definition at line 193 of file ITestPolicy.h.
Referenced by ITestPolicy(), add(), addObservation(), nbObservation(), and toString().