Skip to content

Commit

Permalink
[MISC] Remove unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Aug 25, 2023
1 parent ce85a59 commit 03d9ba2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
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

0 comments on commit 03d9ba2

Please sign in to comment.