Skip to content

Commit

Permalink
minor changes as per PR discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
rakri committed Jan 24, 2024
1 parent 615247a commit 0b9118f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions include/abstract_filter_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ template <typename label_type> class AbstractFilterStore
DISKANN_DLLEXPORT virtual void swap_labels(const location_t location_first, const location_t location_second) = 0;

DISKANN_DLLEXPORT virtual const tsl::robin_set<label_type> &get_all_label_set() = 0;
DISKANN_DLLEXPORT virtual void add_to_label_set(label_type &label) = 0;
DISKANN_DLLEXPORT virtual void add_to_label_set(const label_type &label) = 0;
// Throws: out of range exception
DISKANN_DLLEXPORT virtual void add_label_to_location(const location_t point_id, label_type label) = 0;
DISKANN_DLLEXPORT virtual void add_label_to_location(const location_t point_id, const label_type label) = 0;
// returns internal mapping for given raw_label
DISKANN_DLLEXPORT virtual label_type get_numeric_label(const std::string &raw_label) = 0;

Expand Down
4 changes: 2 additions & 2 deletions include/in_mem_filter_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ template <typename label_type> class InMemFilterStore : public AbstractFilterSto
void set_labels_to_location(const location_t location, const std::vector<std::string> &labels);
void swap_labels(const location_t location_first, const location_t location_second) override;
const tsl::robin_set<label_type> &get_all_label_set() override;
void add_to_label_set(label_type &label) override;
void add_to_label_set(const label_type &label) override;
// Throws: out of range exception
void add_label_to_location(const location_t point_id, label_type label) override;
void add_label_to_location(const location_t point_id, const label_type label) override;
// returns internal mapping for given raw_label
label_type get_numeric_label(const std::string &raw_label) override;

Expand Down
1 change: 0 additions & 1 deletion python/src/builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ std::string prepare_filtered_label_map(diskann::Index<T, TagT, LabelT> &index, c
convert_label_to_numeric(filter_labels_file, labels_file_to_use, mem_labels_int_map_file, universal_label);
if (!universal_label.empty())
{
uint32_t unv_label_as_num = 0;
index.set_universal_label(universal_label);
}
return labels_file_to_use;
Expand Down
4 changes: 2 additions & 2 deletions src/in_mem_filter_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ template <typename label_type> const tsl::robin_set<label_type> &InMemFilterStor
return _labels;
}

template <typename label_type> void InMemFilterStore<label_type>::add_to_label_set(label_type &label)
template <typename label_type> void InMemFilterStore<label_type>::add_to_label_set(const label_type &label)
{
_labels.insert(label);
}
Expand Down Expand Up @@ -81,7 +81,7 @@ template <typename label_type> bool InMemFilterStore<label_type>::label_has_medo
}

template <typename label_type>
void InMemFilterStore<label_type>::add_label_to_location(const location_t point_id, label_type label)
void InMemFilterStore<label_type>::add_label_to_location(const location_t point_id, const label_type label)
{
_location_to_labels[point_id].emplace_back(label);
}
Expand Down

0 comments on commit 0b9118f

Please sign in to comment.