43 template <
typename GUM_SCALAR_A,
typename GUM_SCALAR_B >
52 template <
typename GUM_SCALAR_A,
typename GUM_SCALAR_B >
65 template <
typename GUM_SCALAR_A,
typename GUM_SCALAR_B >
67 GUM_SCALAR_B valueB) {
69 if (__attrAMarginalTable.exists(valueA))
70 __attrAMarginalTable[valueA]++;
72 __attrAMarginalTable.insert(valueA, 1);
74 if (__attrBMarginalTable.exists(valueB))
75 __attrBMarginalTable[valueB]++;
77 __attrBMarginalTable.insert(valueB, 1);
79 std::pair< GUM_SCALAR_A, GUM_SCALAR_B > cell(valueA, valueB);
80 if (__jointTable.exists(cell))
83 __jointTable.insert(cell, 1);
86 template <
typename GUM_SCALAR_A,
typename GUM_SCALAR_B >
92 if (__attrAMarginalTable.exists(aTer.key()))
93 __attrAMarginalTable[aTer.key()] += aTer.val();
95 __attrAMarginalTable.insert(aTer.key(), aTer.val());
98 std::pair< GUM_SCALAR_A, GUM_SCALAR_B > cell(aTer.key(), bTer.key());
99 if (__jointTable.exists(cell))
100 __jointTable[cell] += src.
joint(aTer.key(), bTer.key());
102 __jointTable.insert(cell, src.
joint(aTer.key(), bTer.key()));
108 if (__attrBMarginalTable.exists(bTer.key()))
109 __attrBMarginalTable[bTer.key()] += bTer.val();
111 __attrBMarginalTable.insert(bTer.key(), bTer.val());
HashTableConstIteratorSafe< GUM_SCALAR_B, Idx > attrBEndSafe() const
Increments the number of sample for case( iattr, ivalue )
<agrum/FMDP/learning/core/contingencyTable.h>
void add(GUM_SCALAR_A valueA, GUM_SCALAR_B valueB)
Increments the number of sample for case( iattr, ivalue )
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 )
HashTableConstIteratorSafe< GUM_SCALAR_A, Idx > attrABeginSafe() const
Returns the number of samples for line iattr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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)
ContingencyTable()
Default constructor.