MAiNGO
maingo::lbp::LbpCplex Class Reference

Wrapper for handling the lower bounding problems by interfacing CPLEX. More...

#include <lbpCplex.h>

Inheritance diagram for maingo::lbp::LbpCplex:
maingo::lbp::LowerBoundingSolver

Public Member Functions

 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, Settings *settingsIn, Logger *loggerIn, std::vector< Constraint > *constraintPropertiesIn)
 Constructor, stores information on the problem and initializes the CPLEX problem and solver instances. More...
 
 ~LbpCplex ()
 Destructor. More...
 
void activate_more_scaling ()
 Function called by the B&B solver to heuristically activate more scaling in the LBS. More...
 
- Public Member Functions inherited from maingo::lbp::LowerBoundingSolver
 LowerBoundingSolver (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, Settings *settingsIn, Logger *loggerIn, std::vector< Constraint > *constraintPropertiesIn)
 Constructor, stores information on the problem and constructs an own copy of the directed acyclic graph. More...
 
virtual ~LowerBoundingSolver ()
 Virtual destructor, only needed to make sure the correct destructor of the derived classes is called. More...
 
SUBSOLVER_RETCODE solve_LBP (const babBase::BabNode &currentNode, double &lowerBound, std::vector< double > &solutionPoint, LbpDualInfo &dualInfo)
 Function called by B&B solver for solving the lower bounding problem on the current node. More...
 
TIGHTENING_RETCODE solve_OBBT (babBase::BabNode &currentNode, const double currentUBD, const OBBT reductionType)
 Function called by B&B solver for optimality-based range reduction (cf., e.g., Gleixner et al., J. Glob. Optim. 67 (2017) 731) More...
 
virtual TIGHTENING_RETCODE do_constraint_propagation (babBase::BabNode &currentNode, const double currentUBD, const unsigned pass=3)
 Function called by B&B solver for constraint propagation. This function is virtual as it may be overwritten for certain LBD solvers. The defaults for constraint propagation are 10 rounds and at least 1% improvement. More...
 
TIGHTENING_RETCODE do_dbbt_and_probing (babBase::BabNode &currentNode, const std::vector< double > &lbpSolutionPoint, const LbpDualInfo &dualInfo, const double currentUBD)
 Function called by B&B solver for DBBT and probing (for each variable depending on where the LBD solution lies) More...
 
void update_incumbent_LBP (const std::vector< double > &incumbentBAB)
 Function called by the B&B solver to update the incumbent and the ID of the node currently holding it, which is needed by some linearization heuristics. More...
 
void preprocessor_check_options (const babBase::BabNode &rootNode)
 Function called by the B&B in preprocessing in order to check the need for specific options, currently for subgradient intervals & CPLEX no large values. More...
 

Protected Member Functions

void _set_variable_bounds (const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds)
 Function for setting the bounds of variables. More...
 
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 function ( CPLEX cannot work with coefficients >+1e19 or -1e19> ) More...
 
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 ( CPLEX cannot work with coefficients >+1e19 or -1e19> ) More...
 
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 ( CPLEX cannot work with coefficients >+1e19 or -1e19> ) More...
 
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 of the relaxation only inequality ( CPLEX cannot work with coefficients >+1e19 or -1e19> ) More...
 
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 the relaxation only equality ( CPLEX cannot work with coefficients >+1e19 or -1e19> ) More...
 
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 squash inequality ( CPLEX cannot work with coefficients >+1e19 or -1e19> ) No tolerances are allowed for squash inequalities! More...
 
void _update_LP_obj (const vMC &resultRelaxationVMC, const std::vector< std::vector< double >> &linearizationPoint, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, unsigned const &iObj)
 Auxiliary function for updating LP objective, i.e., processing the linearization of the objective function for vector McCormick relaxations ( CPLEX cannot work with coefficients >+1e19 or -1e19> ) More...
 
void _update_LP_ineq (const vMC &resultRelaxationVMC, const std::vector< std::vector< double >> &linearizationPoint, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, unsigned const &iIneq)
 Auxiliary function for updating LP inequalities, i.e., processing the linearization of the inequality for vector McCormick relaxations ( CPLEX cannot work with coefficients >+1e19 or -1e19> ) More...
 
void _update_LP_eq (const vMC &resultRelaxationCvVMC, const vMC &resultRelaxationCcVMC, const std::vector< std::vector< double >> &linearizationPoint, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, unsigned const &iEq)
 Auxiliary function for updating LP equalities, i.e., processing the linearization of the equality for vector McCormick relaxations ( CPLEX cannot work with coefficients >+1e19 or -1e19> ) More...
 
void _update_LP_ineqRelaxationOnly (const vMC &resultRelaxationVMC, const std::vector< std::vector< double >> &linearizationPoint, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, unsigned const &iIneqRelaxationOnly)
 Auxiliary function for updating LP relaxation only inequalities, i.e., processing the linearization of the relaxation only inequality for vector McCormick relaxations ( CPLEX cannot work with coefficients >+1e19 or -1e19> ) More...
 
