Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MISC] Remove unused variables #53

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions include/hibf/detail/sketch/toolbox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ struct entry
using distance_matrix = std::vector<entry>;

//!\brief Sorts filenames and cardinalities by looking only at the cardinalities.
void sort_by_cardinalities(std::vector<hyperloglog> const & sketches,
std::vector<size_t> const & counts,
std::vector<size_t> & positions);
void sort_by_cardinalities(std::vector<size_t> const & counts, std::vector<size_t> & positions);

/*!\brief Estimate the cardinality of the union for a single user bin j with all prior ones j' < j.
* \param[out] estimates output row
Expand Down Expand Up @@ -106,7 +104,6 @@ void rearrange_bins(std::vector<hyperloglog> const & sketches,
*/

void cluster_bins(std::vector<hyperloglog> const & sketches,
std::vector<size_t> const & counts,
std::vector<size_t> & positions,
std::vector<size_t> & permutation,
size_t const first,
Expand Down
2 changes: 1 addition & 1 deletion src/detail/layout/hierarchical_binning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ size_t hierarchical_binning::execute()

if (!data->user_bins_arranged)
{
sketch::toolbox::sort_by_cardinalities(*data->sketches, *data->kmer_counts, data->positions);
sketch::toolbox::sort_by_cardinalities(*data->kmer_counts, data->positions);

if (!config.disable_estimate_union && !config.disable_rearrangement)
sketch::toolbox::rearrange_bins(*data->sketches,
Expand Down
7 changes: 2 additions & 5 deletions src/detail/sketch/toolbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
namespace seqan::hibf::sketch::toolbox
{

void sort_by_cardinalities(std::vector<hyperloglog> const & sketches,
std::vector<size_t> const & kmer_counts,
std::vector<size_t> & positions)
void sort_by_cardinalities(std::vector<size_t> const & kmer_counts, std::vector<size_t> & positions)
{
assert(positions.size() <= kmer_counts.size());

Expand Down Expand Up @@ -97,7 +95,7 @@ void rearrange_bins(std::vector<hyperloglog> const & sketches,
if (last == positions.size() || kmer_counts[positions[first]] * max_ratio > kmer_counts[positions[last]])
{
// if this is not the first group, we want one bin overlap
cluster_bins(sketches, kmer_counts, positions, permutation, first, last, num_threads);
cluster_bins(sketches, positions, permutation, first, last, num_threads);
first = last;
}
++last;
Expand All @@ -114,7 +112,6 @@ void rearrange_bins(std::vector<hyperloglog> const & sketches,
}

void cluster_bins(std::vector<hyperloglog> const & sketches,
std::vector<size_t> const & counts,
std::vector<size_t> & positions,
std::vector<size_t> & permutation,
size_t const first,
Expand Down
5 changes: 1 addition & 4 deletions test/unit/hibf/detail/sketch/toolbox_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct toolbox_test : public ::testing::Test

TEST_F(toolbox_test, sort_by_cardinalities)
{
seqan::hibf::sketch::toolbox::sort_by_cardinalities(test_sketches, test_kmer_counts, test_positions);
seqan::hibf::sketch::toolbox::sort_by_cardinalities(test_kmer_counts, test_positions);

// filenames do not change
EXPECT_RANGE_EQ(test_filenames, (std::vector<std::string>{"small.fa", "small.fa", "small2.fa", "small2.fa"}));
Expand Down Expand Up @@ -264,7 +264,6 @@ TEST_F(toolbox_test, cluster_bins)
{ // whole range
std::vector<size_t> permutation{};
seqan::hibf::sketch::toolbox::cluster_bins(test_sketches,
test_kmer_counts,
test_positions,
permutation,
0 /*interval start*/,
Expand All @@ -277,15 +276,13 @@ TEST_F(toolbox_test, cluster_bins)
{ // intervals
std::vector<size_t> permutation{};
seqan::hibf::sketch::toolbox::cluster_bins(test_sketches,
test_kmer_counts,
test_positions,
permutation,
0 /*interval start*/,
1 /*interval_end*/,
1 /*number of threads*/);
EXPECT_RANGE_EQ(permutation, (std::vector<size_t>{0}));
seqan::hibf::sketch::toolbox::cluster_bins(test_sketches,
test_kmer_counts,
test_positions,
permutation,
1 /*interval start*/,
Expand Down