CouenneSolver Class Reference

The CouenneSolver class solves problems using Ipopt. More...

#include <OSCouenneSolver.h>

Inheritance diagram for CouenneSolver:

Inheritance graph
[legend]
Collaboration diagram for CouenneSolver:

Collaboration graph
[legend]
List of all members.

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

OSiLReaderm_osilreader
 m_osilreader is an OSiLReader object used to create an osinstance from an osil string if needed
OSoLReaderm_osolreader
 m_osolreader is an OSoLReader object used to create an osoption from an osol string if needed
Couenne::CouenneProblemcouenne
Ipopt::SmartPtr< BonminProblemtminlp
Ipopt::SmartPtr< Bonmin::TNLPSolverapp_
Bonmin::Bab bb
Bonmin::TMINLP::SolverReturn status
Couenne::expressioncon_body
Couenne::expressionobj_body

Private Member Functions

Couenne::expressioncreateCouenneExpression (OSnLNode *node)

Private Attributes

OSrLWriterosrlwriter
Couenne::CouenneSetup couenneSetup
std::string couenneErrorMsg

Detailed Description

The CouenneSolver class solves problems using Ipopt.

Author:
Jun Ma, Guss Gassmann, Kipp Martin
Version:
1.0, 07/05/2008
Since:
OS 1.0
Remarks:
this class takes an OSiL instance and optimizes it using the COIN-OR Ipopt solver

Definition at line 61 of file OSCouenneSolver.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Returns:
void.

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().


Member Data Documentation

OSiLReader* CouenneSolver::m_osilreader

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().

OSoLReader* CouenneSolver::m_osolreader

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().

Couenne::CouenneProblem* CouenneSolver::couenne

Definition at line 112 of file OSCouenneSolver.h.

Referenced by buildSolverInstance(), CouenneSolver(), createCouenneExpression(), solve(), and ~CouenneSolver().

Ipopt::SmartPtr<BonminProblem> CouenneSolver::tminlp

Definition at line 114 of file OSCouenneSolver.h.

Referenced by solve().

Ipopt::SmartPtr<Bonmin::TNLPSolver> CouenneSolver::app_

Definition at line 116 of file OSCouenneSolver.h.

Referenced by solve().

Bonmin::Bab CouenneSolver::bb

Definition at line 121 of file OSCouenneSolver.h.

Referenced by solve(), and writeResult().

Bonmin::TMINLP::SolverReturn CouenneSolver::status

Definition at line 123 of file OSCouenneSolver.h.

Referenced by solve(), and writeResult().

Couenne::expression* CouenneSolver::con_body

Definition at line 125 of file OSCouenneSolver.h.

Referenced by buildSolverInstance(), CouenneSolver(), and ~CouenneSolver().

Couenne::expression* CouenneSolver::obj_body

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().

Couenne::CouenneSetup CouenneSolver::couenneSetup [private]

Definition at line 131 of file OSCouenneSolver.h.

Referenced by setSolverOptions(), and solve().

std::string CouenneSolver::couenneErrorMsg [private]

Definition at line 132 of file OSCouenneSolver.h.

Referenced by CouenneSolver().


The documentation for this class was generated from the following files:
Generated on Thu Sep 22 03:12:58 2011 by  doxygen 1.4.7