Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

CglProbing.hpp

00001 // Copyright (C) 2002, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 #ifndef CglProbing_H
00004 #define CglProbing_H
00005 
00006 #include <string>
00007 
00008 #include "CglCutGenerator.hpp"
00009 
00011 class CglProbing : public CglCutGenerator {
00012    friend void CglProbingUnitTest(const OsiSolverInterface * siP,
00013                                   const std::string mpdDir );
00014  
00015 public:
00016     
00017   
00085   virtual void generateCuts( const OsiSolverInterface & si, 
00086                              OsiCuts & cs) const;
00087   int generateCutsAndModify( const OsiSolverInterface & si, 
00088                              OsiCuts & cs);
00090 
00093 
00094 
00095 
00096 
00097 
00098   void snapshot ( const OsiSolverInterface & si,
00099                   char * possible=NULL);
00101 
00104 
00105   void deleteSnapshot ( );
00107 
00110 
00111   const double * tightLower() const;
00113   const double * tightUpper() const;
00115 
00118 
00119   const double * relaxedRowLower() const;
00121   const double * relaxedRowUpper() const;
00123 
00126 
00127   void setMode(int mode);
00129   int getMode() const;
00131 
00134 
00135   void setMaxPass(int value);
00137   int getMaxPass() const;
00139   void setMaxProbe(int value);
00141   int getMaxProbe() const;
00143   void setMaxLook(int value);
00145   int getMaxLook() const;
00147 
00150 
00151 
00152   void setRowCuts(int type);
00154   int rowCuts() const;
00156 
00159 
00160   void setUsingObjective(bool yesNo);
00162   int getUsingObjective() const;
00164 
00167 
00168   CglProbing ();
00169  
00171   CglProbing (
00172     const CglProbing &);
00173 
00175   CglProbing &
00176     operator=(
00177     const CglProbing& rhs);
00178   
00180   virtual
00181     ~CglProbing ();
00182 
00184   virtual void refreshSolver(OsiSolverInterface * solver);
00186       
00187 private:
00188   
00189  // Private member methods
00192 
00193   int probe( const OsiSolverInterface & si, 
00194              const OsiRowCutDebugger * debugger, 
00195              OsiCuts & cs, 
00196              double * colLower, double * colUpper, CoinPackedMatrix *rowCopy,
00197              double * rowLower, double * rowUpper,
00198              char * intVar, double * minR, double * maxR, int * markR, 
00199              int * look, int nlook) const;
00202   int gutsOfGenerateCuts( const OsiSolverInterface & si, 
00203                           OsiCuts & cs,
00204                           double * rowLower, double * rowUpper,
00205                           double * colLower, double * colUpper) const;
00207 
00208   // Private member data
00209 
00212 
00213   CoinPackedMatrix * rowCopy_;
00215   double * rowLower_;
00217   double * rowUpper_;
00219   double * colLower_;
00221   double * colUpper_;
00223   int numberRows_;
00225   int numberColumns_;
00227   double primalTolerance_;
00229   int mode_;
00232   int rowCuts_;
00234   int maxPass_;
00236   int maxProbe_;
00238   int maxStack_;
00240   bool usingObjective_;
00242   int numberIntegers_;
00244   typedef struct{
00245     int sequence; // integer variable
00246     // newValue will be NULL if no probing done yet
00247     // lastLBWhenAt1 gives length of newValue;
00248     int lastUBWhenAt0; // last UB changed when integer at lb 
00249     int lastLBWhenAt0; // last LB changed when integer at lb
00250     int lastUBWhenAt1; // last UB changed when integer at ub
00251     int lastLBWhenAt1; // last LB changed when integer at ub
00252     int * index; // columns whose bounds will be changed
00253     double * newValue; // new values 
00254   } disaggregation;
00255   disaggregation * cutVector_;
00257 };
00258 
00259 //#############################################################################
00265 void CglProbingUnitTest(const OsiSolverInterface * siP,
00266                         const std::string mpdDir );
00267   
00268 #endif

Generated on Wed Dec 3 14:34:55 2003 for Cgl by doxygen 1.3.5