diff options
Diffstat (limited to 'searchlib/src/vespa/searchlib/tensor/hnsw_index_config.h')
-rw-r--r-- | searchlib/src/vespa/searchlib/tensor/hnsw_index_config.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/searchlib/src/vespa/searchlib/tensor/hnsw_index_config.h b/searchlib/src/vespa/searchlib/tensor/hnsw_index_config.h new file mode 100644 index 00000000000..c4022160f50 --- /dev/null +++ b/searchlib/src/vespa/searchlib/tensor/hnsw_index_config.h @@ -0,0 +1,39 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#pragma once + +#include <cstdint> + +namespace search::tensor { + +/* + * Class containing config for HnswIndex. + */ +class HnswIndexConfig { +private: + uint32_t _max_links_at_level_0; + uint32_t _max_links_on_inserts; + uint32_t _neighbors_to_explore_at_construction; + uint32_t _min_size_before_two_phase; + bool _heuristic_select_neighbors; + +public: + HnswIndexConfig(uint32_t max_links_at_level_0_in, + uint32_t max_links_on_inserts_in, + uint32_t neighbors_to_explore_at_construction_in, + uint32_t min_size_before_two_phase_in, + bool heuristic_select_neighbors_in) + : _max_links_at_level_0(max_links_at_level_0_in), + _max_links_on_inserts(max_links_on_inserts_in), + _neighbors_to_explore_at_construction(neighbors_to_explore_at_construction_in), + _min_size_before_two_phase(min_size_before_two_phase_in), + _heuristic_select_neighbors(heuristic_select_neighbors_in) + {} + uint32_t max_links_at_level_0() const { return _max_links_at_level_0; } + uint32_t max_links_on_inserts() const { return _max_links_on_inserts; } + uint32_t neighbors_to_explore_at_construction() const { return _neighbors_to_explore_at_construction; } + uint32_t min_size_before_two_phase() const { return _min_size_before_two_phase; } + bool heuristic_select_neighbors() const { return _heuristic_select_neighbors; } +}; + +} |