Skip to content

Commit 0a938f2

Browse files
committed
Simplify single-statement ExecuteInternal methods
Removing time accounting made some execution methods have only a single method call, the one actually doing the work. Moved the work directly to the execution methods.
1 parent 59358b9 commit 0a938f2

12 files changed

Lines changed: 6 additions & 39 deletions

File tree

src/core/algorithms/cind/cind_verifier/cind_verifier.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,6 @@ void CINDVerifier::LoadDataInternal() {
151151
}
152152

153153
void CINDVerifier::ExecuteInternal() {
154-
VerifyCIND();
155-
}
156-
157-
void CINDVerifier::VerifyCIND() {
158154
model::TableIndex const lhs_table_idx = 0;
159155
model::TableIndex const rhs_table_idx =
160156
(input_tables_.size() == 1) ? 0

src/core/algorithms/cind/cind_verifier/cind_verifier.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ class CINDVerifier final : public Algorithm {
5454
void LoadDataInternal() final;
5555
void ExecuteInternal() final;
5656

57-
void VerifyCIND();
58-
5957
public:
6058
CINDVerifier();
6159

src/core/algorithms/fd/afd_metric/afd_metric_calculator.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ void AFDMetricCalculator::LoadDataInternal() {
4646
}
4747

4848
void AFDMetricCalculator::ExecuteInternal() {
49-
CalculateMetric();
50-
}
51-
52-
void AFDMetricCalculator::CalculateMetric() {
5349
auto num_rows = relation_->GetNumRows();
5450
auto lhs_pli = relation_->CalculatePLIWS(lhs_indices_);
5551
auto rhs_pli = relation_->CalculatePLIWS(rhs_indices_);

src/core/algorithms/fd/afd_metric/afd_metric_calculator.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ class AFDMetricCalculator : public Algorithm {
2727

2828
long double result_ = 0.L;
2929

30-
void CalculateMetric();
31-
3230
void RegisterOptions();
3331

3432
void ResetState() final {

src/core/algorithms/gdd/gdd_validator/gdd_validator.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88

99
namespace algos {
1010

11-
void GddValidator::ExecuteInternal() {
12-
FilterValidGdds();
13-
}
14-
1511
void GddValidator::ResetState() {
1612
result_.clear();
1713
counterexamples_.clear();
@@ -33,7 +29,7 @@ void GddValidator::LoadDataInternal() {
3329
graph_ = parser::graph_parser::gdd::ReadGraph(graph_path_);
3430
}
3531

36-
void GddValidator::FilterValidGdds() {
32+
void GddValidator::ExecuteInternal() {
3733
ResetState();
3834

3935
std::size_t gdd_index = 0;

src/core/algorithms/gdd/gdd_validator/gdd_validator.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class GddValidator : public Algorithm {
1818
std::vector<model::Gdd> result_;
1919
std::vector<GddCounterexample> counterexamples_;
2020

21-
void FilterValidGdds();
2221
void RegisterOptions();
2322

2423
virtual void ExecuteInternal() final;

src/core/algorithms/ind/ind_verifier/ind_verifier.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void INDVerifier::LoadDataInternal() {
7777
/* Do nothing, we don't prepocess any data before executing. */
7878
}
7979

80-
void INDVerifier::VerifyIND() {
80+
void INDVerifier::ExecuteInternal() {
8181
/* Ensure, that all rows have model::IDatasetStream::GetNumberOfColumns() values. */
8282
using FixedStream = model::DatasetStreamFixed<model::IDatasetStream*>;
8383
/* Perform a projection of the fixed dataset stream. */
@@ -135,8 +135,4 @@ void INDVerifier::VerifyIND() {
135135
error_ = static_cast<Error>(GetViolatingClustersCount()) / lhs_cardinality;
136136
}
137137

138-
void INDVerifier::ExecuteInternal() {
139-
VerifyIND();
140-
}
141-
142138
} // namespace algos

src/core/algorithms/ind/ind_verifier/ind_verifier.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ class INDVerifier final : public Algorithm {
4444

4545
void LoadDataInternal() final;
4646

47-
void VerifyIND();
48-
4947
void ExecuteInternal() final;
5048

5149
public:

src/core/algorithms/md/md_verifier/md_verifier.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ void MDVerifier::MakeExecuteOptsAvailable() {
9696
MakeOptionsAvailable({kRightTable, kLeftTable, kMDLHS, kMDRHS, kThreads});
9797
}
9898

99-
void MDVerifier::ExecuteInternal() {
100-
VerifyMD();
101-
}
102-
10399
model::MD MDVerifier::BuildMD(std::vector<ColumnSimilarityClassifier> const& lhs,
104100
ColumnSimilarityClassifier const& rhs) {
105101
auto column_matches = std::make_shared<std::vector<model::md::ColumnMatch>>();
@@ -151,7 +147,7 @@ MDValidationCalculator MDVerifier::CreateValidator() const {
151147
return validator;
152148
}
153149

154-
void MDVerifier::VerifyMD() {
150+
void MDVerifier::ExecuteInternal() {
155151
input_md_ = BuildMD(lhs_, rhs_);
156152
highlights_ = std::make_shared<MDHighlights>(input_md_->GetDescription().rhs);
157153

src/core/algorithms/md/md_verifier/md_verifier.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class MDVerifier : public Algorithm {
4040
void ResetState() override;
4141

4242
void RegisterOptions();
43-
void VerifyMD();
4443

4544
MDValidationCalculator CreateValidator() const;
4645

0 commit comments

Comments
 (0)