28 #ifndef GUM_CONTINGENCY_TABLE_H 29 #define GUM_CONTINGENCY_TABLE_H 53 template <
typename GUM_SCALAR_A,
typename GUM_SCALAR_B >
74 void*
operator new(
size_t s) {
77 void operator delete(
void* p) {
91 void add(GUM_SCALAR_A valueA, GUM_SCALAR_B valueB);
96 Idx joint(GUM_SCALAR_A valueA, GUM_SCALAR_B valueB)
const {
98 std::pair< GUM_SCALAR_A, GUM_SCALAR_B >(valueA, valueB))
99 ?
__jointTable[std::pair< GUM_SCALAR_A, GUM_SCALAR_B >(valueA,
160 std::stringstream ss;
185 #endif // GUM_CONTINGENCY_TABLE_H
Headers of gum::SmallObjectAllocator.
HashTableConstIteratorSafe< GUM_SCALAR_B, Idx > attrBEndSafe() const
Increments the number of sample for case( iattr, ivalue )
Base class for discrete random variable.
Idx attrBSize() const
Returns the number of samples for column ivalue.
<agrum/FMDP/learning/core/contingencyTable.h>
Template implementations for the ContingencyTable class.
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)
gum is the global namespace for all aGrUM entities
~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.
Headers of the Observation class.
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)
Class hash tables iterators.