#include <OSBonminSolver.h>
Inheritance diagram for BonminSolver:
Public Member Functions | |
BonminSolver () | |
the BonminSolver class constructor | |
~BonminSolver () | |
the IpoptSolver class destructor | |
virtual void | solve () throw (ErrorClass) |
solve results in an instance being read into the Bonmin data structrues and optimized | |
virtual void | buildSolverInstance () throw (ErrorClass) |
buildSolverInstance is a virtual function -- the actual solvers will implement their own solve method -- the solver instance is the instance the individual solver sees in its api | |
virtual void | setSolverOptions () throw (ErrorClass) |
The implementation of the virtual functions. | |
void | dataEchoCheck () |
use this for debugging, print out the instance that the solver thinks it has and compare this with the OSiL file | |
void | writeResult () |
use this to write the solution information to an OSResult object | |
Public Attributes | |
SmartPtr< BonminProblem > | tminlp |
Bab | bb |
TMINLP::SolverReturn | status |
OSiLReader * | m_osilreader |
m_osilreader is an OSiLReader object used to create an osinstance from an osil string if needed | |
OSoLReader * | m_osolreader |
m_osolreader is an OSoLReader object used to create an osoption from an osol string if needed | |
Private Attributes | |
OSrLWriter * | osrlwriter |
BonminSetup | bonminSetup |
std::string | bonminErrorMsg |
Definition at line 249 of file OSBonminSolver.h.
BonminSolver::BonminSolver | ( | ) |
the BonminSolver class constructor
Definition at line 40 of file OSBonminSolver.cpp.
References bonminErrorMsg, m_osilreader, m_osolreader, DefaultSolver::osresult, and osrlwriter.
BonminSolver::~BonminSolver | ( | ) |
the IpoptSolver class destructor
Definition at line 49 of file OSBonminSolver.cpp.
References m_osilreader, m_osolreader, DefaultSolver::osresult, and osrlwriter.
void BonminSolver::solve | ( | ) | throw (ErrorClass) [virtual] |
solve results in an instance being read into the Bonmin data structrues and optimized
Implements DefaultSolver.
Definition at line 720 of file OSBonminSolver.cpp.
References bb, bonminSetup, buildSolverInstance(), ErrorClass::errormsg, OSInstance::getConstraintNumber(), OSInstance::getInstanceName(), OSInstance::getNumberOfBinaryVariables(), OSInstance::getNumberOfIntegerVariables(), OSInstance::getObjectiveNumber(), OSInstance::getVariableNumber(), Bonmin::BonminSetup::initialize(), Bonmin::Bab::model(), DefaultSolver::osinstance, DefaultSolver::osresult, DefaultSolver::osrl, osrlwriter, OSResult::setConstraintNumber(), OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), OSResult::setInstanceName(), OSResult::setObjectiveNumber(), OSResult::setServiceName(), OSResult::setSolutionNumber(), OSResult::setSolutionStatus(), setSolverOptions(), OSResult::setVariableNumber(), status, tminlp, OSrLWriter::writeOSrL(), and writeResult().
void BonminSolver::buildSolverInstance | ( | ) | throw (ErrorClass) [virtual] |
buildSolverInstance is a virtual function -- the actual solvers will implement their own solve method -- the solver instance is the instance the individual solver sees in its api
Implements DefaultSolver.
Definition at line 582 of file OSBonminSolver.cpp.
References DefaultSolver::bCallbuildSolverInstance, ErrorClass::errormsg, m_osilreader, DefaultSolver::osil, DefaultSolver::osinstance, DefaultSolver::osoption, DefaultSolver::osresult, DefaultSolver::osrl, osrlwriter, OSiLReader::readOSiL(), OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), tminlp, and OSrLWriter::writeOSrL().
Referenced by solve().
void BonminSolver::setSolverOptions | ( | ) | throw (ErrorClass) [virtual] |
The implementation of the virtual functions.
Implements DefaultSolver.
Definition at line 607 of file OSBonminSolver.cpp.
References bonminSetup, DefaultSolver::bSetSolverOptions, ErrorClass::errormsg, OSOption::getNumberOfSolverOptions(), OSOption::getSolverOptions(), Bonmin::BabSetupBase::initializeOptionsAndJournalist(), m_osolreader, OtherVariableResultStruct::name, Bonmin::BabSetupBase::options(), os_strtod(), DefaultSolver::osol, DefaultSolver::osoption, DefaultSolver::osresult, DefaultSolver::osrl, osrlwriter, Bonmin::BabSetupBase::readOptionsString(), OSoLReader::readOSoL(), Bonmin::BabSetupBase::roptions(), OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), tminlp, OtherVariableResultStruct::value, and OSrLWriter::writeOSrL().
Referenced by solve().
void BonminSolver::dataEchoCheck | ( | ) |
use this for debugging, print out the instance that the solver thinks it has and compare this with the OSiL file
Definition at line 932 of file OSBonminSolver.cpp.
References QuadraticTerms::coefficients, OSInstance::getConstraintLowerBounds(), OSInstance::getConstraintNames(), OSInstance::getConstraintNumber(), OSInstance::getConstraintUpperBounds(), OSInstance::getDenseObjectiveCoefficients(), OSInstance::getInstanceDescription(), OSInstance::getInstanceName(), OSInstance::getInstanceSource(), OSInstance::getLinearConstraintCoefficientNumber(), OSInstance::getLinearConstraintCoefficientsInColumnMajor(), OSInstance::getNumberOfQuadraticTerms(), OSInstance::getObjectiveMaxOrMins(), OSInstance::getQuadraticTerms(), OSInstance::getVariableLowerBounds(), OSInstance::getVariableNames(), OSInstance::getVariableNumber(), OSInstance::getVariableTypes(), OSInstance::getVariableUpperBounds(), SparseMatrix::indexes, OSInstance::instanceData, Objectives::numberOfObjectives, Objectives::obj, InstanceData::objectives, DefaultSolver::osinstance, QuadraticTerms::rowIndexes, SparseMatrix::starts, SparseMatrix::values, QuadraticTerms::varOneIndexes, and QuadraticTerms::varTwoIndexes.
void BonminSolver::writeResult | ( | ) |
use this to write the solution information to an OSResult object
Definition at line 818 of file OSBonminSolver.cpp.
References bb, Bonmin::Bab::bestSolution(), OSInstance::calculateAllObjectiveFunctionValues(), ErrorClass::errormsg, OSInstance::getConstraintNumber(), OSInstance::getInstanceName(), OSInstance::getVariableNumber(), Bonmin::Bab::model(), DefaultSolver::osinstance, DefaultSolver::osresult, DefaultSolver::osrl, osrlwriter, OSResult::setConstraintNumber(), OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), OSResult::setInstanceName(), OSResult::setObjectiveNumber(), OSResult::setObjectiveValuesDense(), OSResult::setPrimalVariableValuesDense(), OSResult::setServiceName(), OSResult::setSolutionNumber(), OSResult::setSolutionStatus(), OSResult::setVariableNumber(), status, OSrLWriter::writeOSrL(), and x.
Referenced by solve().
SmartPtr<BonminProblem> BonminSolver::tminlp |
Definition at line 262 of file OSBonminSolver.h.
Referenced by buildSolverInstance(), setSolverOptions(), and solve().
m_osilreader is an OSiLReader object used to create an osinstance from an osil string if needed
Definition at line 299 of file OSBonminSolver.h.
Referenced by BonminSolver(), buildSolverInstance(), and ~BonminSolver().
m_osolreader is an OSoLReader object used to create an osoption from an osol string if needed
Definition at line 305 of file OSBonminSolver.h.
Referenced by BonminSolver(), setSolverOptions(), and ~BonminSolver().
OSrLWriter* BonminSolver::osrlwriter [private] |
Definition at line 317 of file OSBonminSolver.h.
Referenced by BonminSolver(), buildSolverInstance(), setSolverOptions(), solve(), writeResult(), and ~BonminSolver().
BonminSetup BonminSolver::bonminSetup [private] |
std::string BonminSolver::bonminErrorMsg [private] |