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

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

# BonminSolver Class Reference

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

`#include <OSBonminSolver.h>`

Inheritance diagram for BonminSolver:

[legend]
Collaboration diagram for BonminSolver:

[legend]
List of all members.

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

## Detailed Description

The BonminSolver 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 248 of file OSBonminSolver.h.

## Constructor & Destructor Documentation

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.

## Member Function Documentation

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 729 of file OSBonminSolver.cpp.

References bb, bonminSetup, buildSolverInstance(), ErrorClass::errormsg, OSInstance::getConstraintNumber(), OSInstance::getInstanceName(), OSInstance::getNumberOfBinaryVariables(), OSInstance::getNumberOfIntegerVariables(), OSInstance::getVariableNumber(), DefaultSolver::osinstance, DefaultSolver::osresult, DefaultSolver::osrl, osrlwriter, OSResult::setConstraintNumber(), OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), OSResult::setInstanceName(), OSResult::setObjectiveNumber(), OSResult::setServiceName(), OSResult::setSolutionMessage(), 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 591 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.

Returns:
  void.

Implements DefaultSolver.

Definition at line 616 of file OSBonminSolver.cpp.

References bonminSetup, DefaultSolver::bSetSolverOptions, ErrorClass::errormsg, OSOption::getNumberOfSolverOptions(), OSOption::getSolverOptions(), m_osolreader, OtherVariableResultStruct::name, os_strtod(), DefaultSolver::osol, DefaultSolver::osoption, DefaultSolver::osresult, DefaultSolver::osrl, osrlwriter, OSoLReader::readOSoL(), 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 957 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 832 of file OSBonminSolver.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::setSolutionMessage(), OSResult::setSolutionNumber(), OSResult::setSolutionStatus(), OSResult::setSolverInvoked(), OSResult::setVariableNumber(), status, and OSrLWriter::writeOSrL().

Referenced by solve().

## Member Data Documentation

SmartPtr<BonminProblem> BonminSolver::tminlp

Definition at line 261 of file OSBonminSolver.h.

Referenced by buildSolverInstance(), setSolverOptions(), and solve().

Bab BonminSolver::bb

Definition at line 264 of file OSBonminSolver.h.

Referenced by solve(), and writeResult().

TMINLP::SolverReturn BonminSolver::status

Definition at line 266 of file OSBonminSolver.h.

Referenced by solve(), and writeResult().

OSiLReader* BonminSolver::m_osilreader

m_osilreader is an OSiLReader object used to create an osinstance from an osil string if needed

Definition at line 298 of file OSBonminSolver.h.

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

OSoLReader* BonminSolver::m_osolreader

m_osolreader is an OSoLReader object used to create an osoption from an osol string if needed

Definition at line 304 of file OSBonminSolver.h.

Referenced by BonminSolver(), setSolverOptions(), and ~BonminSolver().

OSrLWriter* BonminSolver::osrlwriter`[private]`

Definition at line 316 of file OSBonminSolver.h.

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

BonminSetup BonminSolver::bonminSetup`[private]`

Definition at line 318 of file OSBonminSolver.h.

Referenced by setSolverOptions(), and solve().

std::string BonminSolver::bonminErrorMsg`[private]`

Definition at line 320 of file OSBonminSolver.h.

Referenced by BonminSolver().

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

- /home/coin/SVN-release/OS-2.3.5/OS/src/OSSolverInterfaces/OSBonminSolver.h
- /home/coin/SVN-release/OS-2.3.5/OS/src/OSSolverInterfaces/OSBonminSolver.cpp
- /home/coin/SVN-release/OS-2.3.5/OS/v2.0/OSBonminSolver.cpp