10 #ifndef COUENNEITERATIVEROUNDING_HPP
11 #define COUENNEITERATIVEROUNDING_HPP
14 #include "CbcHeuristic.hpp"
18 #include "OsiCpxSolverInterface.hpp"
20 #include "CbcHeuristicFPump.hpp"
21 #include "CbcHeuristicRINS.hpp"
22 #include "CbcHeuristicDiveFractional.hpp"
23 #include "CbcHeuristicRandRound.hpp"
43 OsiSolverInterface* cinlp,
53 virtual CbcHeuristic *
clone()
const;
76 int solution(
double & objectiveValue,
double * newSolution);
136 OsiCpxSolverInterface *
milp_;
186 int feasibilityIR(
double& objectiveValue,
double* newSolution);
189 int improvementIR(
double& objectiveValue,
double* newSolution,
190 const double* startingSolution);
205 void writeLB(OsiRowCut& cut,
const double*
x,
char sense,
double rhs);
208 int branchToCut(
const double*
x, OsiSolverInterface* solver,
209 std::vector<int>& previousBranches);
212 bool solveMilp(OsiSolverInterface* milp,
double maxTime);
CouenneIterativeRounding()
Default constructor.
CouenneIterativeRounding & operator=(const CouenneIterativeRounding &rhs)
Assignment operator.
void resetModel(CbcModel *model)
Does nothing.
An iterative rounding heuristic, tailored for nonconvex MINLPs.
double maxTime_
Max CPU time to run the heuristic.
This is class provides an Osi interface for a Mixed Integer Linear Program expressed as a TMINLP (so ...
double endTime_
Maximum allowed time for current run.
int numIntegers_
Number of integer variables in the original model.
void fint fint fint real * a
void setMaxRoundingIter(int value)
Set maximum number of iterations for each rounding phase.
OsiSolverInterface * cinlp_
Pointer to the original NLP solver interface.
int branchToCut(const double *x, OsiSolverInterface *solver, std::vector< int > &previousBranches)
Branch on a random variable to cut given solution; returns var index.
void setMaxTimeFirstCall(double value)
Set maximum CPU time for the heuristic at the root node only.
double startTime_
Starting time for the heuristics.
void setMaxTime(double value)
Set maximum CPU time for the heuristic at each node.
void setMaxFirPoints(int value)
Set maximum number of points that we try to round in F-IR.
double maxTimeFirstCall_
Max CPU time to run the heuristic when no other solution is known.
bool solveMilp(OsiSolverInterface *milp, double maxTime)
Solve the MILP contained in milp to feasibility, or report failure.
void setMilp()
Set the milp solver at the root.
double omega_
Multiplication factor for log barrier parameter in F-IR; see in the paper.
double * colLower_
Pointer to original column lower and upper bounds of the reformulated problem, i.e.
int baseLbRhs_
Base value for the rhs of the local branching constraint it I-IR.
int maxFirPoints_
Maximum number of iterations in the outer loop for feasibility.
void setOmega(double value)
Set the value for omega, the multiplicative factor for the minimum log-barrier parameter mu used by F...
void setNlp(Bonmin::OsiTMINLPInterface *nlp, OsiSolverInterface *cinlp)
Set the minlp solver.
Class for MINLP problems with symbolic information.
bool areEqual(double a, double b)
Check if two double precision numbers are equal, up to some tolerance.
virtual CbcHeuristic * clone() const
Clone.
int feasibilityIR(double &objectiveValue, double *newSolution)
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions >)
initialize options to be read later
void setBaseLbRhs(int value)
Set the base value for the rhs of the local branching constraint in the I-IR heuristic.
CouenneProblem * couenne_
Pointer to a couenne representation of the problem.
double * colLowerNlp_
Pointer to column lower and upper bounds of the original problem, i.e.
CbcHeuristic ** heuristics_
Heuristics for the MILP.
int solution(double &objectiveValue, double *newSolution)
Run heuristic, return 1 if a better solution than the one passed is found and 0 otherwise.
int computeIntAtBound(const double *x)
Compute number of integer variables at one of their bounds at a given point x.
int numInitialRows_
Number of rows in the original convexification.
void setCouenneProblem(CouenneProblem *couenne)
Set the couenne problem to use.
int numSol_
Number of solutions last time the heuristic was called.
int improvementIR(double &objectiveValue, double *newSolution, const double *startingSolution)
void setAggressiveness(int value)
Set aggressiveness of heuristic.
OsiClpSolverInterface * milp_
Pointer to a milp solver interface.
void writeLB(OsiRowCut &cut, const double *x, char sense, double rhs)
Write down a local branching constraint, as an OsiRowCut.
virtual ~CouenneIterativeRounding()
Destructor.
int maxRoundingIter_
Maximum number of iterations in the main loop.
Bonmin::OsiTMINLPInterface * nlp_
Pointer to a dynamic nlp solver interface.
void fint fint fint real fint real * x