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 double *elements,
00239 const int *start,
00240 const int *indices,
00241 const int *rowLength,
00242 const double *rhs, double *rowrhs);
00243
00246 void flip(double *row);
00247
00252 void unflip(double *row, double *rowrhs,
00253 const double *colLower, const double *colUpper,
00254 double *slack_val);
00255
00257 int generate_packed_row(const OsiSolverInterface * solver,double *row,
00258 int *rowind, double *rowelem,
00259 int *card_row, double & rhs);
00260
00262 void check_optsol(const OsiSolverInterface *solver,
00263 const int calling_place,
00264 const double *xlp, const double *slack_val,
00265 const int do_flip);
00266
00268 void check_optsol(const OsiSolverInterface *solver,
00269 const int calling_place,
00270 const double *ck_row, const double ck_rhs,
00271 const int cut_number, const int do_flip);
00272
00274
00275
00276
00277
00281
00282 int nrow;
00283
00285 int ncol;
00286
00289 double LUB;
00290
00292 double EPS;
00293
00295 double EPS_COEFF;
00296
00299 double EPS_COEFF_LUB;
00300
00303 double EPS_RELAX;
00304
00307 double normIsZero;
00308
00311 double minReduc;
00312
00315 int card_intBasicVar_frac;
00316
00319 int card_intNonBasicVar;
00320
00323 int card_contNonBasicVar;
00324
00327 int card_nonBasicAtUpper;
00328
00331 int card_nonBasicAtLower;
00332
00335 int *cv_intBasicVar_frac;
00336
00339 int *intBasicVar_frac;
00340
00342 int *intNonBasicVar;
00343
00345
00346 int *contNonBasicVar;
00347
00350 int *nonBasicAtUpper;
00351
00354 int *nonBasicAtLower;
00355
00357 int mTab;
00358
00360 int nTab;
00361
00364 int **pi_mat;
00365
00369 double **contNonBasicTab;
00370
00373
00374 double **intNonBasicTab;
00375
00378 double *rhsTab ;
00379
00382 double away_;
00384 int limit_;
00385
00388 double maxTab_;
00389
00391 double *given_optsol;
00392
00394 int card_given_optsol;
00396 };
00397
00398 #endif