00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00017 #ifndef CglRedSplit_H
00018 #define CglRedSplit_H
00019
00020 #include "CglCutGenerator.hpp"
00021
00022 class CglRedSplit : public CglCutGenerator {
00023
00024 public:
00081 virtual void generateCuts(const OsiSolverInterface & si, OsiCuts & cs,
00082 const CglTreeInfo info = CglTreeInfo());
00083
00085 virtual void generateCuts(const OsiSolverInterface & si, OsiCuts & cs,
00086 const CglTreeInfo info = CglTreeInfo()) const;
00087
00089 virtual bool needsOptimalBasis() const;
00091
00092
00097 void setLimit(int limit);
00099 int getLimit() const;
00100
00105 void setAway(double value);
00107 double getAway() const;
00108
00112 void setLUB(double value);
00114 double getLUB() const;
00115
00118 void setEPS(double value);
00120 double getEPS() const;
00121
00124 void setEPS_COEFF(double value);
00126 double getEPS_COEFF() const;
00127
00131 void setEPS_COEFF_LUB(double value);
00133 double getEPS_COEFF_LUB() const;
00134
00138 void setEPS_RELAX(double value);
00140 double getEPS_RELAX() const;
00141
00144 void setNormIsZero(double value);
00146 double getNormIsZero() const;
00147
00150 void setMinReduc(double value);
00152 double getMinReduc() const;
00153
00159 void setMaxTab(double value);
00161 double getMaxTab() const;
00162
00168 void set_given_optsol(const double *given_sol, const int card_sol);
00169
00171 void print() const;
00172
00174 void printOptTab(OsiSolverInterface *solver) const;
00176
00179
00180 CglRedSplit ();
00181
00183 CglRedSplit (const CglRedSplit &);
00184
00186 virtual CglCutGenerator * clone() const;
00187
00189 CglRedSplit &
00190 operator=(
00191 const CglRedSplit& rhs);
00192
00194 virtual
00195 ~CglRedSplit ();
00197 virtual std::string generateCpp( FILE * fp);
00199
00200 private:
00201
00202
00203
00207
00208 inline double rs_above_integer(double value);
00209
00211 void update_pi_mat(int r1, int r2, int step);
00212
00214 void update_redTab(int r1, int r2, int step);
00215
00218 void find_step(int r1, int r2, int *step,
00219 double *reduc, double *norm);
00220
00223 int test_pair(int r1, int r2, double *norm);
00224
00226 void reduce_contNonBasicTab();
00227
00229 void generate_row(int index_row, double *row);
00230
00233 int generate_cgcut(double *row, double *rhs);
00234
00237 void eliminate_slacks(double *row,
00238 const CoinPackedMatrix *byRow,
00239 const double *rhs, double *rowrhs);
00240
00243 void flip(double *row);
00244
00249 void unflip(double *row, double *rowrhs,
00250 const double *colLower, const double *colUpper,
00251 double *slack_val);
00252
00254 int generate_packed_row(const OsiSolverInterface * solver,double *row,
00255 int *rowind, double *rowelem,
00256 int *card_row, double & rhs);
00257
00259 void check_optsol(const OsiSolverInterface *solver,
00260 const int calling_place,
00261 const double *xlp, const double *slack_val,
00262 const int do_flip);
00263
00265 void check_optsol(const OsiSolverInterface *solver,
00266 const int calling_place,
00267 const double *ck_row, const double ck_rhs,
00268 const int cut_number, const int do_flip);
00269
00271
00272
00273
00274
00278
00279 int nrow;
00280
00282 int ncol;
00283
00286 double LUB;
00287
00289 double EPS;
00290
00292 double EPS_COEFF;
00293
00296 double EPS_COEFF_LUB;
00297
00300 double EPS_RELAX;
00301
00304 double normIsZero;
00305
00308 double minReduc;
00309
00312 int card_intBasicVar_frac;
00313
00316 int card_intNonBasicVar;
00317
00320 int card_contNonBasicVar;
00321
00324 int card_nonBasicAtUpper;
00325
00328 int card_nonBasicAtLower;
00329
00332 int *cv_intBasicVar_frac;
00333
00336 int *intBasicVar_frac;
00337
00339 int *intNonBasicVar;
00340
00342
00343 int *contNonBasicVar;
00344
00347 int *nonBasicAtUpper;
00348
00351 int *nonBasicAtLower;
00352
00354 int mTab;
00355
00357 int nTab;
00358
00361 int **pi_mat;
00362
00366 double **contNonBasicTab;
00367
00370
00371 double **intNonBasicTab;
00372
00375 double *rhsTab ;
00376
00379 double away_;
00381 int limit_;
00382
00385 double maxTab_;
00386
00388 double *given_optsol;
00389
00391 int card_given_optsol;
00393 };
00394
00395 #endif