13#ifndef MINOTAURQGHANDLERADVANCE_H
14#define MINOTAURQGHANDLERADVANCE_H
66 static const std::string me_;
74 std::vector<ConstraintPtr> nlCons_;
76 std::vector<ConstraintPtr> highDualCons_;
84 std::stack<Modification *> nlpMods_;
89 void prModNLP_(
const double *x);
95 void prFeasibleInactive_(
bool binVal,
UInt bIdx,
UInt i,
FunctionPtr f,
const double *x,
double * y,
double * prPt,
const double * ptToCut,
CutManagerPtr cutMan);
97 bool prInfeasibility_(
bool bisect,
bool binVal,
const double *x,
double * y,
double * prPt,
const double *ptToCut,
UInt i,
bool isObj,
double relVal,
UInt bIdx,
FunctionPtr f);
140 std::vector<double > consDual_;
144 std::string cutMethod_;
157 std::unordered_map<VariablePtr, std::forward_list<impliVar>> impli0_;
158 std::unordered_map<VariablePtr, std::forward_list<impliVar>> impli1_;
182 {
return Branches();};
186 const DoubleVector &, ModVector &,
187 BrVarCandSet &, BrCandVector &,
bool &) {};
201 bool & should_prune,
double &inf_meas);
233 void setLpEngine(
EnginePtr lpe) {lpe_ = lpe;};
247 void addInitLinearX_(ConstSolutionPtr sol);
249 void addCutAtRoot_(ConstraintPtr con,
const double * x,
bool isObj);
251 void dualBasedCons_(ConstSolutionPtr sol);
258 void cutIntSol_(
const double *lpx, CutManager *cutMan,
259 SolutionPoolPtr s_pool,
bool *sol_found,
263 void ESHTypeCut_(
const double *lpx, CutManager *cutMan,
267 void gradientIneq_(
const double *nlpx,
const double *lpx,
269 ConstraintPtr con,
bool isObj);
276 void fixInts_(
const double *x);
283 void initLinear_(
bool *isInf);
289 void linearAt_(FunctionPtr f,
double fval,
const double *x,
290 double *c, LinearFunctionPtr *lf,
int *error);
296 void linearizeObj_();
302 void cutToCons_(
const double *nlpx,
const double *lpx, CutManager *,
306 void addCut_(
const double *nlpx,
const double *lpx, ConstraintPtr con,
309 void ECPTypeCut_(
const double *x, CutManager *, ConstraintPtr con,
double act);
311 void consCutsAtLpSol_(
const double *lpx, CutManager *cutman,
314 void genLin_(
const double *x, std::vector<UInt> vioCons, CutManager *cutMan);
316 bool isIntFeas_(
const double* x);
320 void maxVio_(ConstSolutionPtr sol, NodePtr node,
324 void ESHTypeCut_(
const double *lpx, CutManager *cutMan);
326 void objCutAtLpSol_(
const double *lpx, CutManager *,
332 bool boundaryPtForCons_(
double* xnew,
const double *xOut,
333 std::vector<UInt > &vioCons);
338 void cutToObj_(
const double *nlpx,
const double *lpx, CutManager *,
345 void relax_(
bool *is_inf);
347 void solveCenterNLP_(EnginePtr nlpe);
359 void updateUb_(SolutionPoolPtr s_pool,
double nlpval,
bool *sol_found);
365 typedef QGHandlerAdvance* QGHandlerAdvancePtr;
Define the base class Engine.
Get information about a Function.
Define abstract base class for handlers of various kinds.
Declare the base class Modification.
Implement base class Solution.
Base class for describing candidates for branching on a node in branch-and-bound.
Definition: BrCand.h:32
Abstract base class to manage cuts in the relaxation.
Definition: CutManager.h:42
Definition: Environment.h:28
Definition: Function.h:37
Base class for handling specific types of constraints or objective.
Definition: Handler.h:49
Definition: Linearizations.h:39
Definition: Modification.h:29
Definition: PerspCutGenerator.h:37
Handler for convex constraints, based on quesada-grossmann algorithm.
Definition: QGHandlerAdvance.h:53
bool isFeasible(ConstSolutionPtr sol, RelaxationPtr relaxation, bool &should_prune, double &inf_meas)
Check if a solution is feasible.
Definition: QGHandlerAdvance.cpp:1166
ModificationPtr getBrMod(BrCandPtr, DoubleVector &, RelaxationPtr, BranchDirection)
Does nothing.
Definition: QGHandlerAdvance.h:190
~QGHandlerAdvance()
Destroy.
Definition: QGHandlerAdvance.cpp:105
QGHandlerAdvance(EnvPtr env, ProblemPtr minlp, EnginePtr nlpe)
Default Constructor.
Definition: QGHandlerAdvance.cpp:56
std::string getName() const
Return the name of the handler.
Definition: QGHandlerAdvance.cpp:3115
void separate(ConstSolutionPtr sol, NodePtr node, RelaxationPtr rel, CutManager *cutman, SolutionPoolPtr s_pool, ModVector &p_mods, ModVector &r_mods, bool *sol_found, SeparationStatus *status)
Base class method. Find cuts.
Definition: QGHandlerAdvance.cpp:2155
void relaxNodeFull(NodePtr node, RelaxationPtr rel, bool *is_inf)
Base class method. Does nothing.
Definition: QGHandlerAdvance.cpp:1603
void relaxInitFull(RelaxationPtr rel, bool *is_inf)
Base class method. calls relax_().
Definition: QGHandlerAdvance.cpp:1589
SolveStatus presolve(PreModQ *, bool *, Solution **sol)
Does nothing.
Definition: QGHandlerAdvance.h:204
bool presolveNode(RelaxationPtr, NodePtr, SolutionPoolPtr, ModVector &, ModVector &)
Does nothing.
Definition: QGHandlerAdvance.h:207
void relaxNodeInc(NodePtr node, RelaxationPtr rel, bool *is_inf)
Base class method. Does nothing.
Definition: QGHandlerAdvance.cpp:1609
void postsolveGetX(const double *, UInt, DoubleVector *)
Does nothing.
Definition: QGHandlerAdvance.h:212
void getBranchingCandidates(RelaxationPtr, const DoubleVector &, ModVector &, BrVarCandSet &, BrCandVector &, bool &)
Does nothing.
Definition: QGHandlerAdvance.h:185
void relaxInitInc(RelaxationPtr rel, bool *is_inf)
Base class method. calls relax_().
Definition: QGHandlerAdvance.cpp:1595
Branches getBranches(BrCandPtr, DoubleVector &, RelaxationPtr, SolutionPoolPtr)
Does nothing.
Definition: QGHandlerAdvance.h:180
void writeStats(std::ostream &out) const
Show statistics.
Definition: QGHandlerAdvance.cpp:3068
Definition: Relaxation.h:53
Definition: SolutionPool.h:28
Definition: Solution.h:30
Definition: Variable.h:31
Definition: ActiveNodeStore.h:20
BranchDirection
Two directions for branching.
Definition: Types.h:201
unsigned int UInt
Unsigned integer.
Definition: Types.h:30
SeparationStatus
Status from separation routine:
Definition: Types.h:217
EngineStatus
Different status that an external engine may report.
Definition: Types.h:176
SolveStatus
Different states an algorithm like branch-and-bound can be in.
Definition: Types.h:158
Definition: QGAdvHandler.h:28
size_t nlpI
Number of nlps feasible.
Definition: QGAdvHandler.h:31
size_t cuts
Number of nlps hits engine iterations limit.
Definition: QGAdvHandler.h:33
size_t nlpM
Number of nlps solved.
Definition: QGHandlerAdvance.h:31
size_t nlpIL
Number of nlps infeasible.
Definition: QGAdvHandler.h:32
size_t fracCuts
Number of cuts at int feas nodes.
Definition: QGHandlerAdvance.h:36
size_t nlpF
Number of nlps solved.
Definition: QGAdvHandler.h:30