- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# CouenneSolver Class Reference

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

`#include <OSCouenneSolver.h>`

Inheritance diagram for CouenneSolver:

[legend]
Collaboration diagram for CouenneSolver:

[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 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

## 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 98 of file OSCouenneSolver.h.

## Constructor & Destructor Documentation

CouenneSolver::CouenneSolver | ( |  | ) |

the CouenneSolver class constructor

Definition at line 118 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 130 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 533 of file OSCouenneSolver.cpp.

References app_, bb, buildSolverInstance(), couenne, couenneSetup, ErrorClass::errormsg, OSInstance::getConstraintNumber(), OSInstance::getInstanceName(), OSInstance::getNumberOfBinaryVariables(), OSInstance::getNumberOfIntegerVariables(), OSInstance::getVariableNumber(), m_osolreader, DefaultSolver::osinstance, DefaultSolver::osol, DefaultSolver::osoption, DefaultSolver::osresult, DefaultSolver::osrl, osrlwriter, OSoLReader::readOSoL(), 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 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 167 of file OSCouenneSolver.cpp.

References DefaultSolver::bCallbuildSolverInstance, con_body, couenne, createCouenneExpression(), 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, OSiLReader::readOSiL(), OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), SparseMatrix::starts, SparseMatrix::values, SparseVector::values, 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 453 of file OSCouenneSolver.cpp.

References DefaultSolver::bSetSolverOptions, couenneSetup, ErrorClass::errormsg, OSOption::getNumberOfSolverOptions(), OSOption::getSolverOptions(), m_osolreader, 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 726 of file OSCouenneSolver.cpp.

References bb, OSInstance::calculateAllObjectiveFunctionValues(), ErrorClass::errormsg, OSInstance::getConstraintNumber(), OSInstance::getInstanceName(), OSInstance::getObjectiveNumber(), OSInstance::getVariableNumber(), getVersionInfo(), 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, and OSrLWriter::writeOSrL().

Referenced by solve().

expression * CouenneSolver::createCouenneExpression | ( | OSnLNode * | node | ) | `[private]`

Definition at line 327 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, and OS_VARIABLE.

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 140 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 146 of file OSCouenneSolver.h.

Referenced by CouenneSolver(), setSolverOptions(), solve(), and ~CouenneSolver().

CouenneProblem* CouenneSolver::couenne

Definition at line 151 of file OSCouenneSolver.h.

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

SmartPtr<BonminProblem> CouenneSolver::tminlp

Definition at line 155 of file OSCouenneSolver.h.

Referenced by solve().

Ipopt::SmartPtr<TNLPSolver> CouenneSolver::app_

Definition at line 157 of file OSCouenneSolver.h.

Referenced by solve().

Bab CouenneSolver::bb

Definition at line 162 of file OSCouenneSolver.h.

Referenced by solve(), and writeResult().

TMINLP::SolverReturn CouenneSolver::status

Definition at line 164 of file OSCouenneSolver.h.

Referenced by solve(), and writeResult().

expression* CouenneSolver::con_body

Definition at line 170 of file OSCouenneSolver.h.

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

expression* CouenneSolver::obj_body

Definition at line 171 of file OSCouenneSolver.h.

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

OSrLWriter* CouenneSolver::osrlwriter`[private]`

Definition at line 175 of file OSCouenneSolver.h.

Referenced by buildSolverInstance(), CouenneSolver(), setSolverOptions(), solve(), writeResult(), and ~CouenneSolver().

CouenneSetup CouenneSolver::couenneSetup`[private]`

Definition at line 180 of file OSCouenneSolver.h.

Referenced by setSolverOptions(), and solve().

std::string CouenneSolver::couenneErrorMsg`[private]`

Definition at line 182 of file OSCouenneSolver.h.

Referenced by CouenneSolver().

The documentation for this class was generated from the following files:

- /home/coin/SVN-release/OS-2.3.5/OS/src/OSSolverInterfaces/OSCouenneSolver.h
- /home/coin/SVN-release/OS-2.3.5/OS/src/OSSolverInterfaces/OSCouenneSolver.cpp