Skip to content

Commit

Permalink
18746: Fixes rare issue where unpopulated initial min feature distanc…
Browse files Browse the repository at this point in the history
…e could skip searching some nearest neighbors (#43)
  • Loading branch information
howsoRes authored Dec 20, 2023
1 parent 5895b3d commit 220afd9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Amalgam/SeparableBoxFilterDataStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ double SeparableBoxFilterDataStore::PopulatePartialSumsWithSimilarFeatureValue(G
}
//else value_type == ENIVT_NULL

//didn't find the value
//return next smallest nominal distance term
return dist_params.ComputeDistanceTermNominalUniversallySymmetricNonMatchPrecomputed(query_feature_index, high_accuracy);
}
else if(effective_feature_type == GeneralizedDistance::EFDT_CONTINUOUS_STRING)
Expand Down Expand Up @@ -1039,7 +1039,7 @@ double SeparableBoxFilterDataStore::PopulatePartialSumsWithSimilarFeatureValue(G
size_t next_lower_index = 0;
if(!cyclic_feature)
{
if(lower_value_index > 1)
if(lower_value_index > 0)
{
next_lower_index = lower_value_index - 1;
lower_diff = std::abs(value.number - column->sortedNumberValueEntries[next_lower_index]->value.number);
Expand All @@ -1049,8 +1049,7 @@ double SeparableBoxFilterDataStore::PopulatePartialSumsWithSimilarFeatureValue(G
else //cyclic_feature
{
size_t next_index;
//0th index is unknown
if(lower_value_index > 1)
if(lower_value_index > 0)
next_index = lower_value_index - 1;
else
next_index = num_unique_number_values - 1;
Expand Down

0 comments on commit 220afd9

Please sign in to comment.