bbq Implementation Documentation
Main Page | Namespace List | Class List | File List | Namespace Members | Class Members | File Members

bbq::uint_bitset Class Reference

This class provides one possible way of handling sets, which is a major part of the algorithms underlying bbq. More...

#include <bitsets.h>

List of all members.

Public Member Functions

 uint_bitset ()
bool subseteq (const uint_bitset &)
 Test whether this is a subset of another set.

bool operator< (const uint_bitset &)
 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 uint_bitset &)
 Two sets are considered equivalent iff they contain the same elements, not regarding their weights.

bool subseteq (const uint_bitset &, const unsigned int &J)
int cardinality ()
 returns the number of elements contained in the multiset

void intersect (const uint_bitset &b)
 standard set intersection

void set (const int &j)
 add one element j to the multiset.

void remove (const int &j)
 remove ALL elements j from the multiset.


Static Public Attributes

int k = 32

Friends

std::ostream & operator<< (std::ostream &o, const uint_bitset &)


Detailed Description

This class provides one possible way of handling sets, which is a major part of the algorithms underlying bbq.

This class particularly supports unweighted sets whose cardinality is limited to 32 elements; it supports neither weighing nor multiset capabilities, but is very memory efficient. In its current state, it is only suitable for the ancient footprint_detector rather than the featuristic weighted_footprint_detector.


Constructor & Destructor Documentation

bbq::uint_bitset::uint_bitset  )  [inline]
 


Member Function Documentation

int bbq::uint_bitset::cardinality  ) 
 

returns the number of elements contained in the multiset

void bbq::uint_bitset::intersect const uint_bitset b  ) 
 

standard set intersection

bool bbq::uint_bitset::operator< const uint_bitset  ) 
 

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 enumerate_differences() method. Note that weightings are not taken into account; two sets containing the same elements but different weights are considered equivalent (which is the reason why they are stored in a multiset rather than a set).

bool bbq::uint_bitset::operator== const uint_bitset  ) 
 

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 enumerate_differences() method. Note that weightings are not taken into account; two sets containing the same elements but different weights are considered equivalent (which is the reason why they are stored in a multiset rather than a set).

void bbq::uint_bitset::remove const int &  j  ) 
 

remove ALL elements j from the multiset.

Can actually be ignored for multisets, since the remove job is taken by decrease.

void bbq::uint_bitset::set const int &  j  ) 
 

add one element j to the multiset.

The weight is (currently) neglected.

bool bbq::uint_bitset::subseteq const uint_bitset ,
const unsigned int &  J
 

bool bbq::uint_bitset::subseteq const uint_bitset  ) 
 

Test whether this is a subset of another set.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  o,
const uint_bitset I
[friend]
 


Member Data Documentation

int bbq::uint_bitset::k = 32 [static]
 


The documentation for this class was generated from the following files:
bbq Implementation Documentation
Axel Mosig, Bioinformatics, University of Leipzig