Skip to content

Commit

Permalink
update - fix boundary condition for mode3
Browse files Browse the repository at this point in the history
  • Loading branch information
quito418 committed Mar 2, 2023
1 parent 400b7fc commit 042f77d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/LearnedIndex_seeding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3217,9 +3217,10 @@ uint64_t mem_search_tradeoff(const uint8_t* ref_string,const uint8_t* sa_pos,con
int min_intv_value = raux->min_intv_limit ;

uint64_t iter_pos = est_pos;
iter_pos = iter_pos > MEM_TRADEOFF_USECACHE_EXP_SEARCH_START? iter_pos:MEM_TRADEOFF_USECACHE_EXP_SEARCH_START;
iter_pos = iter_pos < sa_num-1 - MEM_TRADEOFF_USECACHE_EXP_SEARCH_START? iter_pos:sa_num - 1-MEM_TRADEOFF_USECACHE_EXP_SEARCH_START;

if (!no_search){
iter_pos = iter_pos > MEM_TRADEOFF_USECACHE_EXP_SEARCH_START? iter_pos:MEM_TRADEOFF_USECACHE_EXP_SEARCH_START;
iter_pos = iter_pos < sa_num-1 - MEM_TRADEOFF_USECACHE_EXP_SEARCH_START? iter_pos:sa_num - 1-MEM_TRADEOFF_USECACHE_EXP_SEARCH_START;
}
uint32_t read_valid_len;
bool exact_match_flag=false;
uint32_t match_len;
Expand Down Expand Up @@ -3710,8 +3711,10 @@ uint64_t right_smem_search_tradeoff(const uint8_t* ref_string,const uint8_t* sa_
*/
int min_intv_value = raux->min_intv_limit ;
uint64_t iter_pos = est_pos;
iter_pos = iter_pos > MEM_TRADEOFF_USECACHE_EXP_SEARCH_START? iter_pos:MEM_TRADEOFF_USECACHE_EXP_SEARCH_START;
iter_pos = iter_pos < sa_num -1- MEM_TRADEOFF_USECACHE_EXP_SEARCH_START? iter_pos:sa_num -1- MEM_TRADEOFF_USECACHE_EXP_SEARCH_START;
if (!no_search){
iter_pos = iter_pos > MEM_TRADEOFF_USECACHE_EXP_SEARCH_START? iter_pos:MEM_TRADEOFF_USECACHE_EXP_SEARCH_START;
iter_pos = iter_pos < sa_num -1- MEM_TRADEOFF_USECACHE_EXP_SEARCH_START? iter_pos:sa_num -1- MEM_TRADEOFF_USECACHE_EXP_SEARCH_START;
}
uint64_t read_valid_len= *ambiguous_pos - raux->pivot;
bool exact_match_flag=false;
uint32_t match_len;
Expand Down

0 comments on commit 042f77d

Please sign in to comment.