graph_analysis
SoplexSolver.hpp
Go to the documentation of this file.
1 #ifndef GRAPH_ANALYSIS_ALGORITHMS_SOPLEX_SOLVER_HPP
2 #define GRAPH_ANALYSIS_ALGORITHMS_SOPLEX_SOLVER_HPP
3 
4 #include <soplex.h>
5 #include "../../LPSolver.hpp"
6 
7 namespace graph_analysis {
8 namespace algorithms {
9 namespace lp {
10 namespace embedded {
11 
12 class SoplexSolver : public LPSolver
13 {
14 public:
15  SoplexSolver();
16  virtual ~SoplexSolver();
17 
18  LPSolver::Type getSolverType() const override { return SOPLEX_SOLVER; }
19 
20  void saveProblem(const std::string& filename, ProblemFormat format = CPLEX) const override;
21 
22  void loadSolution(const std::string& filename, SolutionType format = BASIC_SOLUTION) override;
23 
29  void saveSolution(const std::string& filename, LPSolver::SolutionType format = BASIC_SOLUTION) const override;
30 
34  double getObjectiveValue() const override;
35 
41  double getVariableValueByColumnIdx(uint32_t idx) const override;
42 
43  Status run() override { throw std::runtime_error("graph_analysis::algorithms::SoplexSolver::run not implemented"); }
44 
45  Status run(const std::string& problem, LPSolver::ProblemFormat problemFormat = CPLEX, bool useCaching = false) override;
46 
47  std::vector<size_t> infeasibleConstraints() const override { return mInfeasibleConstraints; }
48 
49 protected:
50  soplex::SoPlex mSoplex;
51  soplex::NameSet mRowNames;
52  soplex::NameSet mColumnNames;
53  std::vector<size_t> mInfeasibleConstraints;
54  virtual void doLoadProblem(const std::string& filename, ProblemFormat format = CPLEX) override;
55 
56 };
57 
58 } // end namespace embedded
59 } // end namespace lp
60 } // end namespace algorithms
61 } // end namespace graph_analysis
62 #endif // GRAPH_ANALYSIS_ALGORITHMS_SOPLEX_SOLVER_HPP
graph_analysis::algorithms::LPSolver
Definition: LPSolver.hpp:15
graph_analysis::algorithms::lp::embedded::SoplexSolver::SoplexSolver
SoplexSolver()
Definition: SoplexSolver.cpp:8
graph_analysis::algorithms::lp::embedded::SoplexSolver::getSolverType
LPSolver::Type getSolverType() const override
Definition: SoplexSolver.hpp:18
graph_analysis::algorithms::lp::embedded::SoplexSolver::run
Status run() override
Definition: SoplexSolver.hpp:43
graph_analysis::algorithms::lp::embedded::SoplexSolver::mColumnNames
soplex::NameSet mColumnNames
Definition: SoplexSolver.hpp:52
graph_analysis::algorithms::lp::embedded::SoplexSolver::loadSolution
void loadSolution(const std::string &filename, SolutionType format=BASIC_SOLUTION) override
Definition: SoplexSolver.cpp:29
graph_analysis::algorithms::lp::embedded::SoplexSolver::infeasibleConstraints
std::vector< size_t > infeasibleConstraints() const override
Definition: SoplexSolver.hpp:47
graph_analysis::algorithms::lp::embedded::SoplexSolver::mInfeasibleConstraints
std::vector< size_t > mInfeasibleConstraints
Definition: SoplexSolver.hpp:53
graph_analysis::algorithms::lp::embedded::SoplexSolver::mSoplex
soplex::SoPlex mSoplex
Definition: SoplexSolver.hpp:50
graph_analysis::algorithms::LPSolver::SOPLEX_SOLVER
@ SOPLEX_SOLVER
Definition: LPSolver.hpp:33
graph_analysis::algorithms::lp::embedded::SoplexSolver::~SoplexSolver
virtual ~SoplexSolver()
Definition: SoplexSolver.cpp:13
graph_analysis::algorithms::lp::embedded::SoplexSolver::getVariableValueByColumnIdx
double getVariableValueByColumnIdx(uint32_t idx) const override
Definition: SoplexSolver.cpp:44
graph_analysis::algorithms::lp::embedded::SoplexSolver::saveProblem
void saveProblem(const std::string &filename, ProblemFormat format=CPLEX) const override
Definition: SoplexSolver.cpp:17
graph_analysis
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
graph_analysis::algorithms::LPSolver::SolutionType
SolutionType
Solution types: basic, IPT = interior point, MIP = mixed integer.
Definition: LPSolver.hpp:46
graph_analysis::algorithms::LPSolver::ProblemFormat
ProblemFormat
Definition: LPSolver.hpp:41
graph_analysis::algorithms::lp::embedded::SoplexSolver
Definition: SoplexSolver.hpp:12
graph_analysis::algorithms::lp::embedded::SoplexSolver::doLoadProblem
virtual void doLoadProblem(const std::string &filename, ProblemFormat format=CPLEX) override
Definition: SoplexSolver.cpp:157
graph_analysis::algorithms::lp::embedded::SoplexSolver::saveSolution
void saveSolution(const std::string &filename, LPSolver::SolutionType format=BASIC_SOLUTION) const override
Definition: SoplexSolver.cpp:34
graph_analysis::algorithms::lp::embedded::SoplexSolver::getObjectiveValue
double getObjectiveValue() const override
Definition: SoplexSolver.cpp:39
graph_analysis::algorithms::LPSolver::BASIC_SOLUTION
@ BASIC_SOLUTION
Definition: LPSolver.hpp:46
graph_analysis::algorithms::LPSolver::Status
Status
Definition: LPSolver.hpp:18
graph_analysis::algorithms::lp::embedded::SoplexSolver::mRowNames
soplex::NameSet mRowNames
Definition: SoplexSolver.hpp:51
graph_analysis::algorithms::LPSolver::CPLEX
@ CPLEX
Definition: LPSolver.hpp:41
graph_analysis::algorithms::LPSolver::Type
Type
Definition: LPSolver.hpp:28