14#ifndef MINOTAURLINEARIZATIONS_H
15#define MINOTAURLINEARIZATIONS_H
60 static const std::string me_;
63 std::vector<ConstraintPtr> nlCons_;
72 std::stack<Modification *> nlpMods_;
128 std::vector<VariablePtr> varPtrs_;
135 std::vector<UInt > changeVar_;
160 ProblemPtr minlp, std::vector<ConstraintPtr> nlCons,
172 double * getCenter() {
return solC_;}
177 LinStats* getStats() {
return stats_; };
187 void setNlpEngine(
EnginePtr nlpe) {nlpe_ = nlpe;};
202 bool boundaryPtForObj_(
double* xnew,
const double *xOut,
203 std::vector<ConstraintPtr> &vioCons);
205 void candConsForObj_(
double *xOut, std::vector<ConstraintPtr > &consToLin,
206 bool &active,
bool &vio);
208 void candLinCons_(
const double *x, std::vector<UInt > &consToLin,
209 bool &foundActive,
bool &foundVio);
211 void cutsAtBoundary_(
double *xOut);
214 bool findIntersectPt_(std::vector<UInt > newConsId,
VariablePtr vl,
217 bool boundaryPtForCons_(
double* xnew,
const double *xOut,
218 std::vector<UInt > &vioCons);
223 void setStepSize_(
double &alpha, std::vector<VariablePtr > vars,
224 double *xOut, std::vector<double > unitVec);
226 void foundLinPt_(
UInt vIdx, std::vector<UInt> varIdx,
UInt pos,
227 std::vector<double> alphaSign,
double varBound,
double *xOut,
234 void insertNewPt_(
UInt j,
UInt k, std::vector<double > & xc,
239 double angleBetVectors_(
double *v1,
double *v2,
int n);
241 bool isInteriorPt_(
double *xOut,
242 std::vector<double* > & lastGrad,
243 double* & lastGradObj,
double &alpha);
245 void findLinPoint_(
double *xOut, std::vector<double* > & lastGrad,
246 double * &lastGradObj,
double &alpha);
248 void genLin_(
double *x, std::vector<UInt > vioConsPos,
249 std::vector<double *> &lastGrad,
250 double * &lastGradObj,
double &alpha);
252 bool genLinObj_(
double *x,
double* &lastGradObj);
254 void genLin_(
const double *x, std::vector<UInt > vioConsPos);
260 void linearAt_(
FunctionPtr f,
double fval,
const double *x,
265 bool linPart_(
double *b1,
UInt lVarIdx,
double lVarCoeff,
268 bool atBound_(std::vector<double > unitVec, std::vector<VariablePtr > vars);
270 bool boundCheck_(
double dirVal,
double varVal,
VariablePtr v);
272 bool newPoint_(std::vector<VariablePtr> vars,
double *xOut,
double alpha,
273 std::vector<double> unitVec);
275 void rootLinGenScheme1_();
277 void ifNonlinCons_();
279 void ifOnlyNonlinObj_();
281 void rootLinGenScheme2_();
288 UInt nVarIdx,
double nVarCoeff,
double UB,
bool isObj);
294 void rootLinScheme2_(
FunctionPtr f,
double UB,
double lVarCoeff,
295 UInt lVarIdx,
UInt nVarIdx,
bool isObj);
301 void rScheme2Cut_(
FunctionPtr f,
double UB,
double &delta,
double lVarCoeff,
302 double &lastSlope,
UInt nVarIdx,
double * npt,
303 double * grad,
bool isObj);
305 void exploreDir_(std::vector<VariablePtr > vars, std::vector<double > dir,
306 double* xOut,
double* objGrad,
307 std::vector<double* > nlconsGrad);
311 bool objCut_(
const double* xNew);
313 void search_(std::vector<VariablePtr > vars, std::vector<double* > nlconsGrad,
314 double *xOut,
double *objGrad, std::vector<double > dir);
317 UInt & nVarIdx,
double &nVarCoeff,
bool isObj);
319 void updateInfo_(std::vector<double > &xc,
320 std::vector<double > &yc,
321 std::vector<double > &linVioVal,
UInt j);
322 void varsInNonlinCons_();
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.
The Constraint class is used to manage a constraint.
Definition: Constraint.h:61
Definition: Environment.h:28
Definition: Function.h:37
The base class linear function is of the form c'x.
Definition: LinearFunction.h:31
Definition: Linearizations.h:39
~Linearizations()
Destroy.
Definition: Linearizations.cpp:122
void writeStats(std::ostream &out) const
Show statistics.
Definition: Linearizations.cpp:2760
void rootLinScheme3(EnginePtr lpe_, SeparationStatus *status)
Definition: Linearizations.cpp:2579
void rootLinearizationsGen()
Definition: Linearizations.cpp:806
bool rootLinearizationsUniS()
Root linearization schemes.
Definition: Linearizations.cpp:748
Linearizations(EnvPtr env, RelaxationPtr rel, ProblemPtr minlp, std::vector< ConstraintPtr > nlCons, VariablePtr objVar, ConstSolutionPtr sol)
Default Constructor.
Definition: Linearizations.cpp:54
void findCenter()
Find approximate center of the feasible region.
Definition: Linearizations.cpp:554
Definition: Relaxation.h:53
Definition: Solution.h:30
Definition: Variable.h:31
Definition: ActiveNodeStore.h:20
@ UB
Wait untill further notice.
Definition: Types.h:269
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
Definition: Linearizations.h:28
size_t rs4Cuts
Number of cuts in root scheme 3 version 1.
Definition: Linearizations.h:33
size_t rs1Cuts
Total cuts from all root schemes.
Definition: Linearizations.h:30
size_t rs3Cuts
Number of cuts in root scheme 2.
Definition: Linearizations.h:32
double linSchemesTime
Number of cuts in root gen scheme 2.
Definition: Linearizations.h:36
size_t rgs1Cuts
Number of cuts in root scheme 3 version 2.
Definition: Linearizations.h:34
size_t rs2Cuts
Number of cuts in root scheme 1.
Definition: Linearizations.h:31
size_t rgs2Cuts
Number of cuts in root gen scheme 1.
Definition: Linearizations.h:35