bbq.
More...
#include <weighted_bit_multi_set.h>
Public Types | |
| typedef unsigned char | c_uint |
Public Member Functions | |
| weighted_bit_multi_set (const weighted_bit_multi_set &) | |
| copy constructor | |
| weighted_bit_multi_set & | operator= (const weighted_bit_multi_set &vb) |
| assignment operator | |
| weighted_bit_multi_set () | |
| default constructor | |
| ~weighted_bit_multi_set () | |
| destrcutor | |
| bool | subseteq (const weighted_bit_multi_set &) const |
| bool | subseteq (const weighted_bit_multi_set &, const unsigned int &J) const |
| bool | operator< (const weighted_bit_multi_set &) const |
| We obtain a canonical order on subsets of [1:k] by considering such a set as a number between 0 and 2^k-1. | |
| bool | operator== (const weighted_bit_multi_set &) const |
| Two sets are considered equivalent iff they contain the same elements, not regarding their weights. | |
| int | cardinality () |
| returns the number of elements contained in the multiset | |
| float | weight () |
| in the simple form implemented here, the weight is equal to the number of elements contained in the multiset. | |
| void | intersect (const weighted_bit_multi_set &b) |
| standard multiset intersection | |
| void | set (const int &j, const float &w) |
| add one element j to the multiset. | |
| void | reset (const int &j, const float &w) |
| change the weight of element j; only needed for sets, not for multisets. | |
| void | decrease (const int &j, const float &w) |
| remove ONE element j from the multiset. | |
| void | remove (const int &j, const float &w) |
| remove ALL elements j from the multiset. | |
| bool | contains (const int &) |
| is there at least one element with the index passed by the parameter? | |
Public Attributes | |
| c_uint * | counts |
| float * | weights |
Static Public Attributes | |
| int | k = 128 |
| k corresponds to the number of bits and hence the number of sequence fragments in footprint_detector | |
| bool | weighted = true |
| left for compatibility reasons with other set types | |
| int | k_ = 4 |
Friends | |
| std::ostream & | operator<< (std::ostream &o, const weighted_bit_multi_set &) |
bbq.
This class particularly supports weighted sets whose cardinality is unlimited. It supports weighing as well as multiset capabilities, but is far less memory efficient than the unweighted and simple-set versions.
|
|
|
|
|
copy constructor
|
|
|
default constructor
|
|
|
destrcutor
|
|
|
returns the number of elements contained in the multiset
|
|
|
is there at least one element with the index passed by the parameter?
|
|
||||||||||||
|
remove ONE element j from the multiset.
|
|
|
standard multiset intersection
|
|
|
We obtain a canonical order on subsets of [1:k] by considering such a set as a number between 0 and 2^k-1.
This order is needed for inserting weighted sets into (multi-)sets for the |
|
|
assignment operator
|
|
|
Two sets are considered equivalent iff they contain the same elements, not regarding their weights.
this is needed for inserting weighted sets into (multi-)sets for the |
|
||||||||||||
|
remove ALL elements j from the multiset. Can actually be ignored for multisets, since the remove job is taken by decrease. |
|
||||||||||||
|
change the weight of element j; only needed for sets, not for multisets.
|
|
||||||||||||
|
add one element j to the multiset. The weight is (currently) neglected. |
|
||||||||||||
|
|
|
|
|
|
|
in the simple form implemented here, the weight is equal to the number of elements contained in the multiset.
|
|
||||||||||||
|
|
|
|
|
|
|
k corresponds to the number of bits and hence the number of sequence fragments in footprint_detector
|
|
|
|
|
|
left for compatibility reasons with other set types
|
|
|
|