36 static constexpr const char* HASH_FN_NAME =
"aahash1";
46 const uint8_t hash_num;
51 bool initialized =
false;
52 std::unique_ptr<uint64_t[]> hashes_array;
74 , hashes_array(new uint64_t[hash_num])
80 , seq_len(aahash.seq_len)
81 , hash_num(aahash.hash_num)
85 , initialized(aahash.initialized)
86 , hashes_array(new uint64_t[hash_num])
88 std::memcpy(hashes_array.get(),
89 aahash.hashes_array.get(),
90 hash_num *
sizeof(uint64_t));
110 const uint64_t* hashes()
const {
return hashes_array.get(); }
111 size_t get_pos()
const {
return pos; }
112 unsigned get_hash_num()
const {
return hash_num; }
113 unsigned get_k()
const {
return k; }
114 uint64_t get_forward_hash()
const {
return hashes_array[0]; }
115 unsigned get_level()
const {
return level; }
116 const char* get_seq()
const {
return seq; }
123 const unsigned hash_num_per_seed;
124 std::unique_ptr<uint64_t[]> hashes_array;
125 std::vector<SpacedSeed> seeds;
143 const std::vector<SpacedSeed>& seeds,
144 unsigned hash_num_per_seed,
147 : aahash(seq, 1, k, 1, pos)
148 , hash_num_per_seed(hash_num_per_seed)
149 , hashes_array(new uint64_t[hash_num_per_seed * seeds.size()])
155 const std::vector<SpacedSeed>& seeds,
156 unsigned hash_num_per_seed,
159 : aahash(seq, 1, k, 1, pos)
160 , hash_num_per_seed(hash_num_per_seed)
161 , hashes_array(new uint64_t[hash_num_per_seed * seeds.size()])
167 const std::vector<std::string>& seeds,
168 unsigned hash_num_per_seed,
171 : aahash(seq, 1, k, 1, pos)
172 , hash_num_per_seed(hash_num_per_seed)
173 , hashes_array(new uint64_t[hash_num_per_seed * seeds.size()])
174 , seeds(aa_parse_seeds(seeds))
179 const std::vector<std::string>& seeds,
180 unsigned hash_num_per_seed,
183 : aahash(seq, 1, k, 1, pos)
184 , hash_num_per_seed(hash_num_per_seed)
185 , hashes_array(new uint64_t[hash_num_per_seed * seeds.size()])
186 , seeds(aa_parse_seeds(seeds))
192 : aahash(seed_aahash.aahash)
193 , hash_num_per_seed(seed_aahash.hash_num_per_seed)
194 , hashes_array(new uint64_t[hash_num_per_seed * seed_aahash.seeds.size()])
195 , seeds(seed_aahash.seeds)
197 std::memcpy(hashes_array.get(),
198 seed_aahash.hashes_array.get(),
199 hash_num_per_seed * seeds.size() *
sizeof(uint64_t));
218 const uint64_t* hashes()
const {
return hashes_array.get(); }
220 size_t get_pos()
const {
return aahash.get_pos(); }
221 unsigned get_hash_num()
const {
return aahash.get_hash_num(); }
222 unsigned get_hash_num_per_seed()
const {
return hash_num_per_seed; }
223 unsigned get_k()
const {
return aahash.get_k(); }