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:
00074 virtual void generateCuts(const OsiSolverInterface & si, OsiCuts & cs,
00075 const CglTreeInfo info = CglTreeInfo());
00076
00078 virtual void generateCuts(const OsiSolverInterface & si, OsiCuts & cs,
00079 const CglTreeInfo info = CglTreeInfo()) const;
00080
00082 virtual bool needsOptimalBasis() const;
00084
00085
00090 void setLimit(int limit);
00092 int getLimit() const;
00093
00098 void setAway(double value);
00100 double getAway() const;
00101
00105 void setLUB(double value);
00107 double getLUB() const;
00108
00111 void setEPS(double value);
00113 double getEPS() const;
00114
00117 void setEPS_COEFF(double value);
00119 double getEPS_COEFF() const;
00120
00124 void setEPS_COEFF_LUB(double value);
00126 double getEPS_COEFF_LUB() const;
00127
00131 void setEPS_RELAX(double value);
00133 double getEPS_RELAX() const;
00134
00137 void setNormIsZero(double value);
00139 double getNormIsZero() const;
00140
00143 void setMinReduc(double value);
00145 double getMinReduc() const;
00146
00152 void setMaxTab(double value);
00154 double getMaxTab() const;
00155
00161 void set_given_optsol(const double *given_sol, const int card_sol);
00162
00164 void print() const;
00165
00167 void printOptTab(OsiSolverInterface *solver) const;
00169
00172
00173 CglRedSplit ();
00174
00176 CglRedSplit (const CglRedSplit &);
00177
00179 virtual CglCutGenerator * clone() const;
00180
00182 CglRedSplit &
00183 operator=(
00184 const CglRedSplit& rhs);
00185
00187 virtual
00188 ~CglRedSplit ();
00190 virtual std::string generateCpp( FILE * fp);
00192
00193 private:
00194
00195
00196
00200
00201 inline double rs_above_integer(double value);
00202
00204 void update_pi_mat(int r1, int r2, int step);
00205
00207 void update_redTab(int r1, int r2, int step);
00208
00211 void find_step(int r1, int r2, int *step,
00212 double *reduc, double *norm);
00213
00216 int test_pair(int r1, int r2, double *norm);
00217
00219 void reduce_contNonBasicTab();
00220
00222 void generate_row(int index_row, double *row);
00223
00226 int generate_cgcut(double *row, double *rhs);
00227
00230 void eliminate_slacks(double *row,
00231 const CoinPackedMatrix *byRow,
00232 const double *rhs, double *rowrhs);
00233
00236 void flip(double *row);
00237
00242 void unflip(double *row, double *rowrhs,
00243 const double *colLower, const double *colUpper,
00244 double *slack_val);
00245
00247 int generate_packed_row(const OsiSolverInterface * solver,double *row,
00248 int *rowind, double *rowelem,
00249 int *card_row, double & rhs);
00250
00252 void check_optsol(const OsiSolverInterface *solver,
00253 const int calling_place,
00254 const double *xlp, const double *slack_val,
00255 const int do_flip);
00256
00258 void check_optsol(const OsiSolverInterface *solver,
00259 const int calling_place,
00260 const double *ck_row, const double ck_rhs,
00261 const int cut_number, const int do_flip);
00262
00264
00265
00266
00267
00271
00272 int nrow;
00273
00275 int ncol;
00276
00279 double LUB;
00280
00282 double EPS;
00283
00285 double EPS_COEFF;
00286
00289 double EPS_COEFF_LUB;
00290
00293 double EPS_RELAX;
00294
00297 double normIsZero;
00298
00301 double minReduc;
00302
00305 int card_intBasicVar_frac;
00306
00309 int card_intNonBasicVar;
00310
00313 int card_contNonBasicVar;
00314
00317 int card_nonBasicAtUpper;
00318
00321 int card_nonBasicAtLower;
00322
00325 int *cv_intBasicVar_frac;
00326
00329 int *intBasicVar_frac;
00330
00332 int *intNonBasicVar;
00333
00335
00336 int *contNonBasicVar;
00337
00340 int *nonBasicAtUpper;
00341
00344 int *nonBasicAtLower;
00345
00347 int mTab;
00348
00350 int nTab;
00351
00354 int **pi_mat;
00355
00359 double **contNonBasicTab;
00360
00363
00364 double **intNonBasicTab;
00365
00368 double *rhsTab ;
00369
00372 double away_;
00374 int limit_;
00375
00378 double maxTab_;
00379
00381 double *given_optsol;
00382
00384 int card_given_optsol;
00386 };
00387
00388 #endif