Go to the documentation of this file.
29 const std::string mpdDir);
61 virtual void generateCuts(
const OsiSolverInterface & si, OsiCuts & cs,
118 void setLUB(
double value);
124 void setEPS(
double value);
221 void find_step(
int r1,
int r2,
int *step,
222 double *reduc,
double *norm);
226 int test_pair(
int r1,
int r2,
double *norm);
245 const double *elements,
246 const CoinBigIndex *start,
248 const int *rowLength,
249 const double *rhs,
double *rowrhs);
253 void flip(
double *row);
259 void unflip(
double *row,
double *rowrhs,
double *slack_val);
272 int *rowind,
double *rowelem,
273 int *card_row,
double & rhs);
277 const double *
xlp,
const double *slack_val,
282 const double *
xlp,
const double *slack_val,
283 const double *ck_row,
const double ck_rhs,
284 const int cut_number,
const int do_flip);
298 const CoinPackedMatrix *mat2,
445 const std::string mpdDir );
void setLUB(double value)
Set the value of LUB, value considered large for the absolute value of a lower or upper bound on a va...
double getMaxTab() const
Get the value of maxTab.
void update_redTab(int r1, int r2, int step)
Perform row r1 of tab := row r1 of tab - step * row r2 of tab.
const char * colType
Pointer on column type. Reset by each call to generateCuts().
Information about where the cut generator is invoked from.
virtual CglCutGenerator * clone() const
Clone.
int test_pair(int r1, int r2, double *norm)
Test if an ordered pair of rows yields a reduction.
friend void CglRedSplitUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests the methods in the CglRedSplit class.
int generate_packed_row(const double *xlp, double *row, int *rowind, double *rowelem, int *card_row, double &rhs)
Generate the packed cut from the row representation.
const double * rowActivity
Pointer on row activity. Reset by each call to generateCuts().
void generate_row(int index_row, double *row)
Generate a row of the current LP tableau.
int card_intNonBasicVar
Number of integer non basic structural variables in the current lp solution.
const double * rowLower
Lower bounds for constraints.
int * intBasicVar_frac
List of integer structural basic variables (in order of pivot in selected rows for cut generation).
virtual std::string generateCpp(FILE *fp)
Create C++ lines to get to current state.
const double * xlp
Pointer on point to separate. Reset by each call to generateCuts().
bool rs_are_different_matrices(const CoinPackedMatrix *mat1, const CoinPackedMatrix *mat2, const int nmaj, const int nmin)
double rs_above_integer(double value)
Compute the fractional part of value, allowing for small error.
int ncol
Number of structural variables in the current LP.
double getAway() const
Get value of away.
double ** intNonBasicTab
Current tableau for integer non basic structural variables.
double * rhsTab
Right hand side of the tableau.
void compute_is_integer()
void setEPS_COEFF(double value)
Set the value of EPS_COEFF, epsilon for values of coefficients; Default: 1e-8.
void setMinReduc(double value)
Set the value of minReduc, threshold for relative norm improvement for performing a reduction; Defaul...
CglRedSplitParam param
Object with CglRedSplitParam members.
double ** contNonBasicTab
Current tableau for continuous non basic variables (structural or slack).
void setEPS_RELAX(double value)
Set the value of EPS_RELAX, value used for relaxing the right hand side of each generated cut; Defaul...
const double * colLower
Lower bounds for structural variables.
void print() const
Print some of the data members
bool rs_are_different_vectors(const int *vect1, const int *vect2, const int dim)
int card_nonBasicAtUpper
Number of non basic variables (structural or slack) at their upper bound in the current lp solution.
CglRedSplit()
Default constructor.
void reduce_contNonBasicTab()
Reduce rows of contNonBasicTab.
int ** pi_mat
Tableau of multipliers used to alter the rows used in generation.
Class collecting parameters the Reduced-and-split cut generator.
void find_step(int r1, int r2, int *step, double *reduc, double *norm)
Find optimal integer step for changing row r1 by adding to it a multiple of another row r2.
Cut Generator Base Class.
void update_pi_mat(int r1, int r2, int step)
Perform row r1 of pi := row r1 of pi - step * row r2 of pi.
double getEPS_COEFF() const
Get the value of EPS_COEFF.
const CoinPackedMatrix * byRow
Pointer on matrix of coefficient ordered by rows.
double getNormIsZero() const
Get the value of normIsZero.
int * nonBasicAtUpper
List of non basic variables (structural or slack) at their upper bound.
void flip(double *row)
Change the sign of the coefficients of the continuous non basic variables at their upper bound.
OsiSolverInterface * solver
Pointer on solver. Reset by each call to generateCuts().
int card_intBasicVar_frac
Number of integer basic structural variables that are fractional in the current lp solution (at least...
const double * colUpper
Upper bounds for structural variables.
const double * rowRhs
Righ hand side for constraints (upper bound for ranged constraints).
void printOptTab(OsiSolverInterface *solver) const
Print the current simplex tableau
void setEPS_COEFF_LUB(double value)
Set the value of EPS_COEFF_LUB, epsilon for values of coefficients for variables with absolute value ...
double getLUB() const
Get the value of LUB.
double getEPS() const
Get the value of EPS.
const double * rowUpper
Upper bounds for constraints.
void CglRedSplitUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests the methods in the CglRedSplit class.
void setEPS(double value)
Set the value of EPS, epsilon for double computations; Default: 1e-7.
CglRedSplitParam getParam() const
int * intNonBasicVar
List of integer structural non basic variables.
int mTab
Number of rows in the reduced tableau (= card_intBasicVar_frac).
virtual ~CglRedSplit()
Destructor.
int generate_cgcut_2(int basic_ind, double *row, double *rhs)
Generate a mixed integer Chvatal-Gomory cut, when all non basic variables are non negative and at the...
int * nonBasicAtLower
List of non basic variables (structural or slack) at their lower bound.
int card_nonBasicAtLower
Number of non basic variables (structural or slack) at their lower bound in the current lp solution.
double getEPS_COEFF_LUB() const
Get the value of EPS_COEFF_LUB.
void setMaxTab(double value)
Set the maximum allowed value for (mTab * mTab * CoinMax(mTab, nTab)) where mTab is the number of row...
int nrow
Number of rows ( = number of slack variables) in the current LP.
int generate_cgcut(double *row, double *rhs)
Generate a mixed integer Chvatal-Gomory cut, when all non basic variables are non negative and at the...
int nTab
Number of columns in the reduced tableau (= card_contNonBasicVar)
void setParam(const CglRedSplitParam &source)
void unflip(double *row, double *rowrhs, double *slack_val)
Change the sign of the coefficients of the continuous non basic variables at their upper bound and do...
double getMinReduc() const
Get the value of minReduc.
void set_given_optsol(const double *given_sol, const int card_sol)
Set given_optsol to the given optimal solution given_sol.
int card_contNonBasicVar
Number of continuous non basic variables (structural or slack) in the current lp solution.
void setNormIsZero(double value)
Set the value of normIsZero, the threshold for considering a norm to be 0; Default: 1e-5.
void setAway(double value)
Set away, the minimum distance from being integer used for selecting rows for cut generation; all row...
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())
Generate Reduce-and-Split Mixed Integer Gomory cuts for the model of the solver interface si.
void check_optsol(const int calling_place, const double *xlp, const double *slack_val, const int do_flip)
Check that the generated cuts do not cut a given optimal solution.
int * low_is_lub
Characteristic vector of the structural variables whose lower bound in absolute value is larger than ...
double getEPS_RELAX() const
Get the value of EPS_RELAX.
int * cv_intBasicVar_frac
Characteristic vector for integer basic structural variables with non integer value in the current lp...
CglRedSplit & operator=(const CglRedSplit &rhs)
Assignment operator.
int * contNonBasicVar
List of continuous non basic variables (structural or slack).
void setLimit(int limit)
Set limit, the maximum number of non zero coefficients in generated cut; Default: 50.
Gomory Reduce-and-Split Cut Generator Class; See method generateCuts().
const double * given_optsol
Given optimal solution that should not be cut; only for debug.
int getLimit() const
Get value of limit.
virtual bool needsOptimalBasis() const
Return true if needs optimal basis to do cuts (will return true)
int * is_integer
Characteristic vectors of structural integer variables or continuous variables currently fixed to int...
double row_scale_factor(double *row)
Return the scale factor for the row.
int card_given_optsol
Number of entries in given_optsol.
int * up_is_lub
Characteristic vector of the structural variables whose upper bound in absolute value is larger than ...
void eliminate_slacks(double *row, const double *elements, const CoinBigIndex *start, const int *indices, const int *rowLength, const double *rhs, double *rowrhs)
Use multiples of the initial inequalities to cancel out the coefficients of the slack variables.