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

- File List
- File Members

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

Go to the documentation of this file.

    00001 /* $Id: OSCouenneSolver.h 4120 2011-03-30 06:28:16Z kmartin $ */
    00017 #ifndef COUENNESOLVER_H
    00018 #define COUENNESOLVER_H
    00019
    00020 #include "OSConfig.h"
    00021 #include "OSDefaultSolver.h"
    00022 #include "OSBonminSolver.h"
    00023 #include "OSIpoptSolver.h"
    00024 #include "OSrLWriter.h"
    00025 #include "OSInstance.h"
    00026 #include "OSParameters.h"
    00027 #include "OSiLReader.h"
    00028 #include "OSExpressionTree.h"
    00029 #include "OSnLNode.h"
    00030 #include "OSDataStructures.h"
    00031 #include "OSFileUtil.h"
    00032 #include "OSErrorClass.h"
    00033 #include "OSResult.h"
    00034 #include "OSOption.h"
    00035
    00036
    00037 //#include "BonIpoptSolver.hpp"
    00038
    00039 //Couenne stuff
    00040 #include "CouenneConfig.h"
    00041 #ifdef COUENNE_VERSION_MAJOR
    00042 #define COUENNE_NEW
    00043 #endif
    00044 //#include "CouenneProblem.hpp"
    00045 #ifdef COUENNE_NEW
    00046 namespace Couenne {
    00047 #endif
    00048 class CouenneProblem;
    00049 class expression;
    00050 #ifdef COUENNE_NEW
    00051 }
    00052 #endif
    00053 #include "BonCbc.hpp"
    00054 #include "BonCouenneSetup.hpp"
    00055
    00056 #ifdef HAVE_CTIME
    00057 # include <ctime>
    00058 #else
    00059 # ifdef HAVE_TIME_H
    00060 #  include <time.h>
    00061 # else
    00062 #  error "don't have header file for time"
    00063 # endif
    00064 #endif
    00065
    00066
    00067 #ifdef HAVE_CMATH
    00068 # include <cmath>
    00069 #else
    00070 # ifdef HAVE_MATH_H
    00071 #  include <math.h>
    00072 # else
    00073 #  error "don't have header file for math"
    00074 # endif
    00075 #endif
    00076 #include<vector>
    00077 #include <map>
    00078
    00079
    00080
    00081
    00082
    00083
    00097 using namespace Bonmin;
    00098 class CouenneSolver : public DefaultSolver{
    00099 public:
    00100
    00102         CouenneSolver();
    00103
    00105         ~CouenneSolver();
    00106
    00109         virtual void  solve() throw (ErrorClass) ;
    00110
    00115         virtual void  buildSolverInstance() throw(ErrorClass);
    00116
    00121         virtual void  setSolverOptions() throw(ErrorClass);
    00122
    00128         void dataEchoCheck();
    00129
    00134         void writeResult();
    00135
    00140         OSiLReader *m_osilreader;
    00141
    00146         OSoLReader *m_osolreader;
    00147
    00148 #ifdef COUENNE_NEW
    00149         Couenne::CouenneProblem *couenne;
    00150 #else
    00151         CouenneProblem *couenne;
    00152 #endif
    00153
    00154         //Ipopt::SmartPtr<TMINLP> tminlp;
    00155         SmartPtr<BonminProblem> tminlp;
    00156
    00157         Ipopt::SmartPtr<TNLPSolver> app_ ;
    00158
    00159         //SmartPtr<Bonmin::IpoptSolver> app_ ;
    00160
    00161         // this is a Bonmin BonCbc object;
    00162         Bab bb;
    00163
    00164         TMINLP::SolverReturn status;
    00165
    00166 #ifdef COUENNE_NEW
    00167         Couenne::expression *con_body;
    00168         Couenne::expression *obj_body;
    00169 #else
    00170         expression *con_body;
    00171         expression *obj_body;
    00172 #endif
    00173
    00174 private:
    00175         OSrLWriter  *osrlwriter;
    00176
    00177 #ifdef COUENNE_NEW
    00178         Couenne::CouenneSetup couenneSetup;
    00179 #else
    00180         CouenneSetup couenneSetup;
    00181 #endif
    00182         std::string couenneErrorMsg;
    00183
    00184 #ifdef COUENNE_NEW
    00185         Couenne::expression* createCouenneExpression(OSnLNode* node);
    00186 #else
    00187         expression* createCouenneExpression(OSnLNode* node);
    00188 #endif
    00189 };
    00190
    00191
    00192 #endif /*COUENNESOLVER_H*/