OS  2.10.2
OSCouenneSolver.h
Go to the documentation of this file.
1 /* $Id: OSCouenneSolver.h 5284 2017-12-08 13:52:50Z stefan $ */
15 #ifndef COUENNESOLVER_H
16 #define COUENNESOLVER_H
17 
18 #include "OSConfig.h"
19 #include "OSDefaultSolver.h"
20 #include "OSBonminSolver.h"
21 #include "OSIpoptSolver.h"
22 #include "OSrLWriter.h"
23 #include "OSInstance.h"
24 #include "OSParameters.h"
25 #include "OSiLReader.h"
26 #include "OSExpressionTree.h"
27 #include "OSnLNode.h"
28 #include "OSDataStructures.h"
29 #include "OSFileUtil.h"
30 #include "OSErrorClass.h"
31 #include "OSResult.h"
32 #include "OSOption.h"
33 
34 #ifdef OS_HAS_CPPAD
35 # include <cppad/cppad.hpp>
36 #endif
37 
38 
39 //Couenne stuff
40 namespace Couenne
41 {
42 class CouenneProblem;
43 class expression;
44 }
45 #include "BonCbc.hpp"
46 #include "BonCouenneSetup.hpp"
47 #include "CouenneBab.hpp"
48 
49 #include <vector>
50 #include <map>
51 
52 
53 
68 {
69 public:
70 
73 
76 
79  virtual void solve() throw (ErrorClass) ;
80 
85  virtual void buildSolverInstance() throw(ErrorClass);
86 
91  virtual void setSolverOptions() throw(ErrorClass);
92 
98  void dataEchoCheck();
99 
104  void writeResult();
105 
111 
117 
118  Couenne::CouenneProblem *couenne;
119 
121 
122  Ipopt::SmartPtr<Bonmin::TNLPSolver> app_ ;
123 
124  //SmartPtr<Bonmin::IpoptSolver> app_ ;
125 
126  // this is a Bonmin BonCbc object;
127  Couenne::CouenneBab bb;
128 
130 
131  Couenne::expression *con_body;
132  Couenne::expression *obj_body;
133 
134 private:
135  OSrLWriter *osrlwriter;
136 
137  Couenne::CouenneSetup couenneSetup;
138  std::string couenneErrorMsg;
139 
140  Couenne::expression* createCouenneExpression(OSnLNode* node);
141 };
142 
143 
144 #endif /*COUENNESOLVER_H*/
This file defines the OSInstance class along with its supporting classes.
This file defines the OSnLNode class along with its derived classes.
The CouenneSolver class solves problems using Ipopt.
Bonmin::TMINLP::SolverReturn status
virtual void solve()
solve results in an instance being read into the Couenne data structrues and optimized
virtual void setSolverOptions()
The implementation of the virtual functions.
void writeResult()
use this to write the solution information to an OSResult object
void dataEchoCheck()
use this for debugging, print out the instance that the solver thinks it has and compare this with th...
~CouenneSolver()
the IpoptSolver class destructor
Couenne::expression * obj_body
virtual void buildSolverInstance()
buildSolverInstance is a virtual function – the actual solvers will implement their own buildSolverIn...
Couenne::CouenneBab bb
OSoLReader * m_osolreader
m_osolreader is an OSoLReader object used to create an osoption from an osol string if needed
Ipopt::SmartPtr< Bonmin::TNLPSolver > app_
CouenneSolver()
the CouenneSolver class constructor
Couenne::CouenneProblem * couenne
Couenne::expression * con_body
OSiLReader * m_osilreader
m_osilreader is an OSiLReader object used to create an osinstance from an osil string if needed
Ipopt::SmartPtr< BonminProblem > tminlp
The Default Solver Class.
used for throwing exceptions.
Definition: OSErrorClass.h:32
Used to read an OSiL string.
Definition: OSiLReader.h:38
The OSnLNode Class for nonlinear expressions.
Definition: OSnLNode.h:180
Used to read an OSoL string.
Definition: OSoLReader.h:38
Take an OSResult object and write a string that validates against OSrL.
Definition: OSrLWriter.h:31
SolverReturn