Skip to content

Commit

Permalink
update sourmash.h
Browse files Browse the repository at this point in the history
  • Loading branch information
luizirber committed Jan 7, 2021
1 parent f28fab5 commit ef5c62f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
21 changes: 14 additions & 7 deletions include/sourmash.h
Expand Up @@ -211,13 +211,20 @@ SourmashStr searchresult_filename(const SourmashSearchResult *ptr);

SourmashSignature *searchresult_signature(const SourmashSearchResult *ptr);

SourmashRevIndex *revindex_new(const SourmashStr *const *search_sigs_ptr,
uintptr_t insigs,
const SourmashKmerMinHash *template_ptr,
uintptr_t threshold,
const SourmashKmerMinHash *const *queries_ptr,
uintptr_t inqueries,
bool keep_sigs);
SourmashRevIndex *revindex_new_with_paths(const SourmashStr *const *search_sigs_ptr,
uintptr_t insigs,
const SourmashKmerMinHash *template_ptr,
uintptr_t threshold,
const SourmashKmerMinHash *const *queries_ptr,
uintptr_t inqueries,
bool keep_sigs);

SourmashRevIndex *revindex_new_with_sigs(const SourmashSignature *const *search_sigs_ptr,
uintptr_t insigs,
const SourmashKmerMinHash *template_ptr,
uintptr_t threshold,
const SourmashKmerMinHash *const *queries_ptr,
uintptr_t inqueries);

void revindex_free(SourmashRevIndex *ptr);

Expand Down
1 change: 0 additions & 1 deletion src/core/src/encodings.rs
Expand Up @@ -439,7 +439,6 @@ impl Colors {
old_idxs.1 += 1;
})
.or_insert_with(|| (idxs.0, 1));
//self.colors.insert(new_color, idxs);
Ok(new_color)
}
}
Expand Down
10 changes: 3 additions & 7 deletions src/core/src/index/greyhound.rs
Expand Up @@ -363,6 +363,9 @@ impl RevIndex {
large_hashes
.entry(hash)
.and_modify(|entry| {
// Hash is already present.
// Update the current color by adding the indices from
// small_colors.
let ids = small_colors.indices(&color);
let new_color = large_colors.update(Some(*entry), ids).unwrap();
*entry = new_color;
Expand All @@ -378,13 +381,6 @@ impl RevIndex {
});
});

// Doing this outside reduce (at the end) uses more memory (since it
// accumulates unused colors), but doesn't iterate over all
// hashes/colors so frequently. For now keeping it here to
// save memory
//let used_colors: HashSet<_> = large_hashes.values().collect();
//large_colors.retain(|color, _| used_colors.contains(color));

(large_hashes, large_colors)
}

Expand Down

0 comments on commit ef5c62f

Please sign in to comment.