Skip to content

Commit

Permalink
add missing destructors
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Rosch committed Jan 23, 2025
1 parent fa5ea23 commit c7055fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions kaminpar-shm/coarsening/sparsification/Sampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace kaminpar::shm::sparsification {
class Sampler {
public:
virtual StaticArray<EdgeWeight> sample(const CSRGraph &g, EdgeID target_edge_amount) = 0;
virtual ~Sampler() = default;
};

} // kaminpar::shm
Expand Down
3 changes: 3 additions & 0 deletions kaminpar-shm/coarsening/sparsification/ScoreBacedSampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ namespace kaminpar::shm::sparsification {
template <typename Score> class ScoreFunction {
public:
virtual StaticArray<Score> scores(const CSRGraph &g) = 0;
virtual ~ScoreFunction() = default;
};
template <typename Score> class ReweighingFunction {
public:
virtual EdgeWeight new_weight(EdgeWeight old_weight, Score score) = 0;
virtual ~ReweighingFunction() = default;
};
template <typename Score> class WeightDiviedByScore : public ReweighingFunction<Score> {
EdgeWeight new_weight(EdgeWeight old_weight, Score score) override {
Expand All @@ -23,6 +25,7 @@ template <typename Score> class ScoreBacedSampler : public Sampler {
std::unique_ptr<ScoreFunction<Score>> scoreFunction
)
: _score_function(std::move(scoreFunction)){};
virtual ~ScoreBacedSampler() = default;

protected:
std::unique_ptr<ScoreFunction<Score>> _score_function;
Expand Down

0 comments on commit c7055fb

Please sign in to comment.