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

bbq::weighted_bit_multi_set Class Reference

This class provides the most advanced (but also most inefficient) way of handling sets, which is a major part of the algorithms underlying bbq. More...

#include <weighted_bit_multi_set.h>

List of all members.

Public Types

typedef unsigned char c_uint

Public Member Functions

 weighted_bit_multi_set (const weighted_bit_multi_set &)
 copy constructor

weighted_bit_multi_setoperator= (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_uintcounts
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 &)


Detailed Description

This class provides the most advanced (but also most inefficient) way of handling sets, which is a major part of the algorithms underlying 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.


Member Typedef Documentation

typedef unsigned char bbq::weighted_bit_multi_set::c_uint
 


Constructor & Destructor Documentation

bbq::weighted_bit_multi_set::weighted_bit_multi_set const weighted_bit_multi_set  ) 
 

copy constructor

bbq::weighted_bit_multi_set::weighted_bit_multi_set  ) 
 

default constructor

bbq::weighted_bit_multi_set::~weighted_bit_multi_set  )  [inline]
 

destrcutor


Member Function Documentation

int bbq::weighted_bit_multi_set::cardinality  ) 
 

returns the number of elements contained in the multiset

bool bbq::weighted_bit_multi_set::contains const int &   ) 
 

is there at least one element with the index passed by the parameter?

void bbq::weighted_bit_multi_set::decrease const int &  j,
const float &  w
 

remove ONE element j from the multiset.

void bbq::weighted_bit_multi_set::intersect const weighted_bit_multi_set b  ) 
 

standard multiset intersection

bool bbq::weighted_bit_multi_set::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.

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).

weighted_bit_multi_set & bbq::weighted_bit_multi_set::operator= const weighted_bit_multi_set vb  ) 
 

assignment operator

bool bbq::weighted_bit_multi_set::operator== const weighted_bit_multi_set  )  const
 

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::weighted_bit_multi_set::remove const int &  j,
const float &  w
 

remove ALL elements j from the multiset.

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

void bbq::weighted_bit_multi_set::reset const int &  j,
const float &  w
 

change the weight of element j; only needed for sets, not for multisets.

void bbq::weighted_bit_multi_set::set const int &  j,
const float &  w
 

add one element j to the multiset.

The weight is (currently) neglected.

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

bool bbq::weighted_bit_multi_set::subseteq const weighted_bit_multi_set  )  const
 

float bbq::weighted_bit_multi_set::weight  ) 
 

in the simple form implemented here, the weight is equal to the number of elements contained in the multiset.


Friends And Related Function Documentation

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


Member Data Documentation

c_uint* bbq::weighted_bit_multi_set::counts
 

int bbq::weighted_bit_multi_set::k = 128 [static]
 

k corresponds to the number of bits and hence the number of sequence fragments in footprint_detector

int bbq::weighted_bit_multi_set::k_ = 4 [static]
 

bool bbq::weighted_bit_multi_set::weighted = true [static]
 

left for compatibility reasons with other set types

float* bbq::weighted_bit_multi_set::weights
 


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