graph_analysis
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
graph_analysis::algorithms::lp::embedded::SoplexSolver Class Reference

#include <SoplexSolver.hpp>

Inheritance diagram for graph_analysis::algorithms::lp::embedded::SoplexSolver:
Inheritance graph
[legend]
Collaboration diagram for graph_analysis::algorithms::lp::embedded::SoplexSolver:
Collaboration graph
[legend]

Public Member Functions

 SoplexSolver ()
 
virtual ~SoplexSolver ()
 
LPSolver::Type getSolverType () const override
 
void saveProblem (const std::string &filename, ProblemFormat format=CPLEX) const override
 
void loadSolution (const std::string &filename, SolutionType format=BASIC_SOLUTION) override
 
void saveSolution (const std::string &filename, LPSolver::SolutionType format=BASIC_SOLUTION) const override
 
double getObjectiveValue () const override
 
double getVariableValueByColumnIdx (uint32_t idx) const override
 
Status run () override
 
Status run (const std::string &problem, LPSolver::ProblemFormat problemFormat=CPLEX, bool useCaching=false) override
 
std::vector< size_t > infeasibleConstraints () const override
 
- Public Member Functions inherited from graph_analysis::algorithms::LPSolver
 LPSolver ()
 
virtual ~LPSolver ()
 
bool loadProblem (const std::string &filename, ProblemFormat format=CPLEX)
 
std::string saveProblemToTempfile (LPSolver::ProblemFormat format=CPLEX) const
 
std::string saveSolutionToTempfile (LPSolver::SolutionType format=BASIC_SOLUTION) const
 
std::string getVariableNameByColumnIdx (uint32_t idx) const
 
uint32_t getColumnIdxByVariableName (const std::string &varName) const
 
const std::string & getProblemFile () const
 
LPSolver::ProblemFormat getProblemFileFormat () const
 
const std::string & getSolutionFile () const
 
LPSolver::SolutionType getSolutionFileFormat () const
 
void setSolutionCacheSize (size_t size)
 
size_t getSolutionCacheSize () const
 
void resetSolutionCache ()
 

Protected Member Functions

virtual void doLoadProblem (const std::string &filename, ProblemFormat format=CPLEX) override
 
- Protected Member Functions inherited from graph_analysis::algorithms::LPSolver
Status loadKnownSolution (const std::string &problemFilename)
 
void registerSolution (const std::string &problemFilename, const std::string &solutionFilename, Status status, SolutionType type)
 
const LPSolver::KnownSolutions::mapped_type & getRegisteredSolution (const std::string &problemFilename) const
 

Protected Attributes

soplex::SoPlex mSoplex
 
soplex::NameSet mRowNames
 
soplex::NameSet mColumnNames
 
std::vector< size_t > mInfeasibleConstraints
 
- Protected Attributes inherited from graph_analysis::algorithms::LPSolver
std::string mProblemFile
 
LPSolver::ProblemFormat mProblemFileFormat
 
std::string mSolutionFile
 
LPSolver::SolutionType mSolutionFileFormat
 
size_t mSolutionCacheSize
 

Additional Inherited Members

- Public Types inherited from graph_analysis::algorithms::LPSolver
enum  Status {
  STATUS_UNKNOWN, STATUS_OPTIMAL, STATUS_INFEASIBLE, STATUS_UNBOUNDED,
  INVALID_PROBLEM_DEFINITION, NO_SOLUTION_FOUND, SOLUTION_FOUND
}
 
enum  Type {
  UNKNOWN_LP_SOLVER, CBC_SOLVER, CLP_SOLVER, GLPK_SOLVER,
  SCIP_SOLVER, SOPLEX_SOLVER, GLPK_SOLVER_EMBEDDED, SCIP_SOLVER_EMBEDDED,
  SOPLEX_SOLVER_EMBEDDED, LP_SOLVER_TYPE_END
}
 
enum  ProblemFormat {
  UNKNOWN_PROBLEM_FORMAT = 0, CPLEX, GLPK, MPS,
  LP_PROBLEM_FORMAT_END
}
 
enum  SolutionType {
  UNKNOWN_SOLUTION_TYPE = 0, BASIC_SOLUTION, IPT_SOLUTION, MIP_SOLUTION,
  LP_SOLUTION_TYPE_END
}
 Solution types: basic, IPT = interior point, MIP = mixed integer. More...
 
typedef shared_ptr< LPSolver > Ptr
 
- Static Public Member Functions inherited from graph_analysis::algorithms::LPSolver
static LPSolver::Ptr getInstance (LPSolver::Type solverType)
 
static ProblemFormat getProblemFormatFromFileExtension (const std::string &extension)
 
static std::string getTempFilename (const std::string &suffix=".lp")
 
