btllib: btllib::RollingHash Class Reference

btllib

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
btllib::RollingHash Class Reference

`#include <rolling_hash.hpp>`

Inheritance diagram for btllib::RollingHash:

## Public Member Functions
| RollingHash (const char *seq, size_t seq_len, unsigned k, unsigned hash_num)
| RollingHash (const std::string &seq, unsigned k, unsigned hash_num)
bool | roll ()
const uint64_t * | hashes () const
size_t | get_pos () const
unsigned | get_k () const
unsigned | get_hash_num () const

## Protected Member Functions
bool | init ()

## Protected Attributes
const char * | seq
const size_t | seq_len
const unsigned | k
const unsigned | hash_num
size_t | pos = 0
std::vector< uint64_t > | hashes_vector
uint64_t | forward_hash = 0
uint64_t | reverse_hash = 0

## Detailed Description

Iterate over hash values for k-mers in a given DNA sequence.

This implementation uses ntHash function to efficiently calculate hash values for successive k-mers.

## Constructor & Destructor Documentation

## ◆ RollingHash() [1/2]

btllib::RollingHash::RollingHash | ( | const char * | seq,
|  | size_t | seq_len,
|  | unsigned | k,
|  | unsigned | hash_num
| ) |  |
| inline

Constructor.

Parameters

  seq | DNA sequence to be hashed
  seq_len | length of seq
  k | k-mer size
  hash_num | number of hashes

## ◆ RollingHash() [2/2]

btllib::RollingHash::RollingHash | ( | const std::string & | seq,
|  | unsigned | k,
|  | unsigned | hash_num
| ) |  |
| inline

Constructor.

Parameters

  seq | DNA sequence to be hashed
  k | k-mer size
  hash_num | number of hashes

## Member Function Documentation

## ◆ init()

bool btllib::RollingHash::init | ( |  | ) |
| protected

Initialize internal state of iterator

The documentation for this class was generated from the following file:

- include/btllib/rolling_hash.hpp