File: HashedTupleList.hpp

package info (click to toggle)
pbseqlib 5.3.1%2Bdfsg-2.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 7,136 kB
  • sloc: cpp: 77,246; python: 570; makefile: 312; sh: 111; ansic: 9
file content (59 lines) | stat: -rw-r--r-- 1,272 bytes parent folder | download | duplicates (4)
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
#ifndef _BLASR_HASHED_TUPLE_LIST_HPP_
#define _BLASR_HASHED_TUPLE_LIST_HPP_

#include <alignment/tuples/TupleList.hpp>
#include <alignment/tuples/TupleMetrics.hpp>
#include <pbdata/DNASequence.hpp>

template <typename T_Tuple>
class HashedTupleList
{
public:
    long mask;
    std::vector<TupleList<T_Tuple> > hashTable;
    int hashLength;
    int hashTableLength;
    typedef T_Tuple Tuple;

    //
    // Provide a default constructor with a small
    // tuple size for testing.
    //
    HashedTupleList();

    void Initialize(int _hashLength);

    HashedTupleList(int _hashLength);

    void clear();

    void Clear();

    void Sort();

    void Append(T_Tuple tuple);

    void Insert(T_Tuple tuple);

    int Find(T_Tuple tuple);

    void Print();

    //
    // Provide a version of find that stores easy access to
    // the original tuple.
    //
    int Find(T_Tuple tuple, int &hashValue, int &index);

    void FindAll(T_Tuple &tuple, typename std::vector<T_Tuple>::const_iterator &firstPos,
                 typename std::vector<T_Tuple>::const_iterator &endPos);

    int GetHashLength();
};

template <typename T_Tuple>
void SequenceToHash(DNASequence &seq, HashedTupleList<T_Tuple> &hash, TupleMetrics &tm);

#include "HashedTupleList.hpp"

#endif