#include <OSCoinSolver.h>
Public Member Functions | |
CoinSolver () | |
The class contructor. | |
~CoinSolver () | |
The class destructor. | |
virtual void | solve () throw (ErrorClass) |
The implementation of the virtual functions. | |
virtual void | buildSolverInstance () throw (ErrorClass) |
The implementation of the virtual functions. | |
bool | setCoinPackedMatrix () |
Create a CoinPackedMatrix. | |
std::string | getCoinSolverType (std::string osol_) |
void | dataEchoCheck () |
Print out problem parameters. | |
Public Attributes | |
OsiSolverInterface * | osiSolver |
ossiSolver is the osi solver object -- in this case clp, glpk, cbc, or cplex | |
OSiLReader * | m_osilreader |
m_osilreader is an OSiLReader object used to create an osinstance from an osil string if needed | |
Private Attributes | |
CoinPackedMatrix * | m_CoinPackedMatrix |
m_CoinPackedMatrix is a Coin Packed Matrix ojbect | |
OSrLWriter * | osrlwriter |
osrlwriter object used to write osrl from and OSResult object |
This class implements a solve method for the Coin solvers It reads an OSInstance object and puts into the Coin OSI format
Definition at line 59 of file OSCoinSolver.h.
CoinSolver::CoinSolver | ( | ) |
CoinSolver::~CoinSolver | ( | ) |
The class destructor.
Definition at line 50 of file OSCoinSolver.cpp.
References m_CoinPackedMatrix, m_osilreader, osiSolver, DefaultSolver::osresult, and osrlwriter.
void CoinSolver::solve | ( | ) | throw (ErrorClass) [virtual] |
The implementation of the virtual functions.
Implements DefaultSolver.
Definition at line 209 of file OSCoinSolver.cpp.
References buildSolverInstance(), OtherVariableResultStruct::description, ErrorClass::errormsg, OSInstance::getConstraintNumber(), OSInstance::getInstanceName(), OSInstance::getNumberOfBinaryVariables(), OSInstance::getNumberOfIntegerVariables(), OSInstance::getNumberOfNonlinearExpressions(), OSInstance::getNumberOfQuadraticTerms(), OSInstance::getObjectiveConstants(), OSInstance::getVariableNumber(), DefaultSolver::osinstance, osiSolver, DefaultSolver::osol, DefaultSolver::osresult, DefaultSolver::osrl, osrlwriter, OSResult::setAnOtherVariableResult(), OSResult::setConstraintNumber(), OSResult::setDualVariableValues(), OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), OSResult::setInstanceName(), OSResult::setNumberOfOtherVariableResult(), OSResult::setObjectiveNumber(), OSResult::setObjectiveValues(), OSResult::setPrimalVariableValues(), OSResult::setServiceName(), OSResult::setSolutionNumber(), OSResult::setSolutionStatus(), OSResult::setVariableNumber(), DefaultSolver::sSolverName, and OSrLWriter::writeOSrL().
Referenced by main().
void CoinSolver::buildSolverInstance | ( | ) | throw (ErrorClass) [virtual] |
The implementation of the virtual functions.
Implements DefaultSolver.
Definition at line 69 of file OSCoinSolver.cpp.
References DefaultSolver::bCallbuildSolverInstance, ErrorClass::errormsg, OSInstance::getConstraintLowerBounds(), OSInstance::getConstraintNumber(), OSInstance::getConstraintUpperBounds(), OSInstance::getDenseObjectiveCoefficients(), OSInstance::getLinearConstraintCoefficientNumber(), OSInstance::getNumberOfBinaryVariables(), OSInstance::getNumberOfIntegerVariables(), OSInstance::getObjectiveMaxOrMins(), OSInstance::getObjectiveNumber(), OSInstance::getVariableLowerBounds(), OSInstance::getVariableNumber(), OSInstance::getVariableTypes(), OSInstance::getVariableUpperBounds(), m_CoinPackedMatrix, m_osilreader, DefaultSolver::osil, DefaultSolver::osinstance, osiSolver, DefaultSolver::osresult, DefaultSolver::osrl, osrlwriter, OSiLReader::readOSiL(), setCoinPackedMatrix(), OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), DefaultSolver::sSolverName, and OSrLWriter::writeOSrL().
bool CoinSolver::setCoinPackedMatrix | ( | ) |
Create a CoinPackedMatrix.
Definition at line 185 of file OSCoinSolver.cpp.
References ErrorClass::errormsg, OSInstance::getConstraintNumber(), OSInstance::getLinearConstraintCoefficientMajor(), OSInstance::getLinearConstraintCoefficientNumber(), OSInstance::getLinearConstraintCoefficientsInColumnMajor(), OSInstance::getLinearConstraintCoefficientsInRowMajor(), OSInstance::getVariableNumber(), SparseMatrix::indexes, m_CoinPackedMatrix, DefaultSolver::osinstance, DefaultSolver::osresult, DefaultSolver::osrl, osrlwriter, OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), SparseMatrix::starts, SparseMatrix::values, and OSrLWriter::writeOSrL().
Referenced by buildSolverInstance().
std::string CoinSolver::getCoinSolverType | ( | std::string | osol_ | ) |
Definition at line 397 of file OSCoinSolver.cpp.
References ErrorClass::errormsg, DefaultSolver::osresult, DefaultSolver::osrl, osrlwriter, OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), and OSrLWriter::writeOSrL().
string CoinSolver::dataEchoCheck | ( | ) |
Print out problem parameters.
Definition at line 428 of file OSCoinSolver.cpp.
References OSInstance::getConstraintLowerBounds(), OSInstance::getConstraintNames(), OSInstance::getConstraintNumber(), OSInstance::getConstraintUpperBounds(), OSInstance::getDenseObjectiveCoefficients(), OSInstance::getInstanceDescription(), OSInstance::getInstanceName(), OSInstance::getInstanceSource(), OSInstance::getObjectiveMaxOrMins(), OSInstance::getVariableLowerBounds(), OSInstance::getVariableNames(), OSInstance::getVariableNumber(), OSInstance::getVariableTypes(), OSInstance::getVariableUpperBounds(), OSInstance::instanceData, m_CoinPackedMatrix, Objectives::numberOfObjectives, Objectives::obj, InstanceData::objectives, and DefaultSolver::osinstance.
OsiSolverInterface* CoinSolver::osiSolver |
ossiSolver is the osi solver object -- in this case clp, glpk, cbc, or cplex
Definition at line 108 of file OSCoinSolver.h.
Referenced by buildSolverInstance(), main(), solve(), and ~CoinSolver().
m_osilreader is an OSiLReader object used to create an osinstance from an osil string if needed
Definition at line 116 of file OSCoinSolver.h.
Referenced by buildSolverInstance(), and ~CoinSolver().
CoinPackedMatrix* CoinSolver::m_CoinPackedMatrix [private] |
m_CoinPackedMatrix is a Coin Packed Matrix ojbect
Definition at line 129 of file OSCoinSolver.h.
Referenced by buildSolverInstance(), dataEchoCheck(), setCoinPackedMatrix(), and ~CoinSolver().
OSrLWriter* CoinSolver::osrlwriter [private] |
osrlwriter object used to write osrl from and OSResult object
Definition at line 132 of file OSCoinSolver.h.
Referenced by buildSolverInstance(), CoinSolver(), getCoinSolverType(), setCoinPackedMatrix(), solve(), and ~CoinSolver().