Skip to content

Commit

Permalink
split into files
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir committed Feb 1, 2024
1 parent ecde37b commit 0f6aed2
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/cpp/benders/benders_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ add_library (benders_core STATIC
${CMAKE_CURRENT_SOURCE_DIR}/LastIterationPrinter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/StartUp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CutsManagement.cpp
${CMAKE_CURRENT_SOURCE_DIR}/OuterLoopCriterion.cpp
${CMAKE_CURRENT_SOURCE_DIR}/BendersMathLogger.cpp
${CMAKE_CURRENT_SOURCE_DIR}/OuterLoop.cpp
)

get_target_property(JSON_INC_PATH jsoncpp_lib INTERFACE_INCLUDE_DIRECTORIES)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "OuterLoopCriterion.h"
#include "OuterLoop.h"

OuterLoop::OuterLoop(std::shared_ptr<IOuterLoopCriterion> criterion,
std::shared_ptr<IMasterUpdate> master_updater,
Expand All @@ -8,5 +8,5 @@ OuterLoop::OuterLoop(std::shared_ptr<IOuterLoopCriterion> criterion,
benders_(std::move(benders)) {}

void OuterLoop::Run() {
// master_updater_->
// master_updater_->Update();
}
5 changes: 5 additions & 0 deletions src/cpp/benders/benders_core/include/MasterUpdate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once
class IMasterUpdate {
public:
virtual void Update() = 0;
};
16 changes: 16 additions & 0 deletions src/cpp/benders/benders_core/include/OuterLoop.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once
#include "MasterUpdate.h"
#include "OuterLoopCriterion.h"

class OuterLoop {
public:
explicit OuterLoop(std::shared_ptr<IOuterLoopCriterion> criterion,
std::shared_ptr<IMasterUpdate> master_updater,
pBendersBase benders);
void Run();

private:
std::shared_ptr<IOuterLoopCriterion> criterion_;
std::shared_ptr<IMasterUpdate> master_updater_;
pBendersBase benders_;
};
18 changes: 0 additions & 18 deletions src/cpp/benders/benders_core/include/OuterLoopCriterion.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,3 @@ class OuterloopCriterionLOL : public IOuterLoopCriterion {
explicit OuterloopCriterionLOL(double threshold, double epsilon){};
bool Check() override { return true; };
};

class IMasterUpdate {
public:
virtual void Update() = 0;
};

class OuterLoop {
public:
explicit OuterLoop(std::shared_ptr<IOuterLoopCriterion> criterion,
std::shared_ptr<IMasterUpdate> master_updater,
pBendersBase benders);
void Run();

private:
std::shared_ptr<IOuterLoopCriterion> criterion_;
std::shared_ptr<IMasterUpdate> master_updater_;
pBendersBase benders_;
};

0 comments on commit 0f6aed2

Please sign in to comment.