#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 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 | |
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 | |
CouenneProblem * | couenne |
SmartPtr< BonminProblem > | tminlp |
Ipopt::SmartPtr< TNLPSolver > | app_ |
Bab | bb |
TMINLP::SolverReturn | status |
expression * | con_body |
expression * | obj_body |
Private Member Functions | |
expression * | createCouenneExpression (OSnLNode *node) |
Private Attributes | |
OSrLWriter * | osrlwriter |
CouenneSetup | couenneSetup |
std::string | couenneErrorMsg |
Definition at line 88 of file OSCouenneSolver.h.
CouenneSolver::CouenneSolver | ( | ) |
the CouenneSolver class constructor
Definition at line 96 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 506 of file OSCouenneSolver.cpp.
References app_, bb, buildSolverInstance(), couenne, couenneSetup, ErrorClass::errormsg, OSInstance::getConstraintNumber(), OSInstance::getInstanceName(), OSInstance::getNumberOfBinaryVariables(), OSInstance::getNumberOfIntegerVariables(), OSInstance::getVariableNumber(), Bonmin::OsiTMINLPInterface::initialize(), Bonmin::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 solve method -- the solver instance is the instance the individual solver sees in its api
Implements DefaultSolver.
Definition at line 145 of file OSCouenneSolver.cpp.
References CouenneProblem::addEQConstraint(), CouenneProblem::addGEConstraint(), CouenneProblem::addLEConstraint(), CouenneProblem::addObjective(), CouenneProblem::addRNGConstraint(), CouenneProblem::addVariable(), DefaultSolver::bCallbuildSolverInstance, con_body, couenne, createCouenneExpression(), 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, Domain::push(), OSiLReader::readOSiL(), OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), SparseMatrix::starts, SparseMatrix::values, SparseVector::values, 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 426 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 699 of file OSCouenneSolver.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().
expression * CouenneSolver::createCouenneExpression | ( | OSnLNode * | node | ) | [private] |
Definition at line 300 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 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 130 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 136 of file OSCouenneSolver.h.
Referenced by CouenneSolver(), setSolverOptions(), solve(), and ~CouenneSolver().
Definition at line 138 of file OSCouenneSolver.h.
Referenced by buildSolverInstance(), CouenneSolver(), createCouenneExpression(), solve(), and ~CouenneSolver().
SmartPtr<BonminProblem> CouenneSolver::tminlp |
Ipopt::SmartPtr<TNLPSolver> CouenneSolver::app_ |
Definition at line 152 of file OSCouenneSolver.h.
Referenced by buildSolverInstance(), CouenneSolver(), and ~CouenneSolver().
Definition at line 153 of file OSCouenneSolver.h.
Referenced by buildSolverInstance(), CouenneSolver(), and ~CouenneSolver().
OSrLWriter* CouenneSolver::osrlwriter [private] |
Definition at line 157 of file OSCouenneSolver.h.
Referenced by buildSolverInstance(), CouenneSolver(), setSolverOptions(), solve(), writeResult(), and ~CouenneSolver().
CouenneSetup CouenneSolver::couenneSetup [private] |
std::string CouenneSolver::couenneErrorMsg [private] |