void _update_LP_eqRelaxationOnly (const vMC &resultRelaxationCvVMC, const vMC &resultRelaxationCcVMC, const std::vector< std::vector< double >> &linearizationPoint, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, unsigned const &iEqRelaxationOnly)
 Auxiliary function for updating LP relaxation only equalities, i.e., processing the linearization of the relaxation only equality for vector McCormick relaxations ( CPLEX cannot work with coefficients >+1e19 or -1e19> ) More...
 
void _update_LP_ineq_squash (const vMC &resultRelaxationVMC, const std::vector< std::vector< double >> &linearizationPoint, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, unsigned const &iIneqSquash)
 Auxiliary function for updating LP squash inequalities, i.e., processing the linearization of the squash inequality for vector McCormick relaxations ( CPLEX cannot work with coefficients >+1e19 or -1e19> ) No tolerances are allowed for squash inequalities! More...
 
void _solve_LP (const babBase::BabNode &currentNode)
 Function for solving the currently constructed linear program. More...
 
LP_RETCODE _get_LP_status ()
 Function returning the current status of the lastly solved linear program. More...
 
void _get_solution_point (std::vector< double > &solution, double &etaVal)
 Function for setting the solution to the solution point of the lastly solved LP. More...
 
double _get_objective_value_solver ()
 Function returning the objective value of the lastly solved LP. More...
 
void _get_multipliers (std::vector< double > &multipliers)
 Function for setting the multipliers of the lastly solved LP. More...
 
void _deactivate_objective_function_for_OBBT ()
 Function deactivating all objective rows in the LP for feasibility OBBT. More...
 
void _modify_LP_for_feasopt_OBBT (const double &currentUBD, std::list< unsigned > &toTreatMax, std::list< unsigned > &toTreatMin)
 Function modifying the LP for feasibility-optimality OBBT. More...
 
void _set_optimization_sense_of_variable (const unsigned &iVar, const int &optimizationSense)
 Function for setting the optimization sense of variable iVar in OBBT. More...
 
void _fix_variable (const unsigned &iVar, const bool fixToLowerBound)
 Virtual function for fixing a variable to one of its bounds. More...
 
void _restore_LP_coefficients_after_OBBT ()
 Function for restoring proper coefficients and options in the LP after OBBT. More...
 
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. More...
 
void _turn_off_specific_options ()
 Function for checking if a specific option has to be turned off for a given lower bounding solver. We don't have to turn anything off for CPLEX. More...
 
SUBSOLVER_RETCODE _check_infeasibility (const babBase::BabNode &currentNode)
 Function for checking if the solution point returned CPLEX is really infeasible using Farkas' Lemma. More...
 
SUBSOLVER_RETCODE _check_feasibility (const std::vector< double > &solution)
 Function for checking if the solution point returned by CPLEX solver is really feasible. More...
 
