#include <OSCouenneSolver.h>
Inheritance diagram for CouenneSolver:
Public Member Functions | |
CouenneSolver () | |
the CouenneSolver class constructor | |
~CouenneSolver () | |
the IpoptSolver class destructor | |
virtual void | solve () throw (ErrorClass) |
solve results in an instance being read into the Couenne data structrues and optimized | |
virtual void | buildSolverInstance () throw (ErrorClass) |
buildSolverInstance is a virtual function -- the actual solvers will implement their own buildSolverInstance 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 | |
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 | |
Couenne::CouenneProblem * | couenne |
Ipopt::SmartPtr< BonminProblem > | tminlp |
Ipopt::SmartPtr< Bonmin::TNLPSolver > | app_ |
Bonmin::Bab | bb |
Bonmin::TMINLP::SolverReturn | status |
Couenne::expression * | con_body |
Couenne::expression * | obj_body |
Private Member Functions | |
Couenne::expression * | createCouenneExpression (OSnLNode *node) |
Private Attributes | |
OSrLWriter * | osrlwriter |
Couenne::CouenneSetup | couenneSetup |
std::string | couenneErrorMsg |
Definition at line 61 of file OSCouenneSolver.h.
CouenneSolver::CouenneSolver | ( | ) |
the CouenneSolver class constructor
Definition at line 95 of file OSCouenneSolver.cpp.
References con_body, couenne, couenneErrorMsg, m_osilreader, m_osolreader, obj_body, DefaultSolver::osresult, and osrlwriter.
CouenneSolver::~CouenneSolver | ( | ) |
the IpoptSolver class destructor
delete couenne;
Definition at line 108 of file OSCouenneSolver.cpp.
References con_body, couenne, m_osilreader, m_osolreader, obj_body, DefaultSolver::osresult, and osrlwriter.
void CouenneSolver::solve | ( | ) | throw (ErrorClass) [virtual] |
solve results in an instance being read into the Couenne data structrues and optimized
Implements DefaultSolver.
Definition at line 569 of file OSCouenneSolver.cpp.
References app_, bb, buildSolverInstance(), couenne, couenneSetup, ErrorClass::errormsg, OSInstance::getConstraintNumber(), OSInstance::getInstanceName(), OSInstance::getNumberOfBinaryVariables(), OSInstance::getNumberOfIntegerVariables(), OSInstance::getVariableNumber(), infeasible, Bonmin::OsiTMINLPInterface::initialize(), Couenne::CouenneSetup::InitializeCouenne(), Bonmin::OsiTMINLPInterface::isProvenPrimalInfeasible(), Bonmin::BabSetupBase::journalist(), m_osolreader, Bonmin::Bab::model(), Bonmin::BabSetupBase::options(), DefaultSolver::osinstance, DefaultSolver::osol, DefaultSolver::osoption, DefaultSolver::osresult, DefaultSolver::osrl, osrlwriter, Bonmin::TNLPSolver::UnsolvedError::printError(), OSoLReader::readOSoL(), Bonmin::BabSetupBase::roptions(), OSResult::setConstraintNumber(), OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), OSResult::setInstanceName(), Bonmin::OsiTMINLPInterface::setModel(), OSResult::setObjectiveNumber(), OSResult::setServiceName(), OSResult::setSolutionNumber(), OSResult::setSolutionStatus(), Bonmin::OsiTMINLPInterface::setSolver(), setSolverOptions(), Bonmin::Bab::setUsingCouenne(), OSResult::setVariableNumber(), status, tminlp, Bonmin::TNLPSolver::UnsolvedError::writeDiffFiles(), OSrLWriter::writeOSrL(), and writeResult().
void CouenneSolver::buildSolverInstance | ( | ) | throw (ErrorClass) [virtual] |
buildSolverInstance is a virtual function -- the actual solvers will implement their own buildSolverInstance method -- the solver instance is the instance the individual solver sees in its API
Implements DefaultSolver.
Definition at line 150 of file OSCouenneSolver.cpp.
References Couenne::CouenneProblem::addEQConstraint(), Couenne::CouenneProblem::addGEConstraint(), Couenne::CouenneProblem::addLEConstraint(), Couenne::CouenneProblem::addObjective(), Couenne::CouenneProblem::addRNGConstraint(), Couenne::CouenneProblem::addVariable(), DefaultSolver::bCallbuildSolverInstance, con_body, couenne, createCouenneExpression(), Couenne::CouenneProblem::domain(), ErrorClass::errormsg, OSInstance::getConstraintLowerBounds(), OSInstance::getConstraintNumber(), OSInstance::getConstraintUpperBounds(), OSInstance::getLinearConstraintCoefficientsInRowMajor(), OSInstance::getNonlinearExpressionTree(), OSInstance::getObjectiveCoefficients(), OSInstance::getObjectiveConstants(), OSInstance::getObjectiveMaxOrMins(), OSInstance::getObjectiveNumber(), OSInstance::getVariableLowerBounds(), OSInstance::getVariableNumber(), OSInstance::getVariableTypes(), OSInstance::getVariableUpperBounds(), SparseMatrix::indexes, SparseVector::indexes, OSInstance::initForAlgDiff(), m_osilreader, OSExpressionTree::m_treeRoot, SparseVector::number, obj_body, OSDBL_MAX, DefaultSolver::osil, DefaultSolver::osinstance, DefaultSolver::osresult, DefaultSolver::osrl, osrlwriter, Couenne::Domain::push(), OSiLReader::readOSiL(), OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), SparseMatrix::starts, SparseMatrix::values, SparseVector::values, Couenne::CouenneProblem::Var(), and OSrLWriter::writeOSrL().
Referenced by solve().
void CouenneSolver::setSolverOptions | ( | ) | throw (ErrorClass) [virtual] |
The implementation of the virtual functions.
Implements DefaultSolver.
Definition at line 466 of file OSCouenneSolver.cpp.
References DefaultSolver::bSetSolverOptions, couenneSetup, ErrorClass::errormsg, OSOption::getNumberOfSolverOptions(), OSOption::getSolverOptions(), Bonmin::BabSetupBase::initializeOptionsAndJournalist(), m_osolreader, Bonmin::BabSetupBase::options(), os_strtod(), DefaultSolver::osol, DefaultSolver::osoption, DefaultSolver::osresult, DefaultSolver::osrl, osrlwriter, OSoLReader::readOSoL(), OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), and OSrLWriter::writeOSrL().
Referenced by solve().
void CouenneSolver::dataEchoCheck | ( | ) |
use this for debugging, print out the instance that the solver thinks it has and compare this with the OSiL file
void CouenneSolver::writeResult | ( | ) |
use this to write the solution information to an OSResult object
Definition at line 772 of file OSCouenneSolver.cpp.
References bb, Bonmin::Bab::bestSolution(), OSInstance::calculateAllObjectiveFunctionValues(), ErrorClass::errormsg, OSInstance::getConstraintNumber(), OSInstance::getInstanceName(), OSInstance::getObjectiveNumber(), OSInstance::getVariableNumber(), Bonmin::Bab::model(), OSgetVersionInfo(), 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::setSolverInvoked(), OSResult::setVariableNumber(), status, OSrLWriter::writeOSrL(), and x.
Referenced by solve().
expression * CouenneSolver::createCouenneExpression | ( | OSnLNode * | node | ) | [private] |
Definition at line 333 of file OSCouenneSolver.cpp.
References OSnLNodeVariable::coef, couenne, OSnLNodeVariable::idx, OSnLNode::inodeInt, OSnLNode::inumberOfChildren, OSnLNode::m_mChildren, OS_ABS, OS_COS, OS_DIVIDE, OS_EXP, OS_LN, OS_MAX, OS_MIN, OS_MINUS, OS_NEGATE, OS_NUMBER, OS_PI, OS_PLUS, OS_POWER, OS_PRODUCT, OS_SIN, OS_SQRT, OS_SQUARE, OS_SUM, OS_TIMES, OS_VARIABLE, and Couenne::CouenneProblem::Variables().
Referenced by buildSolverInstance().
m_osilreader is an OSiLReader object used to create an osinstance from an osil string if needed
Definition at line 104 of file OSCouenneSolver.h.
Referenced by buildSolverInstance(), CouenneSolver(), and ~CouenneSolver().
m_osolreader is an OSoLReader object used to create an osoption from an osol string if needed
Definition at line 110 of file OSCouenneSolver.h.
Referenced by CouenneSolver(), setSolverOptions(), solve(), and ~CouenneSolver().
Definition at line 112 of file OSCouenneSolver.h.
Referenced by buildSolverInstance(), CouenneSolver(), createCouenneExpression(), solve(), and ~CouenneSolver().
Ipopt::SmartPtr<BonminProblem> CouenneSolver::tminlp |
Ipopt::SmartPtr<Bonmin::TNLPSolver> CouenneSolver::app_ |
Definition at line 125 of file OSCouenneSolver.h.
Referenced by buildSolverInstance(), CouenneSolver(), and ~CouenneSolver().
Definition at line 126 of file OSCouenneSolver.h.
Referenced by buildSolverInstance(), CouenneSolver(), and ~CouenneSolver().
OSrLWriter* CouenneSolver::osrlwriter [private] |
Definition at line 129 of file OSCouenneSolver.h.
Referenced by buildSolverInstance(), CouenneSolver(), setSolverOptions(), solve(), writeResult(), and ~CouenneSolver().
std::string CouenneSolver::couenneErrorMsg [private] |