OS  2.10.1
OSCouenneSolver.h
Go to the documentation of this file.
1 /* $Id: OSCouenneSolver.h 4951 2015-02-06 22:04:27Z Gassmann $ */
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 
72  CouenneSolver();
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 
120  Ipopt::SmartPtr<BonminProblem> tminlp;
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 
129  Bonmin::TMINLP::SolverReturn status;
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*/
Ipopt::SmartPtr< Bonmin::TNLPSolver > app_
Couenne::expression * con_body
used for throwing exceptions.
Definition: OSErrorClass.h:31
void writeResult()
use this to write the solution information to an OSResult object
Couenne::CouenneProblem * couenne
virtual void solve()
solve results in an instance being read into the Couenne data structrues and optimized
Take an OSResult object and write a string that validates against OSrL.
Definition: OSrLWriter.h:30
Ipopt::SmartPtr< BonminProblem > tminlp
virtual void buildSolverInstance()
buildSolverInstance is a virtual function – the actual solvers will implement their own buildSolverIn...
Used to read an OSiL string.
Definition: OSiLReader.h:37
OSoLReader * m_osolreader
m_osolreader is an OSoLReader object used to create an osoption from an osol string if needed
Couenne::expression * obj_body
Bonmin::TMINLP::SolverReturn status
Used to read an OSoL string.
Definition: OSoLReader.h:37
~CouenneSolver()
the IpoptSolver class destructor
This file defines the OSInstance class along with its supporting classes.
CouenneSolver()
the CouenneSolver class constructor
This file defines the OSnLNode class along with its derived classes.
Couenne::CouenneBab bb
The CouenneSolver class solves problems using Ipopt.
The Default Solver Class.
void dataEchoCheck()
use this for debugging, print out the instance that the solver thinks it has and compare this with th...
OSiLReader * m_osilreader
m_osilreader is an OSiLReader object used to create an osinstance from an osil string if needed
virtual void setSolverOptions()
The implementation of the virtual functions.
The OSnLNode Class for nonlinear expressions.
Definition: OSnLNode.h:179