SUBSOLVER_RETCODE _check_optimality (const babBase::BabNode &currentNode, 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 duality. More...
 
- Protected Member Functions inherited from maingo::lbp::LowerBoundingSolver
virtual LINEARIZATION_RETCODE _update_LP (const babBase::BabNode &currentNode)
 Calls the proper function for computing linearization points and modifying the coefficients of the LP problem The function is virtual, since other solver types, e.g., an interval solver does not need to always compute McCormick relaxations. More...
 
void _update_whole_LP_at_linpoint (const std::vector< MC > &resultRelaxation, const std::vector< double > &linearizationPoint, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, unsigned const &iLin)
 Virtual auxiliary function for updating whole LP at once. More...
 
void _update_whole_LP_at_vector_linpoints (const std::vector< vMC > &resultRelaxationVMC, const std::vector< std::vector< double >> &linearizationPoints, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds)
 Virtual auxiliary function for updating whole LP at once. More...
 
double _equilibrate_and_relax (std::vector< double > &coefficients, double &rhs, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds)
 Function for equilibrating a line in an LP. More...
 
double _get_objective_value ()
 Virtual function returning the objective value of the lastly solved LP. More...
 
void _linearize_functions_at_linpoint (std::vector< MC > &resultRelaxation, const std::vector< double > &linearizationPoint, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, mc::FFSubgraph &subgraph, std::vector< mc::FFVar > &functions)
 Auxiliary function for calling the proper function to linearize functions at chosen linearization point. More...
 
void _linearize_functions_at_preset_vector_linpoint (std::vector< vMC > &resultRelaxationVMC, const std::vector< std::vector< double >> &linearizationPoints, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, mc::FFSubgraph &subgraph, std::vector< mc::FFVar > &functions)
 Auxiliary function for calling the proper function to linearize functions at precomputed vector linearization point. The precomputed vector linearization point has to be saved in _DAGobj.vMcPoint. More...
 
LINEARIZATION_RETCODE _linearize_model_at_midpoint (const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds)
 This function linearizes each function of the model at the middle point of the underlying box. More...
 
LINEARIZATION_RETCODE _linearize_model_at_incumbent (const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, const bool holdsIncumbent)
 This function linearizes each function of the model at the incumbent if it is contained in the current node. Otherwise each function is linearized at the middle point of the underlying box. More...
 
LINEARIZATION_RETCODE _linearization_points_Kelley (const babBase::BabNode &currentNode)
 This function adds linearizations to LP with the use of an adapted version of Kelley's algorithm. The number of points equals at most _nvar+2. This function requires the solution of auxiliary LPs. Linear functions will be computed only once, since McCormick returns envelopes. Superfluous rows in the resulting LP will be set to 0. More...
 
LINEARIZATION_RETCODE _linearization_points_Simplex (const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds)
 This function linearizes each function of the model at (_nvar+2)/2 points (except for the linear ones). The points are computed by using the precomputed simplex vertices from _compute_and_rotate_simplex. More...
 
LINEARIZATION_RETCODE _linearization_points_random (const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds)
 This function linearizes each function of the model at (_nvar+2)/2 random points (except for the linear ones) More...
 
LINEARIZATION_RETCODE _linearization_points_Kelley_Simplex (const babBase::BabNode &currentNode)
 This function adds linearizations to LP with the use of an adapted version of Kelley's algorithm. The number of points equals at most the size of the chosen linpoints vector +3. This function requires the solution of auxiliary LPs. Linear functions will be computed only once, since McCormick returns envelopes. Superfluous rows in the resulting LP will be set to 0. More...
 
void _update_LP_nonlinear_linear (const std::vector< vMC > &resultRelaxationVMCNonlinear, const std::vector< MC > &resultRelaxationLinear, const std::vector< double > &linearizationPoint, const std::vector< std::vector< double >> &scaledPoints, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds)
 This function properly builds the LP using previously determined nonlinear and linear functions. More...
 
void _update_LP_nonlinear (const std::vector< MC > &resultRelaxationNonlinear, const std::vector< double > &linearizationPoint, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, const unsigned iLin)
 This function properly builds the LP using previously determined nonlinear functions. More...
 
void _reset_LP (const std::vector< double > &linearizationPoint, const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds)
 The function resets the LP, meaning it sets all rhs to 1e19 and coefficients to 0. Eta coefficients are -1. More...
 
void _compute_and_rotate_simplex (const unsigned int dim, const double angleIn, const double sphereRadius, std::vector< std::vector< double >> &simplexPoints)
 Function for the computation of simplex points lying on a sphere with radius sphereRadius rotated by angleIn. More...
 
void _choose_good_lin_points (const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, bool firstTime=true)
 Heuristical determination of good linearization points. This function is in testing phasing and is not used. More...
 
virtual SUBSOLVER_RETCODE _fallback_to_intervals (double &newLBD)
 Virtual function for checking if a given node is feasible with the use of interval arithmetics. It is needed in cases where the LBD solver may return something misleading, e.g., says sth is optimal but it can't be verified. More...
 
void _truncate_value (double &value, const double tolerance)
 Function used for truncation of value digits which are not guaranteed to be correct. More...
 
void _print_LP (const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds)
 Function for printing the current LP stored in _MatrixA, _MatrixA_eqs, _rhsB, _rhsB_eqs. More...
 

Private Member Functions

void _terminate_cplex ()
 Function for taking care of memory management by terminating Cplex (either called from destructor or when an exception is thrown) More...
 

Private Attributes

Internal CPLEX variables
IloEnv cplxEnv
 
IloModel cplxModel
 
IloObjective cplxObjective
 
IloNumVarArray cplxVars
 
IloNumVar eta
 
std::vector< IloRangeArray > linObj
 
std::vector< IloRangeArray > linIneq
 
std::vector< IloRangeArray > linEq1
 
std::vector< IloRangeArray > linEq2
 
std::vector< IloRangeArray > linIneqRelaxationOnly
 
std::vector< IloRangeArray > linEqRelaxationOnly1
 
std::vector< IloRangeArray > linEqRelaxationOnly2
 
std::vector< IloRangeArray > linIneqSquash
 
IloCplex cplex
 
double etaCoeff
 
IloRangeArray farkasCons
 
IloNumArray farkasVals
 
std::vector< IloNumArray > dualValsObj
 
std::vector< IloNumArray > dualValsIneq
 
std::vector< IloNumArray > dualValsEq1
 
std::vector< IloNumArray > dualValsEq2
 
std::vector< IloNumArray > dualValsIneqRelaxationOnly
 
std::vector< IloNumArray > dualValsEqRelaxationOnly1
 
std::vector< IloNumArray > dualValsEqRelaxationOnly2
 
std::vector< IloNumArray > dualValsIneqSquash
 

Additional Inherited Members

- Protected Attributes inherited from maingo::lbp::LowerBoundingSolver
std::vector< double > _incumbent
 
std::vector< std::vector< double > > _objectiveScalingFactors
 
std::vector< std::vector< std::vector< double > > > _matrixObj
 
std::vector< std::vector< std::vector< double > > > _matrixIneq
 
std::vector< std::vector< std::vector< double > > > _matrixEq1
 
std::vector< std::vector< std::vector< double > > > _matrixEq2
 
std::vector< std::vector< std::vector< double > > > _matrixIneqRelaxationOnly
 
std::vector< std::vector< std::vector< double > > > _matrixEqRelaxationOnly1
 
std::vector< std::vector< std::vector< double > > > _matrixEqRelaxationOnly2
 
std::vector< std::vector< std::vector< double > > > _matrixIneqSquash
 
std::vector< std::vector< double > > _rhsObj
 
std::vector< std::vector< double > > _rhsIneq
 
std::vector< std::vector< double > > _rhsEq1
 
std::vector< std::vector< double > > _rhsEq2
 
std::vector< std::vector< double > > _rhsIneqRelaxationOnly
 
std::vector< std::vector< double > > _rhsEqRelaxationOnly1
 
std::vector< std::vector< double > > _rhsEqRelaxationOnly2
 
std::vector< std::vector< double > > _rhsIneqSquash
 
std::shared_ptr< DagObj_DAGobj
 
Settings_maingoSettings
 
Logger_logger
 
std::vector< Constraint > * _constraintProperties
 
std::vector< unsigned > _nLinObj
 
std::vector< unsigned > _nLinIneq
 
std::vector< unsigned > _nLinEq
 
std::vector< unsigned > _nLinIneqRelaxationOnly
 
std::vector< unsigned > _nLinEqRelaxationOnly
 
std::vector< unsigned > _nLinIneqSquash
 
unsigned _maxnParticipatingVariables
 
const unsigned _nvar
 
const unsigned _nineq
 
const unsigned _neq
 
const unsigned _nineqRelaxationOnly
 
const unsigned _neqRelaxationOnly
 
const unsigned _nineqSquash
 
std::vector< babBase::OptimizationVariable_originalVariables
 
double _objectiveValue
 
std::vector< double > _solutionPoint
 
std::vector< double > _multipliers
 
std::vector< double > _lowerVarBounds
 
std::vector< double > _upperVarBounds
 
LP_RETCODE _LPstatus
 
double _computationTol
 
bool _differentNumberOfLins = false
 

Detailed Description

Wrapper for handling the lower bounding problems by interfacing CPLEX.

This class constructs and solves lower bounding problems using CPLEX (International Business Machines Corporation: IBM ILOG CPLEX v12.8. Armonk (2009)).

Constructor & Destructor Documentation

◆ LbpCplex()

maingo::lbp::LbpCplex::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,
Settings settingsIn,
Logger loggerIn,
std::vector< Constraint > *  constraintPropertiesIn 
)

