16 #include <ilcplex/ilocplex.h> 51 LbpCplex(mc::FFGraph &DAG,
const std::vector<mc::FFVar> &DAGvars,
const std::vector<mc::FFVar> &DAGfunctions,
52 const std::vector<babBase::OptimizationVariable> &variables,
const unsigned nineqIn,
const unsigned neqIn,
53 const unsigned nineqRelaxationOnlyIn,
const unsigned neqRelaxationOnlyIn,
const unsigned nineqSquashIn,
54 std::shared_ptr<Settings> settingsIn, std::shared_ptr<Logger> loggerIn, std::shared_ptr<std::vector<Constraint>> constraintPropertiesIn);
73 void _set_variable_bounds(
const std::vector<double> &lowerVarBounds,
const std::vector<double> &upperVarBounds);
85 void _update_LP_obj(
const MC &resultRelaxation,
const std::vector<double> &linearizationPoint,
const std::vector<double> &lowerVarBounds,
86 const std::vector<double> &upperVarBounds,
unsigned const &iLin,
unsigned const &iObj);
98 void _update_LP_ineq(
const MC &resultRelaxation,
const std::vector<double> &linearizationPoint,
const std::vector<double> &lowerVarBounds,
99 const std::vector<double> &upperVarBounds,
unsigned const &iLin,
unsigned const &iIneq);
112 void _update_LP_eq(
const MC &resultRelaxationCv,
const MC &resultRelaxationCc,
const std::vector<double> &linearizationPoint,
const std::vector<double> &lowerVarBounds,
113 const std::vector<double> &upperVarBounds,
unsigned const &iLin,
unsigned const &iEq);
125 void _update_LP_ineqRelaxationOnly(
const MC &resultRelaxation,
const std::vector<double> &linearizationPoint,
const std::vector<double> &lowerVarBounds,
126 const std::vector<double> &upperVarBounds,
unsigned const &iLin,
unsigned const &iIneqRelaxationOnly);
139 void _update_LP_eqRelaxationOnly(
const MC &resultRelaxationCv,
const MC &resultRelaxationCc,
const std::vector<double> &linearizationPoint,
const std::vector<double> &lowerVarBounds,
140 const std::vector<double> &upperVarBounds,
unsigned const &iLin,
unsigned const &iEqRelaxationOnly);
153 void _update_LP_ineq_squash(
const MC &resultRelaxation,
const std::vector<double> &linearizationPoint,
const std::vector<double> &lowerVarBounds,
154 const std::vector<double> &upperVarBounds,
unsigned const &iLin,
unsigned const &iIneqSquash);
164 void _update_LP_obj(
const vMC &resultRelaxationVMC,
const std::vector<std::vector<double>> &linearizationPoint,
const std::vector<double> &lowerVarBounds,
165 const std::vector<double> &upperVarBounds,
unsigned const &iObj);
176 void _update_LP_ineq(
const vMC &resultRelaxationVMC,
const std::vector<std::vector<double>> &linearizationPoint,
const std::vector<double> &lowerVarBounds,
177 const std::vector<double> &upperVarBounds,
unsigned const &iIneq);
189 void _update_LP_eq(
const vMC &resultRelaxationCvVMC,
const vMC &resultRelaxationCcVMC,
const std::vector<std::vector<double>> &linearizationPoint,
const std::vector<double> &lowerVarBounds,
190 const std::vector<double> &upperVarBounds,
unsigned const &iEq);
201 void _update_LP_ineqRelaxationOnly(
const vMC &resultRelaxationVMC,
const std::vector<std::vector<double>> &linearizationPoint,
const std::vector<double> &lowerVarBounds,
202 const std::vector<double> &upperVarBounds,
unsigned const &iIneqRelaxationOnly);
214 void _update_LP_eqRelaxationOnly(
const vMC &resultRelaxationCvVMC,
const vMC &resultRelaxationCcVMC,
const std::vector<std::vector<double>> &linearizationPoint,
const std::vector<double> &lowerVarBounds,
215 const std::vector<double> &upperVarBounds,
unsigned const &iEqRelaxationOnly);
227 void _update_LP_ineq_squash(
const vMC &resultRelaxationVMC,
const std::vector<std::vector<double>> &linearizationPoint,
const std::vector<double> &lowerVarBounds,
228 const std::vector<double> &upperVarBounds,
unsigned const &iIneqSquash);
294 void _fix_variable(
const unsigned &iVar,
const bool fixToLowerBound);
313 #ifdef LP__OPTIMALITY_CHECK 344 #ifdef LP__WRITE_CHECK_FILES 350 virtual void _write_LP_to_file(std::string &fileName);
378 #ifdef LP__OPTIMALITY_CHECK Wrapper for handling the lower bounding problems as well as optimization-based bounds tightening (OBB...
Definition: lbp.h:65
std::vector< IloRangeArray > linIneqRelaxationOnly
Definition: lbpCplex.h:372
double _get_objective_value_solver()
Function returning the objective value of the lastly solved LP.
void _turn_off_specific_options()
Function for checking if a specific option has to be turned off for a given lower bounding solver...
Definition: lbpCplex.h:311
void activate_more_scaling()
Function called by the B&B solver to heuristically activate more scaling in the LBS.
void _update_LP_ineqRelaxationOnly(const MC &resultRelaxation, const std::vector< double > &linearizationPoint, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, unsigned const &iLin, unsigned const &iIneqRelaxationOnly)
Auxiliary function for updating LP relaxation only inequalities, i.e., processing the linearization o...
void _solve_LP(const babBase::BabNode ¤tNode)
Function for solving the currently constructed linear program.
void _set_variable_bounds(const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds)
Function for setting the bounds of variables.
std::vector< IloRangeArray > linIneq
Definition: lbpCplex.h:369
IloObjective cplxObjective
Definition: lbpCplex.h:365
Class representing a node in the Branch-and-Bound tree.
Definition: babNode.h:35
SUBSOLVER_RETCODE _check_optimality(const babBase::BabNode ¤tNode, const double newLBD, const std::vector< double > &solution, const double etaVal, const std::vector< double > &multipliers)
Function for checking if the solution point returned by CPLEX solver is really optimal using strong d...
std::vector< IloNumArray > dualValsIneqRelaxationOnly
Definition: lbpCplex.h:385
mc::vMcCormick< I > vMC
A type definition for a vector McCormick variable.
Definition: intervalLibrary.h:41
std::vector< IloNumArray > dualValsIneqSquash
Definition: lbpCplex.h:388
void _get_solution_point(std::vector< double > &solution, double &etaVal)
Function for setting the solution to the solution point of the lastly solved LP.
IloCplex cplex
Definition: lbpCplex.h:376
std::vector< IloNumArray > dualValsEqRelaxationOnly1
Definition: lbpCplex.h:386
std::vector< IloNumArray > dualValsEq2
Definition: lbpCplex.h:384
IloEnv cplxEnv
Definition: lbpCplex.h:363
void _restore_LP_coefficients_after_OBBT()
Function for restoring proper coefficients and options in the LP after OBBT.
LbpCplex(mc::FFGraph &DAG, const std::vector< mc::FFVar > &DAGvars, const std::vector< mc::FFVar > &DAGfunctions, const std::vector< babBase::OptimizationVariable > &variables, const unsigned nineqIn, const unsigned neqIn, const unsigned nineqRelaxationOnlyIn, const unsigned neqRelaxationOnlyIn, const unsigned nineqSquashIn, std::shared_ptr< Settings > settingsIn, std::shared_ptr< Logger > loggerIn, std::shared_ptr< std::vector< Constraint >> constraintPropertiesIn)
Constructor, stores information on the problem and initializes the CPLEX problem and solver instances...
void _update_LP_obj(const MC &resultRelaxation, const std::vector< double > &linearizationPoint, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, unsigned const &iLin, unsigned const &iObj)
Auxiliary function for updating LP objective, i.e., processing the linearization of the objective fun...
SUBSOLVER_RETCODE _check_feasibility(const std::vector< double > &solution)
Function for checking if the solution point returned by CPLEX solver is really feasible.
std::vector< IloNumArray > dualValsIneq
Definition: lbpCplex.h:382
void _deactivate_objective_function_for_OBBT()
Function deactivating all objective rows in the LP for feasibility OBBT.
IloModel cplxModel
Definition: lbpCplex.h:364
SUBSOLVER_RETCODE
Enum for representing the return codes returned by the different sub-solvers (UpperBoundingSolver, LowerBoundingSolver).
Definition: returnCodes.h:36
void _fix_variable(const unsigned &iVar, const bool fixToLowerBound)
Virtual function for fixing a variable to one of its bounds.
SUBSOLVER_RETCODE _check_infeasibility(const babBase::BabNode ¤tNode)
Function for checking if the solution point returned CPLEX is really infeasible using Farkas' Lemma...
namespace holding all essentials of MAiNGO
Definition: aleModel.h:25
mc::McCormick< I > MC
A type definition for a McCormick variable.
Definition: intervalLibrary.h:34
IloNumArray farkasVals
Definition: lbpCplex.h:380
void _update_LP_eq(const MC &resultRelaxationCv, const MC &resultRelaxationCc, const std::vector< double > &linearizationPoint, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, unsigned const &iLin, unsigned const &iEq)
Auxiliary function for updating LP equalities, i.e., processing the linearization of the equality ( C...
IloRangeArray farkasCons
Definition: lbpCplex.h:379
std::vector< IloRangeArray > linEqRelaxationOnly2
Definition: lbpCplex.h:374
Wrapper for handling the lower bounding problems by interfacing CPLEX.
Definition: lbpCplex.h:32
std::vector< IloNumArray > dualValsEqRelaxationOnly2
Definition: lbpCplex.h:387
LP_RETCODE _get_LP_status()
Function returning the current status of the lastly solved linear program.
void _get_multipliers(std::vector< double > &multipliers)
Function for setting the multipliers of the lastly solved LP.
std::vector< IloNumArray > dualValsObj
Definition: lbpCplex.h:381
void _update_LP_eqRelaxationOnly(const MC &resultRelaxationCv, const MC &resultRelaxationCc, const std::vector< double > &linearizationPoint, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, unsigned const &iLin, unsigned const &iEqRelaxationOnly)
Auxiliary function for updating LP relaxation only equalities, i.e., processing the linearization of ...
void _update_LP_ineq(const MC &resultRelaxation, const std::vector< double > &linearizationPoint, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, unsigned const &iLin, unsigned const &iIneq)
Auxiliary function for updating LP inequalities, i.e., processing the linearization of the inequality...
std::vector< IloRangeArray > linEqRelaxationOnly1
Definition: lbpCplex.h:373
std::vector< IloRangeArray > linObj
Definition: lbpCplex.h:368
void _modify_LP_for_feasopt_OBBT(const double ¤tUBD, std::list< unsigned > &toTreatMax, std::list< unsigned > &toTreatMin)
Function modifying the LP for feasibility-optimality OBBT.
void _terminate_cplex()
Function for taking care of memory management by terminating Cplex (either called from destructor or ...
double etaCoeff
Definition: lbpCplex.h:377
std::vector< IloNumArray > dualValsEq1
Definition: lbpCplex.h:383
IloNumVar eta
Definition: lbpCplex.h:367
LP_RETCODE
Enum for representing the return codes returned when a linear program is solved.
Definition: returnCodes.h:69
bool _check_if_LP_really_infeasible()
Function for checking if the current linear program is really infeasible by, e.g., resolving it with different algorithms.
void _update_LP_ineq_squash(const MC &resultRelaxation, const std::vector< double > &linearizationPoint, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, unsigned const &iLin, unsigned const &iIneqSquash)
Auxiliary function for updating LP squash inequalities, i.e., processing the linearization of the squ...
std::vector< IloRangeArray > linEq2
Definition: lbpCplex.h:371
void _set_optimization_sense_of_variable(const unsigned &iVar, const int &optimizationSense)
Function for setting the optimization sense of variable iVar in OBBT.
std::vector< IloRangeArray > linEq1
Definition: lbpCplex.h:370
IloNumVarArray cplxVars
Definition: lbpCplex.h:366
std::vector< IloRangeArray > linIneqSquash
Definition: lbpCplex.h:375