From 15385e0680fb19701220f0c8b9973923ebdfebb2 Mon Sep 17 00:00:00 2001 From: burgholzer Date: Fri, 5 Jan 2024 14:22:06 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20change=20reference=20members=20t?= =?UTF-8?q?o=20pointer=20type=20in=20`ApplicationScheme`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: burgholzer --- .../checker/dd/applicationscheme/ApplicationScheme.hpp | 6 +++--- .../dd/applicationscheme/GateCostApplicationScheme.hpp | 2 +- .../dd/applicationscheme/LookaheadApplicationScheme.hpp | 8 ++++---- .../applicationscheme/ProportionalApplicationScheme.hpp | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/checker/dd/applicationscheme/ApplicationScheme.hpp b/include/checker/dd/applicationscheme/ApplicationScheme.hpp index c45f9829..fb92cdd6 100644 --- a/include/checker/dd/applicationscheme/ApplicationScheme.hpp +++ b/include/checker/dd/applicationscheme/ApplicationScheme.hpp @@ -92,7 +92,7 @@ template class ApplicationScheme { public: ApplicationScheme(TM& tm1, TM& tm2) noexcept - : taskManager1(tm1), taskManager2(tm2){}; + : taskManager1(&tm1), taskManager2(&tm2){}; virtual ~ApplicationScheme() = default; @@ -100,8 +100,8 @@ template class ApplicationScheme { virtual std::pair operator()() = 0; protected: - TM& taskManager1; - TM& taskManager2; + TM* taskManager1; + TM* taskManager2; }; } // namespace ec diff --git a/include/checker/dd/applicationscheme/GateCostApplicationScheme.hpp b/include/checker/dd/applicationscheme/GateCostApplicationScheme.hpp index e9c8d9bc..b1d23670 100644 --- a/include/checker/dd/applicationscheme/GateCostApplicationScheme.hpp +++ b/include/checker/dd/applicationscheme/GateCostApplicationScheme.hpp @@ -56,7 +56,7 @@ class GateCostApplicationScheme final return {1U, 1U}; } - const auto& op = this->taskManager1(); + const auto& op = (*this->taskManager1)(); const auto key = GateCostLookupTableKeyType{op->getType(), op->getNcontrols()}; std::size_t cost = 1U; diff --git a/include/checker/dd/applicationscheme/LookaheadApplicationScheme.hpp b/include/checker/dd/applicationscheme/LookaheadApplicationScheme.hpp index 7bcf3352..eb37f8da 100644 --- a/include/checker/dd/applicationscheme/LookaheadApplicationScheme.hpp +++ b/include/checker/dd/applicationscheme/LookaheadApplicationScheme.hpp @@ -30,14 +30,14 @@ class LookaheadApplicationScheme final if (!cached1) { // cache the current operation - op1 = this->taskManager1.getDD(); + op1 = this->taskManager1->getDD(); package->incRef(op1); cached1 = true; } if (!cached2) { // cache the current operation - op2 = this->taskManager2.getInverseDD(); + op2 = this->taskManager2->getInverseDD(); package->incRef(op2); cached2 = true; } @@ -54,13 +54,13 @@ class LookaheadApplicationScheme final *internalState = dd1; package->decRef(op1); cached1 = false; - this->taskManager1.advanceIterator(); + this->taskManager1->advanceIterator(); } else { assert(!this->taskManager2.finished()); *internalState = dd2; package->decRef(op2); cached2 = false; - this->taskManager2.advanceIterator(); + this->taskManager2->advanceIterator(); } // properly track reference counts diff --git a/include/checker/dd/applicationscheme/ProportionalApplicationScheme.hpp b/include/checker/dd/applicationscheme/ProportionalApplicationScheme.hpp index 31d6cc59..1f20b829 100644 --- a/include/checker/dd/applicationscheme/ProportionalApplicationScheme.hpp +++ b/include/checker/dd/applicationscheme/ProportionalApplicationScheme.hpp @@ -23,8 +23,8 @@ class ProportionalApplicationScheme final private: [[nodiscard]] std::size_t computeGateRatio() const noexcept { - const std::size_t size1 = this->taskManager1.getCircuit()->size(); - const std::size_t size2 = this->taskManager2.getCircuit()->size(); + const std::size_t size1 = this->taskManager1->getCircuit()->size(); + const std::size_t size2 = this->taskManager2->getCircuit()->size(); if (size1 == 0U) { return size2; }