13 #ifndef CglRedSplit2_H
14 #define CglRedSplit2_H
34 const std::string mpdDir);
99 int maxNumMultipliers,
int* basicVariables = NULL,
120 double rowRhs,
int rownumber,
const double* xbar,
121 const int* newnonbasics,
OsiRowCut* cs,
int* lambda = NULL);
189 strategy,
const int* ignore_list = NULL);
203 rowSelectionStrategy,
218 const double *elements,
221 const int *rowLength,
222 const double *rhs,
double *rowrhs);
226 void flip(
double *row);
232 void unflip(
double *row,
double *rowrhs);
243 int *rowind,
double *rowelem,
244 int *card_row,
double & rhs);
263 void rs_printvecINT(
const char *vecstr,
const int *x,
int n)
const;
265 void rs_printvecDBL(
const char *vecstr,
const double *x,
int n)
const;
267 void rs_printmatINT(
const char *vecstr,
const int *
const *x,
int m,
int n)
const;
269 void rs_printmatDBL(
const char *vecstr,
const double *
const *x,
int m,
int n)
const;
271 double rs_dotProd(
const double *u,
const double *v,
int dim)
const;
272 double rs_dotProd(
const int *u,
const double *v,
int dim)
const;
274 int ludcmp(
double **a,
int n,
int *indx,
double *d,
double* vv)
const;
276 void lubksb(
double **a,
int n,
int *indx,
double *b)
const;
283 int numElemList,
const double* multipliers)
const;
287 int* list,
const double*
norm,
289 rowSelectionStrategy)
const;
297 int maxRows,
int whichTab)
const;
302 int maxRows,
int whichTab)
const;
311 int maxRows,
int whichTab)
const;
491 const std::string mpdDir );
int nrow
Number of rows ( = number of slack variables) in the current LP.
int * intBasicVar_frac
List of integer structural basic variables with fractional value (in order of pivot in selected rows ...
void rs_printvecDBL(const char *vecstr, const double *x, int n) const
int * cv_intBasicVar
Characteristic vector for integer basic structural variables.
const double * objective
Objective coefficients.
int * intBasicVar
List of integer structural basic variables (in order of pivot in selected rows for cut generation)...
void rs_printmatINT(const char *vecstr, const int *const *x, int m, int n) const
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 rs_deallocmatDBL(double ***v, int m)
int card_intBasicVar_frac
Number of integer basic structural variables that are fractional in the current lp solution (at least...
friend void CglRedSplit2UnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests some of the methods in the CglRedSplit2 class.
int card_intBasicVar
Number of integer basic structural variables.
void compute_is_integer()
double * norm
Norm of rows in workNonBasicTab; needed for faster computations.
int * nonBasicAtLower
List of non basic variables (structural or slack) at their lower bound.
int ncol
Number of structural variables in the current LP.
void printOptTab(OsiSolverInterface *solver) const
Print the current simplex tableau.
void reduce_workNonBasicTab(int numRows, CglRedSplit2Param::RowSelectionStrategy rowSelectionStrategy, int maxIterations)
Reduce rows of workNonBasicTab, i.e.
Class collecting parameters the Reduced-and-split cut generator.
double ** workNonBasicTab
Current tableau for continuous non basic variables (structural or slack).
int check_dynamism(double *row)
Returns 1 if the row has acceptable max/min coeff ratio.
virtual CglCutGenerator * clone() const
Clone.
Information about where the cut generator is invoked from.
const double * rowLower
Lower bounds for constraints.
Collections of row cuts and column cuts.
ColumnScalingStrategy
Scaling strategies for new nonbasic columns for Lift & Project; "factor" is the value of columnScalin...
int card_nonBasicAtLower
Number of non basic variables (structural or slack) at their lower bound in the current lp solution...
void rs_allocmatDBL(double ***v, int m, int n)
int * intNonBasicVar
List of integer structural non basic variables.
CglRedSplit2 & operator=(const CglRedSplit2 &rhs)
Assignment operator.
static double CoinCpuTime()
const double * colUpper
Upper bounds for structural variables.
int * nonBasicAtUpper
List of non basic variables (structural or slack) at their upper bound.
CglRedSplit2Param & getParam()
int tiltLandPcut(const OsiSolverInterface *si, double *row, double rowRhs, int rownumber, const double *xbar, const int *newnonbasics, OsiRowCut *cs, int *lambda=NULL)
bool rs_are_different_vectors(const int *vect1, const int *vect2, const int dim)
Abstract Base Class for describing an interface to a solver.
void unflip(double *row, double *rowrhs)
Change the sign of the coefficients of the continuous non basic variables at their upper bound and do...
Reduce-and-Split Cut Generator Class; See method generateCuts().
const double * xlp
Pointer on point to separate. Reset by each call to generateCuts().
int sort_rows_by_nonzeroes(struct sortElement *array, int rowIndex, int maxRows, int whichTab) const
int ludcmp(double **a, int n, int *indx, double *d, double *vv) const
double startTime
Time at which cut computations began.
ColumnSelectionStrategy
Column selection strategies; again, look them up in the paper.
int * cv_intBasicVar_frac
Characteristic vector for integer basic structural variables with non integer value in the current lp...
int sort_rows_by_cosine(struct sortElement *array, int rowIndex, int maxRows, int whichTab) const
Cut Generator Base Class.
void rs_printvecINT(const char *vecstr, const int *x, int n) const
int get_list_rows_reduction(int rowIndex, int numRowsReduction, int *list, const double *norm, CglRedSplit2Param::RowSelectionStrategy rowSelectionStrategy) const
int mTab
Number of rows in the reduced tableau (= card_intBasicVar).
double getTimeLimit() const
get the value
CglRedSplit2()
Default constructor.
void rs_printmatDBL(const char *vecstr, const double *const *x, int m, int n) const
double compute_norm_change(double oldnorm, const int *listOfRows, int numElemList, const double *multipliers) const
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.
Sparse Matrix Base Class.
int card_intNonBasicVar
Number of integer non basic structural variables in the current lp solution.
int nTab
Number of columns in the reduced tableau (= card_contNonBasicVar)
int * cv_fracRowsTab
Characteristic vector for rows of the tableau selected for reduction with non integer value in the cu...
int generate_cgcut(double *row, double *rhs)
Generate a mixed integer Gomory cut, when all non basic variables are non negative and at their lower...
const double * colLower
Lower bounds for structural variables.
CglRedSplit2Param param
Object with CglRedSplit2Param members.
int * contNonBasicVar
List of continuous non basic variables (structural or slack).
double ** intNonBasicTab
Simplex tableau for integer non basic structural variables.
int card_workNonBasicVar
Number of continuous non basic variables (structural or slack) in the current working set for coeffic...
void CglRedSplit2UnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests some of the methods in the CglRedSplit2 class.
void rs_allocmatINT(int ***v, int m, int n)
double * rhsTab
Right hand side of the tableau.
void lubksb(double **a, int n, int *indx, double *b) const
int numRedRows
Number of rows which have been reduced.
OsiSolverInterface * solver
Pointer on solver. Reset by each call to generateCuts().
void fill_workNonBasicTab(CglRedSplit2Param::ColumnSelectionStrategy strategy, const int *ignore_list=NULL)
Fill workNonBasicTab, depending on the column selection strategy.
const double * reducedCost
Reduced costs for columns.
void rs_deallocmatINT(int ***v, int m)
double rs_dotProd(const double *u, const double *v, int dim) const
const double * rowUpper
Upper bounds for constraints.
const double * rowActivity
Pointer on row activity. Reset by each call to generateCuts().
void generate_row(int index_row, double *row)
Generate a linear combination of the rows of the current LP tableau, using the row multipliers stored...
double rs_above_integer(const double value) const
Compute the fractional part of value, allowing for small error.
const CoinPackedMatrix * byRow
Pointer on matrix of coefficient ordered by rows.
int generateMultipliers(const OsiSolverInterface &si, int *lambda, int maxNumMultipliers, int *basicVariables=NULL, OsiCuts *cs=NULL)
virtual ~CglRedSplit2()
Destructor.
int card_nonBasicAtUpper
Number of non basic variables (structural or slack) at their upper bound in the current lp solution...
int card_contNonBasicVar
Number of continuous non basic variables (structural or slack) in the current lp solution.
int ** pi_mat
Tableau of multipliers used to alter the rows used in generation.
const double * rowPrice
Row price.
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...
const double * rowRhs
Righ hand side for constraints (upper bound for ranged constraints).
virtual bool needsOptimalBasis() const
Return true if needs optimal basis to do cuts (will return true)
void flip(double *row)
Change the sign of the coefficients of the continuous non basic variables at their upper bound...
RowSelectionStrategy
Enumerations for parameters.
double ** contNonBasicTab
Simplex tableau for continuous non basic variables (structural or slack).
int * is_integer
Characteristic vectors of structural integer variables or continuous variables currently fixed to int...
void setParam(const CglRedSplit2Param &source)
void print() const
Print some of the data members; used for debugging.
int sort_rows_by_nonzeroes_greedy(struct sortElement *array, int rowIndex, int maxRows, int whichTab) const