Constructor, stores information on the problem and initializes the CPLEX problem and solver instances.

Parameters
[in]DAGis the directed acyclic graph constructed in MAiNGO.cpp needed to construct an own DAG for the lower bounding solver
[in]DAGvarsare the variables corresponding to the DAG
[in]DAGfunctionsare the functions corresponding to the DAG
[in]variablesis a vector containing the initial optimization variables defined in problem.h
[in]nineqInis the number of inequality constraints
[in]neqInis the number of equality
[in]nineqRelaxationOnlyInis the number of inequality for use only in the relaxed problem
[in]neqRelaxationOnlyInis the number of equality constraints for use only in the relaxed problem
[in]nineqSquashInis the number of squash inequality constraints which are to be used only if the squash node has been used
[in]settingsInis a pointer to the MAiNGO settings
[in]loggerInis a pointer to the MAiNGO logger object
[in]constraintPropertiesInis a pointer to the constraint properties determined by MAiNGO

◆ ~LbpCplex()

maingo::lbp::LbpCplex::~LbpCplex ( )

Destructor.

Member Function Documentation

◆ _check_feasibility()

SUBSOLVER_RETCODE maingo::lbp::LbpCplex::_check_feasibility ( const std::vector< double > &  solution)
protectedvirtual

Function for checking if the solution point returned by CPLEX solver is really feasible.

Parameters
[in]solutionis holding the solution point to check
Returns
Returns whether the given solution was confirmed to be feasible or not

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _check_if_LP_really_infeasible()

bool maingo::lbp::LbpCplex::_check_if_LP_really_infeasible ( )
protectedvirtual

Function for checking if the current linear program is really infeasible by, e.g., resolving it with different algorithms.

Returns
Returns true if the linear program is indeed infeasible, false if and optimal solution was found

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _check_infeasibility()

SUBSOLVER_RETCODE maingo::lbp::LbpCplex::_check_infeasibility ( const babBase::BabNode currentNode)
protectedvirtual

Function for checking if the solution point returned CPLEX is really infeasible using Farkas' Lemma.

