-
Notifications
You must be signed in to change notification settings - Fork 2
/
MarkerSet.h
59 lines (44 loc) · 1.41 KB
/
MarkerSet.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// MarkerSet.h: a marker set of the size to be used for hashing
#ifndef MARKERSET_H
#define MARKERSET_H
#include "BasicDefinitions.h"
#include "SNPs.h"
#include <boost/dynamic_bitset.hpp>
#include <list>
using namespace std;
class MarkerSet
{
public:
// MarkerSet(): default constructor
// Precondition: None.
// Postcondition: all markers have been initialized to 0.
MarkerSet();
MarkerSet(const MarkerSet&);
void clear();
void set( int , bool );
void print(ostream&);
void print(ostream&, unsigned int, unsigned int);
boost::dynamic_bitset<>& getMarkerBits();
// getMarker(): gets marker
// Precondition: None.
// Postcondition: If 0<=index<MARKER_SET_SIZE, then ith marker
// has been returned; otherwise a warning has been printed and
// 0 has been returned.
bool getMarker(int index) const;
// equal(): compares another MarkerSet to see if it has the
// same markers as this object.
// Precondition: None.
// Postcondition: If m2 has the same markers as this object,
// then returns true; otherwise returns false.
bool equal(MarkerSet * ms);
int diff(MarkerSet * ) const;
private:
// markers stored as a bitset to allow for fast comparisons
boost::dynamic_bitset<> markers;
};
// operator<<:overloaded insertion operator
// Precondition: fout is a valid stream.
// Postcondition: ms has been sent to fout.
ostream& operator<<(ostream& fout, const MarkerSet& m1);
#endif
// end MarkerSet.h