12 #ifndef CouenneFeasPump_HPP
13 #define CouenneFeasPump_HPP
18 #include "CbcHeuristic.hpp"
20 #include "IpOptionsList.hpp"
23 #include "scip/scip.h"
27 class OsiSolverInterface;
36 {
return (a<0) ? a+1 : a;}
39 class IpoptApplication;
43 class RegisteredOptions;
50 class CouenneCutGenerator;
52 class CouenneSparseMatrix;
77 virtual CbcHeuristic *
clone ()
const;
92 virtual int solution (
double &objectiveValue,
double *newSolution);
99 void checkInfinity (
struct Scip *scip,
double val,
double infinity);
125 double findSolution (
const double *nSol,
double *&sol,
int niter,
int* nsuciter);
162 int milpPhase (
double *nSol,
double *iSol);
165 int nlpPhase (
double *iSol,
double *nSol);
168 SCIP_RETCODE ScipSolve (
const double *nSol,
double* &sol,
int niter,
int* nsuciter,
CouNumber &obj);
Cut Generator for linear convexifications.
double findSolution(const double *nSol, double *&sol, int niter, int *nsuciter)
find feasible solution (called by solveMILP ())
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions >)
initialize options to be read later
Ipopt::IpoptApplication * app_
Ipopt Application pointer for solving NLPs.
double multDistMILP_
weight of distance in MILP
CouenneCutGenerator * couenneCG_
CouenneCutGenerator for linearization cuts.
CouenneFeasPump & operator=(const CouenneFeasPump &rhs)
Assignment operator.
CouenneProblem * Problem() const
return pointer to problem
double multObjFNLP_
weight of objective in NLP
int maxIter_
Maximum iterations per call.
int nCalls_
How often should it be called.
double multObjFMILP_
weight of objective in MILP
double multObjFNLP() const
weight of objective in NLP
virtual CbcHeuristic * clone() const
Clone.
expression * updateNLPObj(const double *)
set new expression as the NLP objective function using argument as point to minimize distance from...
int & nCalls()
return number of calls (can be changed)
int nSepRounds_
Number of separation rounds for MILP convexification cuts.
virtual CouNumber solveNLP(const CouNumber *nSol, CouNumber *&iSol)
obtain solution to NLP
double multHessMILP_
weight of Hessian in MILP
int nlpPhase(double *iSol, double *nSol)
NLP phase of the FP.
enum fpCutPlane milpCuttingPlane_
Separate convexification cuts during or after MILP.
virtual CouNumber solveMILP(const CouNumber *nSol, CouNumber *&iSol, int niter, int *nsuciter)
find integer (possibly NLP-infeasible) point isol closest (according to the l-1 norm of the hessian) ...
int * match_
matching between reformulation's variables and L-1 norm variables
CouenneFPpool * pool_
Pool of solutions.
int milpPhase(double *nSol, double *iSol)
MILP phase of the FP.
An implementation of the Feasibility pump that uses linearization and Ipopt to find the two sequences...
int milpMethod_
Which SCIP MILP method to use.
double multDistNLP_
Weights in computing distance, in both MILP and NLP (must sum up to 1 for MILP and for NLP): ...
double multObjFMILP() const
weight of objective in MILP
double multDistMILP() const
weight of distance in MILP
void init_MILP()
initialize all solvers at the first call, where the initial MILP is built
Class for MINLP problems with symbolic information.
bool useSCIP_
Use SCIP instead of Cbc for solving MILPs.
CouenneTNLP * nlp() const
return NLP
int numberSolvePerLevel_
Number of NLPs solved for each given level of the tree.
enum fpCompDistIntType compDistInt_
Compute distance from integer variables only, not all variables.
enum fpCompDistIntType compDistInt() const
return type of MILP solved
double multHessMILP() const
weight of Hessian in MILP
std::set< CouenneFPsolution, compareSol > tabuPool_
Solutions to avoid.
double multHessNLP_
weight of Hessian in NLP
double CouNumber
main number type in Couenne
OsiSolverInterface * postlp_
LP relaxation of the MINLP used when fixing integer variables (used for compDistInt_ in FP_DIST_POST ...
double fadingCoeff(double a)
enum fpTabuMgtPolicy tabuMgt_
Tabu management policy: none, use from pool, random perturbation of current solution.
virtual int solution(double &objectiveValue, double *newSolution)
Run heuristic, return 1 if a better solution than the one passed is found and 0 otherwise.
double multHessNLP() const
weight of Hessian in NLP
bool fixIntVariables(const double *sol)
admits a (possibly fractional) solution and fixes the integer components in the nonlinear problem for...
virtual void resetModel(CbcModel *model)
Does nothing, but necessary as CbcHeuristic declares it pure virtual.
double multDistNLP() const
Return Weights in computing distance, in both MILP and NLP (must sum up to 1 for MILP and for NLP): ...
Class for handling NLPs using CouenneProblem.
virtual ~CouenneFeasPump()
Destructor.
CouenneProblem * problem_
Couenne representation of the problem.
double fadeMult_
decrease factor for MILP/NLP multipliers of distance/Hessian/objective
void initIpoptApp()
Common code for initializing non-smartptr ipopt application.
void setNumberSolvePerLevel(int value)
set number of nlp's solved for each given level of the tree
OsiSolverInterface * milp_
MILP relaxation of the MINLP (used to find integer, non-NLP-feasible solutions)
CouenneFeasPump(CouenneProblem *couenne=NULL, CouenneCutGenerator *cg=NULL, Ipopt::SmartPtr< Ipopt::OptionsList > options=NULL)
Constructor with (optional) MINLP pointer.
CouenneTNLP * nlp_
Continuous relaxation of the problem, with an interface for Ipopt only.