- Static Public Attributes inherited from graph_analysis::algorithms::LPSolver
static std::map< Status, std::string > StatusTxt
 
static std::map< Type, std::string > TypeTxt
 
static std::map< ProblemFormat, std::string > ProblemFormatTxt
 
static std::map< LPSolver::ProblemFormat, std::vector< std::string > > ProblemFormatExtensions
 
- Protected Types inherited from graph_analysis::algorithms::LPSolver
typedef std::map< std::string, KnownSolution > KnownSolutions
 
- Static Protected Attributes inherited from graph_analysis::algorithms::LPSolver
static KnownSolutions msKnownSolutions
 

Constructor & Destructor Documentation

◆ SoplexSolver()

graph_analysis::algorithms::lp::embedded::SoplexSolver::SoplexSolver ( )

◆ ~SoplexSolver()

graph_analysis::algorithms::lp::embedded::SoplexSolver::~SoplexSolver ( )
virtual

Member Function Documentation

◆ doLoadProblem()

void graph_analysis::algorithms::lp::embedded::SoplexSolver::doLoadProblem ( const std::string &  filename,
ProblemFormat  format = CPLEX 
)
overrideprotectedvirtual

◆ getObjectiveValue()

double graph_analysis::algorithms::lp::embedded::SoplexSolver::getObjectiveValue ( ) const
overridevirtual

Retrieve the current objective value of the solution

Implements graph_analysis::algorithms::LPSolver.

◆ getSolverType()

LPSolver::Type graph_analysis::algorithms::lp::embedded::SoplexSolver::getSolverType ( ) const
inlineoverridevirtual

◆ getVariableValueByColumnIdx()

double graph_analysis::algorithms::lp::embedded::SoplexSolver::getVariableValueByColumnIdx ( uint32_t  idx) const
overridevirtual

Get the variable value by the column index

Parameters
idxcolumn index
Returns
the variable value

Reimplemented from graph_analysis::algorithms::LPSolver.

◆ infeasibleConstraints()

std::vector<size_t> graph_analysis::algorithms::lp::embedded::SoplexSolver::infeasibleConstraints ( ) const
inlineoverridevirtual

Allow to return the set of infeasible constraint by a list of indices in the final solution

Reimplemented from graph_analysis::algorithms::LPSolver.

◆ loadSolution()

void graph_analysis::algorithms::lp::embedded::SoplexSolver::loadSolution ( const std::string &  filename,
SolutionType  format = BASIC_SOLUTION 
)
overridevirtual

Load a solution based

Parameters
filenamefilename of the solution file
formatformat of the solution

Implements graph_analysis::algorithms::LPSolver.

◆ run() [1/2]

Status graph_analysis::algorithms::lp::embedded::SoplexSolver::run ( )
inlineoverridevirtual

Run the solver (after loadProblem) has been called

Implements graph_analysis::algorithms::LPSolver.

◆ run() [2/2]

LPSolver::Status graph_analysis::algorithms::lp::embedded::SoplexSolver::run ( const std::string &  problemFilename,
LPSolver::ProblemFormat  problemFormat = CPLEX,
bool  useCaching = false 
)
overridevirtual

Run the solver with a given problem file

Parameters
problemFilenamefilename of the problem to solve
problemFormatformat of the problem to solver
useCachingTo use caching of problem and respective solutions set to True, otherwise False

Implements graph_analysis::algorithms::LPSolver.

◆ saveProblem()

void graph_analysis::algorithms::lp::embedded::SoplexSolver::saveProblem ( const std::string &  filename,
ProblemFormat  format = CPLEX 
) const
overridevirtual

Save the problem to file

Parameters
filenamefilename of the problem file
formatformat of the the problem

Implements graph_analysis::algorithms::LPSolver.

◆ saveSolution()

void graph_analysis::algorithms::lp::embedded::SoplexSolver::saveSolution ( const std::string &  filename,
LPSolver::SolutionType  format = BASIC_SOLUTION 
) const
overridevirtual

Save the solution to file

Parameters
filenamefilename of the solution file
formatformat of the the solution

Implements graph_analysis::algorithms::LPSolver.

Member Data Documentation

◆ mColumnNames

soplex::NameSet graph_analysis::algorithms::lp::embedded::SoplexSolver::mColumnNames
protected

◆ mInfeasibleConstraints

std::vector<size_t> graph_analysis::algorithms::lp::embedded::SoplexSolver::mInfeasibleConstraints
protected

◆ mRowNames

soplex::NameSet graph_analysis::algorithms::lp::embedded::SoplexSolver::mRowNames
protected

◆ mSoplex

soplex::SoPlex graph_analysis::algorithms::lp::embedded::SoplexSolver::mSoplex
protected

The documentation for this class was generated from the following files: