51#ifndef GUM_CONTINGENCY_TABLE_H
52#define GUM_CONTINGENCY_TABLE_H
70 template <
typename GUM_SCALAR_A,
typename GUM_SCALAR_B >
93 void operator delete(
void* p) {
107 void add(GUM_SCALAR_A valueA, GUM_SCALAR_B valueB);
111 Idx joint(GUM_SCALAR_A valueA, GUM_SCALAR_B valueB)
const {
112 return _jointTable_.exists(std::pair< GUM_SCALAR_A, GUM_SCALAR_B >(valueA, valueB))
113 ?
_jointTable_[std::pair< GUM_SCALAR_A, GUM_SCALAR_B >(valueA, valueB)]
167 std::stringstream ss;
<agrum/FMDP/learning/core/contingencyTable.h>
Idx attrAMarginal(GUM_SCALAR_A valueA) const
Returns the number of samples for case (iattr, ivalue).
Idx attrBSize() const
Returns the number of samples for column ivalue.
HashTable< GUM_SCALAR_B, Idx > _attrBMarginalTable_
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 attrASize() const
Returns the number of samples for line iattr.
void add(GUM_SCALAR_A valueA, GUM_SCALAR_B valueB)
Increments the number of sample for case( iattr, ivalue ).
HashTableConstIteratorSafe< GUM_SCALAR_B, Idx > attrBEndSafe() const
Increments the number of sample for case( iattr, ivalue ).
HashTableConstIteratorSafe< GUM_SCALAR_A, Idx > attrABeginSafe() const
Returns the number of samples for line iattr.
HashTableConstIteratorSafe< GUM_SCALAR_A, Idx > attrAEndSafe() const
Increments the number of sample for case( iattr, ivalue ).
std::string toString() const
Idx joint(GUM_SCALAR_A valueA, GUM_SCALAR_B valueB) const
Returns the number of samples for case (iattr, ivalue).
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)
Idx attrBMarginal(GUM_SCALAR_B valueB) const
Returns the number of samples for case (iattr, ivalue).
~ContingencyTable()
Default destructor.
ContingencyTable()
Default constructor.
HashTable< GUM_SCALAR_A, Idx > _attrAMarginalTable_
The class for generic Hash Tables.
static SmallObjectAllocator & instance()
void * allocate(const size_t &objectSize)
Allocates a block.
void deallocate(void *pDeallocatedObject, const size_t &objectSize)
Deallocates an object.
Template implementations for the ContingencyTable class.
Size Idx
Type for indexes.
gum is the global namespace for all aGrUM entities
Headers of the Observation class.