Parameters
[in]currentNodeis holding the current node in the branch-and-bound tree
Returns
Returns whether the problem was confirmed to be infeasible or not

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _check_optimality()

SUBSOLVER_RETCODE maingo::lbp::LbpCplex::_check_optimality ( const babBase::BabNode currentNode,
const double  newLBD,
const std::vector< double > &  solution,
const double  etaVal,
const std::vector< double > &  multipliers 
)
protectedvirtual

Function for checking if the solution point returned by CPLEX solver is really optimal using strong duality.

Parameters
[in]currentNodeis holding the current node in the branch-and-bound tree
[in]newLBDis the value of the solution point to check
[in]solutionis holding the solution point to check
[in]etaValis holding the value of eta at the solution point
[in]multipliersis holding the dual multipliers of the solution
Returns
Returns whether the given solution was confirmed to be optimal or not

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _deactivate_objective_function_for_OBBT()

void maingo::lbp::LbpCplex::_deactivate_objective_function_for_OBBT ( )
protectedvirtual

Function deactivating all objective rows in the LP for feasibility OBBT.

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _fix_variable()

void maingo::lbp::LbpCplex::_fix_variable ( const unsigned &  iVar,
const bool  fixToLowerBound 
)
protectedvirtual

Virtual function for fixing a variable to one of its bounds.

Parameters
[in]iVaris the number of variable which will be fixed.
[in]fixToLowerBounddescribes whether the variable shall be fixed to its lower or upper bound.

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _get_LP_status()

LP_RETCODE maingo::lbp::LbpCplex::_get_LP_status ( )
protectedvirtual

Function returning the current status of the lastly solved linear program.

Returns
Returns the current status of the last solved linear program.

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _get_multipliers()

void maingo::lbp::LbpCplex::_get_multipliers ( std::vector< double > &  multipliers)
protectedvirtual

Function for setting the multipliers of the lastly solved LP.

Parameters
[in]multipliersis modified to hold the reduced costs of the lastly solved LP

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _get_objective_value_solver()

double maingo::lbp::LbpCplex::_get_objective_value_solver ( )
protectedvirtual

Function returning the objective value of the lastly solved LP.

Returns
Returns the objective value of the lastly solved LP.

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _get_solution_point()

void maingo::lbp::LbpCplex::_get_solution_point ( std::vector< double > &  solution,
double &  etaVal 
)
protectedvirtual

Function for setting the solution to the solution point of the lastly solved LP.

Parameters
[in]solutionis modified to hold the solution point of the lastly solved LP
[in]etaValis modified to hold the value of eta variable of the lastly solved LP

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _modify_LP_for_feasopt_OBBT()

void maingo::lbp::LbpCplex::_modify_LP_for_feasopt_OBBT ( const double &  currentUBD,
std::list< unsigned > &  toTreatMax,
std::list< unsigned > &  toTreatMin 
)
protectedvirtual

Function modifying the LP for feasibility-optimality OBBT.

Parameters
[in]currentUBDis the current upper bound
[in,out]toTreatMaxis the list holding variables indices for maximization
[in,out]toTreatMinis the list holding variables indices for minimization

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _restore_LP_coefficients_after_OBBT()

void maingo::lbp::LbpCplex::_restore_LP_coefficients_after_OBBT ( )
protectedvirtual

Function for restoring proper coefficients and options in the LP after OBBT.

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _set_optimization_sense_of_variable()

void maingo::lbp::LbpCplex::_set_optimization_sense_of_variable ( const unsigned &  iVar,
const int &  optimizationSense 
)
protectedvirtual

Function for setting the optimization sense of variable iVar in OBBT.

Parameters
[in]iVaris the number of variable of which the optimization sense will be changed.
[in]optimizationSensedescribes whether the variable shall be maximized or minimized 1: minimize, 0: ignore, -1: maximize.

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _set_variable_bounds()

void maingo::lbp::LbpCplex::_set_variable_bounds ( const std::vector< double > &  lowerVarBounds,
const std::vector< double > &  upperVarBounds 
)
protectedvirtual

Function for setting the bounds of variables.

Parameters
[in]lowerVarBoundsis the vector holding the lower bounds of the variables
[in]upperVarBoundsis the vector holding the upper bounds of the variables

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _solve_LP()

void maingo::lbp::LbpCplex::_solve_LP ( const babBase::BabNode currentNode)
protectedvirtual

Function for solving the currently constructed linear program.

Parameters
[in]currentNodeis the currentNode, needed for throwing exceptions or obtaining the lower and upper bounds of variables

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _terminate_cplex()

void maingo::lbp::LbpCplex::_terminate_cplex ( )
private

Function for taking care of memory management by terminating Cplex (either called from destructor or when an exception is thrown)

◆ _turn_off_specific_options()

void maingo::lbp::LbpCplex::_turn_off_specific_options ( )
inlineprotectedvirtual

Function for checking if a specific option has to be turned off for a given lower bounding solver. We don't have to turn anything off for CPLEX.

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _update_LP_eq() [1/2]

