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

bbq::weighted_variable_bitset Class Reference

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

#include <weighted_bitsets.h>

List of all members.

Public Member Functions

 weighted_variable_bitset (const weighted_variable_bitset &)
 copy constructor

weighted_variable_bitsetoperator= (const weighted_variable_bitset &vb)
 assignment operator

 weighted_variable_bitset ()
 default constructor

 ~weighted_variable_bitset ()
 destrcutor

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

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

float weight ()
 sum of all weights associated with the elements contained in the set

void intersect (const weighted_variable_bitset &b)
 standard set intersection with adding weights associated with the elements that are contained in the resulting intersection

void set (const int &j, const float &w)
 add one element j to the set with associated weight w.

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)
 only needed for compatibility with the multiset supporting classes

void remove (const int &j, const float &w)
 remove index j from the set.

bool contains (const int &)
 return true iff the element carrying the given index is present in the set.

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


Public Attributes

unsigned int * bits
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

int k_ = 4
 k corresponds to the number of words needed to store all bits, i.e., k_ = k/32+1 (or (k>>5)+1) on a 32-bit machine.

bool weighted = true
 turn weighting features on and off.


Friends

std::ostream & operator<< (std::ostream &o, const weighted_variable_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 weighted sets of arbitrary cardinality, but no multiset capabilities.


Constructor & Destructor Documentation

bbq::weighted_variable_bitset::weighted_variable_bitset const weighted_variable_bitset  ) 
 

copy constructor

bbq::weighted_variable_bitset::weighted_variable_bitset  ) 
 

default constructor

bbq::weighted_variable_bitset::~weighted_variable_bitset  ) 
 

destrcutor


Member Function Documentation

int bbq::weighted_variable_bitset::cardinality  ) 
 

returns the number of elements contained in the set

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

return true iff the element carrying the given index is present in the set.

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

only needed for compatibility with the multiset supporting classes

void bbq::weighted_variable_bitset::intersect const weighted_variable_bitset b  ) 
 

standard set intersection with adding weights associated with the elements that are contained in the resulting intersection

bool bbq::weighted_variable_bitset::operator< const weighted_variable_bitset  )  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_variable_bitset & bbq::weighted_variable_bitset::operator= const weighted_variable_bitset vb  ) 
 

assignment operator

bool bbq::weighted_variable_bitset::operator== const weighted_variable_bitset  )  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_variable_bitset::remove const int &  j,
const float &  w
 

remove index j from the set.

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

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

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

add one element j to the set with associated weight w.

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

bool bbq::weighted_variable_bitset::subseteq const weighted_variable_bitset b  )  const
 

Test whether this is a subset of another set.

float bbq::weighted_variable_bitset::weight  ) 
 

sum of all weights associated with the elements contained in the set


Friends And Related Function Documentation

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


Member Data Documentation

unsigned int* bbq::weighted_variable_bitset::bits
 

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

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

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

k corresponds to the number of words needed to store all bits, i.e., k_ = k/32+1 (or (k>>5)+1) on a 32-bit machine.

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

turn weighting features on and off.

Not to be changed during a run() of weighted_footprint_detector.

float* bbq::weighted_variable_bitset::weights
 


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