00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef CouenneFeasPump_HPP
00013 #define CouenneFeasPump_HPP
00014
00015 #include <queue>
00016
00017 #include "CouenneTypes.hpp"
00018 #include "CbcHeuristic.hpp"
00019
00020 #include "CouenneConfig.h"
00021
00022 #include "CouenneFPpool.hpp"
00023
00024 #include "IpOptionsList.hpp"
00025
00026 struct Scip;
00027 class OsiSolverInterface;
00028
00029 namespace Ipopt {
00030 class IpoptApplication;
00031 }
00032
00033 namespace Bonmin {
00034 class RegisteredOptions;
00035 }
00036
00037 namespace Couenne {
00038
00039 class expression;
00040 class CouenneProblem;
00041 class CouenneCutGenerator;
00042 class CouenneTNLP;
00043 class CouenneSparseMatrix;
00044
00047
00048 class CouenneFeasPump: public CbcHeuristic {
00049
00050 public:
00051
00052 enum fpCompDistIntType {FP_DIST_INT, FP_DIST_ALL, FP_DIST_POST};
00053 enum fpCutPlane {FP_CUT_NONE, FP_CUT_INTEGRATED, FP_CUT_EXTERNAL, FP_CUT_POST};
00054 enum fpTabuMgtPolicy {FP_TABU_NONE, FP_TABU_POOL, FP_TABU_PERTURB, FP_TABU_CUT};
00055
00057 CouenneFeasPump (CouenneProblem *couenne = NULL,
00058 CouenneCutGenerator *cg = NULL,
00059 Ipopt::SmartPtr<Ipopt::OptionsList> options = NULL);
00060
00062 CouenneFeasPump (const CouenneFeasPump &other);
00063
00065 virtual ~CouenneFeasPump();
00066
00068 virtual CbcHeuristic *clone () const;
00069
00071 CouenneFeasPump &operator= (const CouenneFeasPump &rhs);
00072
00074 virtual void resetModel (CbcModel *model) {}
00075
00083 virtual int solution (double &objectiveValue, double *newSolution);
00084
00086 void setNumberSolvePerLevel (int value)
00087 {numberSolvePerLevel_ = value;}
00088
00089 #ifdef COIN_HAS_SCIP
00091 void checkInfinity (struct Scip *scip, double val, double infinity);
00092 #endif
00093
00097 CouNumber solveMILP (CouNumber *nSol, CouNumber *&iSol, int niter, int* nsuciter);
00098
00100 CouNumber solveNLP (CouNumber *nSol, CouNumber *&iSol);
00101
00105 expression *updateNLPObj (const double *);
00106
00109 void fixIntVariables (double *sol);
00110
00112 static void registerOptions (Ipopt::SmartPtr <Bonmin::RegisteredOptions>);
00113
00115 double findSolution (double *&sol, int niter, int* nsuciter);
00116
00119 void init_MILP ();
00120
00122 void initIpoptApp ();
00123
00125 CouenneProblem *Problem () const
00126 {return problem_;}
00127
00129 enum fpCompDistIntType compDistInt () const
00130 {return compDistInt_;}
00131
00134
00135 double multDistNLP () const {return multDistNLP_;}
00136 double multHessNLP () const {return multHessNLP_;}
00137 double multObjFNLP () const {return multObjFNLP_;}
00138
00139 double multDistMILP () const {return multDistMILP_;}
00140 double multHessMILP () const {return multHessMILP_;}
00141 double multObjFMILP () const {return multObjFMILP_;}
00142
00144 CouenneTNLP *nlp () const
00145 {return nlp_;}
00146
00147 private:
00148
00149
00150
00151
00152
00153
00155 CouenneProblem *problem_;
00156
00158 CouenneCutGenerator *couenneCG_;
00159
00160
00161
00162
00163
00164
00165
00166
00169 CouenneTNLP *nlp_;
00170
00172 Ipopt::IpoptApplication *app_;
00173
00176 OsiSolverInterface *milp_;
00177
00181 OsiSolverInterface *postlp_;
00182
00184 CouenneFPpool *pool_;
00185
00187 std::set <CouenneFPsolution, compareSol> tabuPool_;
00188
00189
00190
00191
00192
00194 int numberSolvePerLevel_;
00195
00198
00199 double multDistNLP_;
00200 double multHessNLP_;
00201 double multObjFNLP_;
00202
00203 double multDistMILP_;
00204 double multHessMILP_;
00205 double multObjFMILP_;
00206
00208 enum fpCompDistIntType compDistInt_;
00209
00211 enum fpCutPlane milpCuttingPlane_;
00212
00214 int nSepRounds_;
00215
00217 int maxIter_;
00218
00220 bool useSCIP_;
00221
00223 int milpMethod_;
00224
00226 enum fpTabuMgtPolicy tabuMgt_;
00227 };
00228 }
00229
00230 #endif