From ba65c8976f54d4da2467074235a12f5be0bd5ebc Mon Sep 17 00:00:00 2001 From: "Douglas B. Rumbaugh" Date: Sun, 22 Dec 2024 15:12:13 -0500 Subject: Continued development --- include/shard/Alias.h | 8 ++++---- include/shard/FSTrie.h | 6 +++--- include/shard/ISAMTree.h | 4 ++-- include/shard/LoudsPatricia.h | 6 +++--- include/shard/PGM.h | 8 ++++---- include/shard/TrieSpline.h | 8 ++++---- include/shard/VPTree.h | 6 +++--- 7 files changed, 23 insertions(+), 23 deletions(-) (limited to 'include/shard') diff --git a/include/shard/Alias.h b/include/shard/Alias.h index 8fe70a5..15b0884 100644 --- a/include/shard/Alias.h +++ b/include/shard/Alias.h @@ -70,7 +70,7 @@ public: } } - Alias(std::vector const &shards) + Alias(std::vector const &shards) : m_data(nullptr) , m_alias(nullptr) , m_total_weight(0) @@ -146,15 +146,15 @@ public: } - size_t get_memory_usage() { + size_t get_memory_usage() const { return 0; } - size_t get_aux_memory_usage() { + size_t get_aux_memory_usage() const { return (m_bf) ? m_bf->memory_usage() : 0; } - W get_total_weight() { + W get_total_weight() const { return m_total_weight; } diff --git a/include/shard/FSTrie.h b/include/shard/FSTrie.h index 4e51037..d720aad 100644 --- a/include/shard/FSTrie.h +++ b/include/shard/FSTrie.h @@ -82,7 +82,7 @@ public: delete[] temp_buffer; } - FSTrie(std::vector const &shards) + FSTrie(std::vector const &shards) : m_data(nullptr) , m_reccnt(0) , m_alloc_size(0) @@ -181,11 +181,11 @@ public: } - size_t get_memory_usage() { + size_t get_memory_usage() const { return m_fst->getMemoryUsage(); } - size_t get_aux_memory_usage() { + size_t get_aux_memory_usage() const { return m_alloc_size; } diff --git a/include/shard/ISAMTree.h b/include/shard/ISAMTree.h index 64c0b2b..f6b525f 100644 --- a/include/shard/ISAMTree.h +++ b/include/shard/ISAMTree.h @@ -65,7 +65,7 @@ public: } } - ISAMTree(std::vector const &shards) + ISAMTree(std::vector const &shards) : m_bf(nullptr), m_isam_nodes(nullptr), m_root(nullptr), m_reccnt(0), m_tombstone_cnt(0), m_internal_node_cnt(0), m_deleted_cnt(0), m_alloc_size(0) { @@ -93,7 +93,7 @@ public: delete m_bf; } - Wrapped *point_lookup(const R &rec, bool filter = false) { + Wrapped *point_lookup(const R &rec, bool filter = false) const { if (filter && !m_bf->lookup(rec)) { return nullptr; } diff --git a/include/shard/LoudsPatricia.h b/include/shard/LoudsPatricia.h index 3452839..fe0c30e 100644 --- a/include/shard/LoudsPatricia.h +++ b/include/shard/LoudsPatricia.h @@ -82,7 +82,7 @@ public: delete[] temp_buffer; } - LoudsPatricia(std::vector &shards) + LoudsPatricia(std::vector &shards) : m_data(nullptr) , m_reccnt(0) , m_alloc_size(0) @@ -178,11 +178,11 @@ public: } - size_t get_memory_usage() { + size_t get_memory_usage() const { return m_louds->size(); } - size_t get_aux_memory_usage() { + size_t get_aux_memory_usage() const { return m_alloc_size; } diff --git a/include/shard/PGM.h b/include/shard/PGM.h index 7d1f492..5b39ab4 100644 --- a/include/shard/PGM.h +++ b/include/shard/PGM.h @@ -111,7 +111,7 @@ public: } } - PGM(std::vector const &shards) + PGM(std::vector const &shards) : m_data(nullptr) , m_bf(nullptr) , m_reccnt(0) @@ -190,7 +190,7 @@ public: delete m_bf; } - Wrapped *point_lookup(const R &rec, bool filter=false) { + Wrapped *point_lookup(const R &rec, bool filter=false) const { size_t idx = get_lower_bound(rec.key); if (idx >= m_reccnt) { return nullptr; @@ -223,11 +223,11 @@ public: } - size_t get_memory_usage() { + size_t get_memory_usage() const { return m_pgm.size_in_bytes(); } - size_t get_aux_memory_usage() { + size_t get_aux_memory_usage() const { return (m_bf) ? m_bf->memory_usage() : 0; } diff --git a/include/shard/TrieSpline.h b/include/shard/TrieSpline.h index 9d8c3bb..7f4d4e5 100644 --- a/include/shard/TrieSpline.h +++ b/include/shard/TrieSpline.h @@ -124,7 +124,7 @@ public: } } - TrieSpline(std::vector const &shards) + TrieSpline(std::vector const &shards) : m_reccnt(0) , m_tombstone_cnt(0) , m_alloc_size(0) @@ -229,7 +229,7 @@ public: delete m_bf; } - Wrapped *point_lookup(const R &rec, bool filter=false) { + Wrapped *point_lookup(const R &rec, bool filter=false) const { if (filter && m_bf && !m_bf->lookup(rec)) { return nullptr; } @@ -266,11 +266,11 @@ public: } - size_t get_memory_usage() { + size_t get_memory_usage() const { return m_ts.GetSize(); } - size_t get_aux_memory_usage() { + size_t get_aux_memory_usage() const { return (m_bf) ? m_bf->memory_usage() : 0; } diff --git a/include/shard/VPTree.h b/include/shard/VPTree.h index 477db5c..7130efe 100644 --- a/include/shard/VPTree.h +++ b/include/shard/VPTree.h @@ -86,7 +86,7 @@ public: } } - VPTree(std::vector shards) + VPTree(std::vector shards) : m_reccnt(0), m_tombstone_cnt(0), m_node_cnt(0), m_root(nullptr) { size_t attemp_reccnt = 0; @@ -174,11 +174,11 @@ public: return m_data + idx; } - size_t get_memory_usage() { + size_t get_memory_usage() const { return m_node_cnt * sizeof(vpnode) + m_reccnt * sizeof(R*); } - size_t get_aux_memory_usage() { + size_t get_aux_memory_usage() const { // FIXME: need to return the size of the unordered_map return 0; } -- cgit v1.2.3