void maingo::lbp::LbpCplex::_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 
)
protectedvirtual

Auxiliary function for updating LP equalities, i.e., processing the linearization of the equality ( CPLEX cannot work with coefficients >+1e19 or -1e19> )

Parameters
[in]resultRelaxationCvis the McCormick object holding relaxation of equality iEq at linearizationPoint used for the convex part
[in]resultRelaxationCcis the McCormick object holding relaxation of equality iEq at linearizationPoint used for the concave part
[in]linearizationPointis the vector holding the linearization point
[in]lowerVarBoundsis the vector holding the lower bounds of the variables
[in]upperVarBoundsis the vector holding the upper bounds of the variables
[in]iLinis the number of the linearization point
[in]iEqis the number of the equality function

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _update_LP_eq() [2/2]

void maingo::lbp::LbpCplex::_update_LP_eq ( const vMC resultRelaxationCvVMC,
const vMC resultRelaxationCcVMC,
const std::vector< std::vector< double >> &  linearizationPoint,
const std::vector< double > &  lowerVarBounds,
const std::vector< double > &  upperVarBounds,
unsigned const &  iEq 
)
protectedvirtual

Auxiliary function for updating LP equalities, i.e., processing the linearization of the equality for vector McCormick relaxations ( CPLEX cannot work with coefficients >+1e19 or -1e19> )

Parameters
[in]resultRelaxationCvVMCis the vector McCormick object holding relaxation of equality iEq at linearizationPoint used for the convex part
[in]resultRelaxationCcVMCis the vector McCormick object holding relaxation of equality iEq at linearizationPoint used for the concave part
[in]linearizationPointis the vector holding the linearization point
[in]lowerVarBoundsis the vector holding the lower bounds of the variables
[in]upperVarBoundsis the vector holding the upper bounds of the variables
[in]iEqis the number of the equality function

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _update_LP_eqRelaxationOnly() [1/2]

void maingo::lbp::LbpCplex::_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 
)
protectedvirtual

Auxiliary function for updating LP relaxation only equalities, i.e., processing the linearization of the relaxation only equality ( CPLEX cannot work with coefficients >+1e19 or -1e19> )

Parameters
[in]resultRelaxationCvis the McCormick object holding relaxation of relaxation only equality iEqRelaxationOnly at linearizationPoint used for the convex part
[in]resultRelaxationCcis the McCormick object holding relaxation of relaxation only equality iEqRelaxationOnly at linearizationPoint used for the concave part
[in]linearizationPointis the vector holding the linearization point
[in]lowerVarBoundsis the vector holding the lower bounds of the variables
[in]upperVarBoundsis the vector holding the upper bounds of the variables
[in]iLinis the number of the linearization point
[in]iEqRelaxationOnlyis the number of the relaxation only equality function

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _update_LP_eqRelaxationOnly() [2/2]

void maingo::lbp::LbpCplex::_update_LP_eqRelaxationOnly ( const vMC resultRelaxationCvVMC,
const vMC resultRelaxationCcVMC,
const std::vector< std::vector< double >> &  linearizationPoint,
const std::vector< double > &  lowerVarBounds,
const std::vector< double > &  upperVarBounds,
unsigned const &  iEqRelaxationOnly 
)
protectedvirtual

Auxiliary function for updating LP relaxation only equalities, i.e., processing the linearization of the relaxation only equality for vector McCormick relaxations ( CPLEX cannot work with coefficients >+1e19 or -1e19> )

Parameters
[in]resultRelaxationCvVMCis the vector McCormick object holding relaxation of relaxation only equality iEqRelaxationOnly at linearizationPoint used for the convex part
[in]resultRelaxationCcVMCis the vector McCormick object holding relaxation of relaxation only equality iEqRelaxationOnly at linearizationPoint used for the concave part
[in]linearizationPointis the vector holding the linearization point
[in]lowerVarBoundsis the vector holding the lower bounds of the variables
[in]upperVarBoundsis the vector holding the upper bounds of the variables
[in]iEqRelaxationOnlyis the number of the relaxation only equality function

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _update_LP_ineq() [1/2]

void maingo::lbp::LbpCplex::_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 
)
protectedvirtual

Auxiliary function for updating LP inequalities, i.e., processing the linearization of the inequality ( CPLEX cannot work with coefficients >+1e19 or -1e19> )

Parameters
[in]resultRelaxationis the McCormick object holding relaxation of inequality iIneq at linearizationPoint
[in]linearizationPointis the vector holding the linearization point
[in]lowerVarBoundsis the vector holding the lower bounds of the variables
[in]upperVarBoundsis the vector holding the upper bounds of the variables
[in]iLinis the number of the linearization point
[in]iIneqis the number of the inequality function

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _update_LP_ineq() [2/2]

void maingo::lbp::LbpCplex::_update_LP_ineq ( const vMC resultRelaxationVMC,
const std::vector< std::vector< double >> &  linearizationPoint,
const std::vector< double > &  lowerVarBounds,
const std::vector< double > &  upperVarBounds,
unsigned const &  iIneq 
)
protectedvirtual

