comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/mash/HashList.h @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
comparison
equal deleted inserted replaced
67:0e9998148a16 69:33d812a61356
1 // Copyright © 2015, Battelle National Biodefense Institute (BNBI);
2 // all rights reserved. Authored by: Brian Ondov, Todd Treangen,
3 // Sergey Koren, and Adam Phillippy
4 //
5 // See the LICENSE.txt file included with this software for license information.
6
7 #ifndef HashList_h
8 #define HashList_h
9
10 #include "hash.h"
11 #include <vector>
12
13 class HashList
14 {
15 public:
16
17 HashList() {use64 = true;}
18 HashList(bool use64new) {use64 = use64new;}
19
20 hash_u at(int index) const;
21 void clear();
22 void resize(int size);
23 void set32(int index, uint32_t value);
24 void set64(int index, uint64_t value);
25 void setUse64(bool use64New) {use64 = use64New;}
26 int size() const {return use64 ? hashes64.size() : hashes32.size();}
27 void sort();
28 void push_back32(hash32_t hash) {hashes32.push_back(hash);}
29 void push_back64(hash64_t hash) {hashes64.push_back(hash);}
30 bool get64() const {return use64;}
31
32 private:
33
34 bool use64;
35 std::vector<hash32_t> hashes32;
36 std::vector<hash64_t> hashes64;
37 };
38
39 #endif