13 #ifndef CglRedSplit2_H 14 #define CglRedSplit2_H 18 #include "CoinWarmStartBasis.hpp" 19 #include "CoinHelperFunctions.hpp" 20 #include "CoinTime.hpp" 34 const std::string mpdDir);
81 virtual void generateCuts(
const OsiSolverInterface & si, OsiCuts & cs,
99 int maxNumMultipliers,
int* basicVariables = NULL,
119 int tiltLandPcut(
const OsiSolverInterface* si,
double* row,
120 double rowRhs,
int rownumber,
const double* xbar,
121 const int* newnonbasics, OsiRowCut* cs,
int* lambda = NULL);
138 void printOptTab(OsiSolverInterface *solver)
const;
177 int generateCuts(OsiCuts* cs,
int maxNumCuts,
int* lambda = NULL);
180 inline double rs_above_integer(
const double value)
const;
189 strategy,
const int* ignore_list = NULL);
195 void fill_workNonBasicTab(
const int* newnonbasics,
const double* xbar,
201 void reduce_workNonBasicTab(
int numRows,
203 rowSelectionStrategy,
209 void generate_row(
int index_row,
double *row);
213 int generate_cgcut(
double *row,
double *rhs);
217 void eliminate_slacks(
double *row,
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);
239 int check_dynamism(
double *row);
242 int generate_packed_row(
const double *xlp,
double *row,
243 int *rowind,
double *rowelem,
244 int *card_row,
double & rhs);
247 void compute_is_integer();
250 bool rs_are_different_vectors(
const int *vect1,
255 void rs_allocmatINT(
int ***v,
int m,
int n);
257 void rs_deallocmatINT(
int ***v,
int m);
259 void rs_allocmatDBL(
double ***v,
int m,
int n);
261 void rs_deallocmatDBL(
double ***v,
int m);
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;
282 double compute_norm_change(
double oldnorm,
const int* listOfRows,
283 int numElemList,
const double* multipliers)
const;
286 int get_list_rows_reduction(
int rowIndex,
int numRowsReduction,
287 int* list,
const double* norm,
289 rowSelectionStrategy)
const;
296 int sort_rows_by_nonzeroes(
struct sortElement* array,
int rowIndex,
297 int maxRows,
int whichTab)
const;
301 int sort_rows_by_nonzeroes_greedy(
struct sortElement* array,
int rowIndex,
302 int maxRows,
int whichTab)
const;
310 int sort_rows_by_cosine(
struct sortElement* array,
int rowIndex,
311 int maxRows,
int whichTab)
const;
314 inline bool checkTime()
const{
315 if ((CoinCpuTime() - startTime) < param.
getTimeLimit()){
343 const double *colLower;
346 const double *colUpper;
349 const double *rowLower;
352 const double *rowUpper;
355 const double *rowRhs;
358 const double *reducedCost;
361 const double *rowPrice;
364 const double* objective;
367 int card_intBasicVar;
371 int card_intBasicVar_frac;
375 int card_intNonBasicVar;
379 int card_contNonBasicVar;
383 int card_workNonBasicVar;
387 int card_nonBasicAtUpper;
391 int card_nonBasicAtLower;
398 int *cv_intBasicVar_frac;
410 int *intBasicVar_frac;
417 int *contNonBasicVar;
421 int *nonBasicAtUpper;
425 int *nonBasicAtLower;
440 double **contNonBasicTab;
445 double **workNonBasicTab;
450 double **intNonBasicTab;
464 OsiSolverInterface *solver;
470 const double *rowActivity;
474 const CoinPackedMatrix *byRow;
491 const std::string mpdDir );
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...
friend void CglRedSplit2UnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests some of the methods in the CglRedSplit2 class.
Class collecting parameters the Reduced-and-split cut generator.
Information about where the cut generator is invoked from.
ColumnScalingStrategy
Scaling strategies for new nonbasic columns for Lift & Project; "factor" is the value of columnScalin...
void print() const
Print some of the data members; used for debugging.
double getTimeLimit() const
get the value
CglRedSplit2 & operator=(const CglRedSplit2 &rhs)
Assignment operator.
CglRedSplit2Param & getParam()
int tiltLandPcut(const OsiSolverInterface *si, double *row, double rowRhs, int rownumber, const double *xbar, const int *newnonbasics, OsiRowCut *cs, int *lambda=NULL)
Reduce-and-Split Cut Generator Class; See method generateCuts().
ColumnSelectionStrategy
Column selection strategies; again, look them up in the paper.
Cut Generator Base Class.
CglRedSplit2()
Default constructor.
virtual CglCutGenerator * clone() const
Clone.
int generateMultipliers(const OsiSolverInterface &si, int *lambda, int maxNumMultipliers, int *basicVariables=NULL, OsiCuts *cs=NULL)
virtual ~CglRedSplit2()
Destructor.
virtual bool needsOptimalBasis() const
Return true if needs optimal basis to do cuts (will return true)
void printOptTab(OsiSolverInterface *solver) const
Print the current simplex tableau.
RowSelectionStrategy
Enumerations for parameters.
void setParam(const CglRedSplit2Param &source)