@@ -70,6 +70,7 @@ class HierarchicalNSW : public AlgorithmInterface<dist_t> {
70
70
std::mutex deleted_elements_lock; // lock for deleted_elements
71
71
std::unordered_set<tableint> deleted_elements; // contains internal ids of deleted elements
72
72
73
+ HierarchicalNSW () { }
73
74
74
75
HierarchicalNSW (SpaceInterface<dist_t > *s) {
75
76
}
@@ -322,7 +323,7 @@ class HierarchicalNSW : public AlgorithmInterface<dist_t> {
322
323
std::priority_queue<std::pair<dist_t , tableint>, std::vector<std::pair<dist_t , tableint>>, CompareByFirst> candidate_set;
323
324
324
325
dist_t lowerBound;
325
- if (bare_bone_search ||
326
+ if (bare_bone_search ||
326
327
(!isMarkedDeleted (ep_id) && ((!isIdAllowed) || (*isIdAllowed)(getExternalLabel (ep_id))))) {
327
328
char * ep_data = getDataByInternalId (ep_id);
328
329
dist_t dist = fstdistfunc_ (data_point, ep_data, dist_func_param_);
@@ -403,7 +404,7 @@ class HierarchicalNSW : public AlgorithmInterface<dist_t> {
403
404
_MM_HINT_T0); // //////////////////////
404
405
#endif
405
406
406
- if (bare_bone_search ||
407
+ if (bare_bone_search ||
407
408
(!isMarkedDeleted (candidate_id) && ((!isIdAllowed) || (*isIdAllowed)(getExternalLabel (candidate_id))))) {
408
409
top_candidates.emplace (dist, candidate_id);
409
410
if (!bare_bone_search && stop_condition) {
@@ -826,7 +827,7 @@ class HierarchicalNSW : public AlgorithmInterface<dist_t> {
826
827
std::vector<data_t > getDataByLabel (labeltype label) const {
827
828
// lock all operations with element by label
828
829
std::unique_lock <std::mutex> lock_label (getLabelOpMutex (label));
829
-
830
+
830
831
std::unique_lock <std::mutex> lock_table (label_lookup_lock);
831
832
auto search = label_lookup_.find (label);
832
833
if (search == label_lookup_.end () || isMarkedDeleted (search->second )) {
@@ -888,7 +889,7 @@ class HierarchicalNSW : public AlgorithmInterface<dist_t> {
888
889
889
890
/*
890
891
* Removes the deleted mark of the node, does NOT really change the current graph.
891
- *
892
+ *
892
893
* Note: the method is not safe to use when replacement of deleted elements is enabled,
893
894
* because elements marked as deleted can be completely removed by addPoint
894
895
*/
0 commit comments