Auxiliary function for updating LP inequalities, i.e., processing the linearization of the inequality for vector McCormick relaxations ( CPLEX cannot work with coefficients >+1e19 or -1e19> )

Parameters
[in]resultRelaxationVMCis the vector McCormick object holding relaxation of inequality iIneq at linearizationPoint
[in]linearizationPointis the vector holding the linearization point
[in]lowerVarBoundsis the vector holding the lower bounds of the variables
[in]upperVarBoundsis the vector holding the upper bounds of the variables
[in]iIneqis the number of the inequality function

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _update_LP_ineq_squash() [1/2]

void maingo::lbp::LbpCplex::_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 
)
protectedvirtual

Auxiliary function for updating LP squash inequalities, i.e., processing the linearization of the squash inequality ( CPLEX cannot work with coefficients >+1e19 or -1e19> ) No tolerances are allowed for squash inequalities!

Parameters
[in]resultRelaxationis the McCormick object holding relaxation of inequality iIneqSquash at linearizationPoint
[in]linearizationPointis the vector holding the linearization point
[in]lowerVarBoundsis the vector holding the lower bounds of the variables
[in]upperVarBoundsis the vector holding the upper bounds of the variables
[in]iLinis the number of the linearization point
[in]iIneqSquashis the number of the inequality function

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _update_LP_ineq_squash() [2/2]

void maingo::lbp::LbpCplex::_update_LP_ineq_squash ( const vMC resultRelaxationVMC,
const std::vector< std::vector< double >> &  linearizationPoint,
const std::vector< double > &  lowerVarBounds,
const std::vector< double > &  upperVarBounds,
unsigned const &  iIneqSquash 
)
protectedvirtual

Auxiliary function for updating LP squash inequalities, i.e., processing the linearization of the squash inequality for vector McCormick relaxations ( CPLEX cannot work with coefficients >+1e19 or -1e19> ) No tolerances are allowed for squash inequalities!

Parameters
[in]resultRelaxationVMCis the vector McCormick object holding relaxation of inequality iIneqSquash at linearizationPoint
[in]linearizationPointis the vector holding the linearization point
[in]lowerVarBoundsis the vector holding the lower bounds of the variables
[in]upperVarBoundsis the vector holding the upper bounds of the variables
[in]iIneqSquashis the number of the inequality function

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _update_LP_ineqRelaxationOnly() [1/2]

void maingo::lbp::LbpCplex::_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 
)
protectedvirtual

Auxiliary function for updating LP relaxation only inequalities, i.e., processing the linearization of the relaxation only inequality ( CPLEX cannot work with coefficients >+1e19 or -1e19> )

Parameters
[in]resultRelaxationis the McCormick object holding relaxation of relaxation only inequality iIneqRelaxationOnly at linearizationPoint
[in]linearizationPointis the vector holding the linearization point
[in]lowerVarBoundsis the vector holding the lower bounds of the variables
[in]upperVarBoundsis the vector holding the upper bounds of the variables
[in]iLinis the number of the linearization point
[in]iIneqRelaxationOnlyis the number of the relaxation only inequality function

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _update_LP_ineqRelaxationOnly() [2/2]

void maingo::lbp::LbpCplex::_update_LP_ineqRelaxationOnly ( const vMC resultRelaxationVMC,
const std::vector< std::vector< double >> &  linearizationPoint,
const std::vector< double > &  lowerVarBounds,
const std::vector< double > &  upperVarBounds,
unsigned const &  iIneqRelaxationOnly 
)
protectedvirtual

Auxiliary function for updating LP relaxation only inequalities, i.e., processing the linearization of the relaxation only inequality for vector McCormick relaxations ( CPLEX cannot work with coefficients >+1e19 or -1e19> )

Parameters
[in]resultRelaxationVMCis the vector McCormick object holding relaxation of relaxation only inequality iIneqRelaxationOnly at linearizationPoint
[in]linearizationPointis the vector holding the linearization point
[in]lowerVarBoundsis the vector holding the lower bounds of the variables
[in]upperVarBoundsis the vector holding the upper bounds of the variables
[in]iIneqRelaxationOnlyis the number of the relaxation only inequality function

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _update_LP_obj() [1/2]

void maingo::lbp::LbpCplex::_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 
)
protectedvirtual

Auxiliary function for updating LP objective, i.e., processing the linearization of the objective function ( CPLEX cannot work with coefficients >+1e19 or -1e19> )

Parameters
[in]resultRelaxationis the McCormick object holding relaxation of objective iObj at linearizationPoint
[in]linearizationPointis the vector holding the linearization point
[in]lowerVarBoundsis the vector holding the lower bounds of the variables
[in]upperVarBoundsis the vector holding the upper bounds of the variables
[in]iLinis the number of the linearization point
[in]iObjis the number of the objective function

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ _update_LP_obj() [2/2]

