31 #ifndef GUM_CONTINGENCY_TABLE_H 32 #define GUM_CONTINGENCY_TABLE_H 56 template <
typename GUM_SCALAR_A,
typename GUM_SCALAR_B >
77 void*
operator new(
size_t s) {
80 void operator delete(
void* p) {
94 void add(GUM_SCALAR_A valueA, GUM_SCALAR_B valueB);
99 Idx joint(GUM_SCALAR_A valueA, GUM_SCALAR_B valueB)
const {
101 std::pair< GUM_SCALAR_A, GUM_SCALAR_B >(valueA, valueB))
102 ?
__jointTable[std::pair< GUM_SCALAR_A, GUM_SCALAR_B >(valueA,
163 std::stringstream ss;
188 #endif // GUM_CONTINGENCY_TABLE_H Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
HashTableConstIteratorSafe< GUM_SCALAR_B, Idx > attrBEndSafe() const
Increments the number of sample for case( iattr, ivalue )
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Idx attrBSize() const
Returns the number of samples for column ivalue.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
<agrum/FMDP/learning/core/contingencyTable.h>
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Size size() const noexcept
Returns the number of elements stored into the hashtable.
Idx attrAMarginal(GUM_SCALAR_A valueA) const
Returns the number of samples for case (iattr, ivalue)
const_iterator_safe cbeginSafe() const
Returns the safe const_iterator pointing to the beginning of the hashtable.
HashTable< GUM_SCALAR_B, Idx > __attrBMarginalTable
void add(GUM_SCALAR_A valueA, GUM_SCALAR_B valueB)
Increments the number of sample for case( iattr, ivalue )
std::string toString() const
bool exists(const Key &key) const
Checks whether there exists an element with a given key in the hashtable.
HashTable< std::pair< GUM_SCALAR_A, GUM_SCALAR_B >, Idx > __jointTable
The contingency table used to compute the GStat Left Idx is for the attribute Right Idx for the value...
Idx joint(GUM_SCALAR_A valueA, GUM_SCALAR_B valueB) const
Returns the number of samples for case (iattr, ivalue)
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
~ContingencyTable()
Default destructor.
HashTableConstIteratorSafe< GUM_SCALAR_A, Idx > attrAEndSafe() const
Increments the number of sample for case( iattr, ivalue )
The class for generic Hash Tables.
HashTableConstIteratorSafe< GUM_SCALAR_A, Idx > attrABeginSafe() const
Returns the number of samples for line iattr.
const const_iterator_safe & cendSafe() const noexcept
Returns the safe const_iterator pointing to the end of the hashtable.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void deallocate(void *pDeallocatedObject, const size_t &objectSize)
Deallocates an object.
HashTable< GUM_SCALAR_A, Idx > __attrAMarginalTable
HashTableConstIteratorSafe< GUM_SCALAR_B, Idx > attrBBeginSafe() const
Returns the number of samples for column ivalue.
ContingencyTable< GUM_SCALAR_A, GUM_SCALAR_B > & operator+=(const ContingencyTable< GUM_SCALAR_A, GUM_SCALAR_B > &src)
Size Idx
Type for indexes.
void * allocate(const size_t &objectSize)
Allocates a block.
ContingencyTable()
Default constructor.
Idx attrASize() const
Returns the number of samples for line iattr.
static SmallObjectAllocator & instance()
Idx attrBMarginal(GUM_SCALAR_B valueB) const
Returns the number of samples for case (iattr, ivalue)
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.