void maingo::lbp::LbpCplex::_update_LP_obj ( const vMC resultRelaxationVMC,
const std::vector< std::vector< double >> &  linearizationPoint,
const std::vector< double > &  lowerVarBounds,
const std::vector< double > &  upperVarBounds,
unsigned const &  iObj 
)
protectedvirtual

Auxiliary function for updating LP objective, i.e., processing the linearization of the objective function for vector McCormick relaxations ( CPLEX cannot work with coefficients >+1e19 or -1e19> )

Parameters
[in]resultRelaxationVMCis the vector McCormick object holding relaxation of objective iObj at linearizationPoint
[in]linearizationPointis the vector holding the linearization point
[in]lowerVarBoundsis the vector holding the lower bounds of the variables
[in]upperVarBoundsis the vector holding the upper bounds of the variables
[in]iObjis the number of the objective function

Reimplemented from maingo::lbp::LowerBoundingSolver.

◆ activate_more_scaling()

void maingo::lbp::LbpCplex::activate_more_scaling ( )
virtual

Function called by the B&B solver to heuristically activate more scaling in the LBS.

Reimplemented from maingo::lbp::LowerBoundingSolver.

Member Data Documentation

◆ cplex

IloCplex maingo::lbp::LbpCplex::cplex
private

CPLEX object

◆ cplxEnv

IloEnv maingo::lbp::LbpCplex::cplxEnv
private

CPLEX environment

◆ cplxModel

IloModel maingo::lbp::LbpCplex::cplxModel
private

CPLEX model

◆ cplxObjective

IloObjective maingo::lbp::LbpCplex::cplxObjective
private

CPLEX objective

◆ cplxVars

IloNumVarArray maingo::lbp::LbpCplex::cplxVars
private

CPLEX variables

◆ dualValsEq1

std::vector<IloNumArray> maingo::lbp::LbpCplex::dualValsEq1
private

auxiliary variable for optimality check

◆ dualValsEq2

std::vector<IloNumArray> maingo::lbp::LbpCplex::dualValsEq2
private

auxiliary variable for optimality check

◆ dualValsEqRelaxationOnly1

std::vector<IloNumArray> maingo::lbp::LbpCplex::dualValsEqRelaxationOnly1
private

auxiliary variable for optimality check

◆ dualValsEqRelaxationOnly2

std::vector<IloNumArray> maingo::lbp::LbpCplex::dualValsEqRelaxationOnly2
private

auxiliary variable for optimality check

◆ dualValsIneq

std::vector<IloNumArray> maingo::lbp::LbpCplex::dualValsIneq
private

auxiliary variable for optimality check

◆ dualValsIneqRelaxationOnly

std::vector<IloNumArray> maingo::lbp::LbpCplex::dualValsIneqRelaxationOnly
private

auxiliary variable for optimality check

◆ dualValsIneqSquash

std::vector<IloNumArray> maingo::lbp::LbpCplex::dualValsIneqSquash
private

auxiliary variable for optimality check

◆ dualValsObj

std::vector<IloNumArray> maingo::lbp::LbpCplex::dualValsObj
private

auxiliary variable for optimality check

◆ eta

IloNumVar maingo::lbp::LbpCplex::eta
private

auxiliary objective variable

◆ etaCoeff

double maingo::lbp::LbpCplex::etaCoeff
private

current coefficient of eta in the LP, needed for equilibration

◆ farkasCons

IloRangeArray maingo::lbp::LbpCplex::farkasCons
private

auxiliary variable for infeasibility check

◆ farkasVals

IloNumArray maingo::lbp::LbpCplex::farkasVals
private

auxiliary variable for infeasibility check

◆ linEq1

std::vector<IloRangeArray> maingo::lbp::LbpCplex::linEq1
private

convex part of linearized equality constraints

◆ linEq2

std::vector<IloRangeArray> maingo::lbp::LbpCplex::linEq2
private

concave part of linearized equality constraints

◆ linEqRelaxationOnly1

std::vector<IloRangeArray> maingo::lbp::LbpCplex::linEqRelaxationOnly1
private

convex part of linearized equality constraints for relaxation only

◆ linEqRelaxationOnly2

std::vector<IloRangeArray> maingo::lbp::LbpCplex::linEqRelaxationOnly2
private

convex part of linearized equality constraints for relaxation only

◆ linIneq

std::vector<IloRangeArray> maingo::lbp::LbpCplex::linIneq
private

linearized inequality constraints

◆ linIneqRelaxationOnly

std::vector<IloRangeArray> maingo::lbp::LbpCplex::linIneqRelaxationOnly
private

linearized inequality constraints for relaxation only

◆ linIneqSquash

std::vector<IloRangeArray> maingo::lbp::LbpCplex::linIneqSquash
private

linearized inequality constraints

◆ linObj

std::vector<IloRangeArray> maingo::lbp::LbpCplex::linObj
private

linearized objective function(s)


The documentation for this class was generated from the following file: