Ignore:
Timestamp:
Nov 5, 2009 10:57:25 AM (10 years ago)
Author:
forrest
Message:

Creating new stable branch 2.4 from trunk (rev 1270)

Location:
stable/2.4
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable/2.4

    • Property svn:externals
      •  

        old new  
        77CoinUtils         https://projects.coin-or.org/svn/CoinUtils/stable/2.5/CoinUtils
        88Cgl               https://projects.coin-or.org/svn/Cgl/stable/0.54/Cgl
        9 Clp               https://projects.coin-or.org/svn/Clp/stable/1.10/Clp
         9Clp               https://projects.coin-or.org/svn/Clp/stable/1.11/Clp
        1010Osi               https://projects.coin-or.org/svn/Osi/stable/0.100/Osi
        1111Vol               https://projects.coin-or.org/svn/Vol/stable/1.1/Vol
  • stable/2.4/Cbc/src/CbcCutGenerator.hpp

    r1132 r1271  
     1/* $Id$ */
    12// Copyright (C) 2003, International Business Machines
    23// Corporation and others.  All Rights Reserved.
     
    5556    \p cs.
    5657
    57     If \p fullScan is >0, the generator is obliged to call the CGL
     58    If \p fullScan is !=0, the generator is obliged to call the CGL
    5859    \c generateCuts routine.  Otherwise, it is free to make a local decision.
     60    Negative fullScan says things like at integer solution
    5961    The current implementation uses \c whenCutGenerator_ to decide.
    6062
     
    104106  { return generatorName_;}
    105107
     108  /// Create C++ lines to show how to tune
     109  void generateTuning( FILE * fp);
    106110  /** Set the cut generation interval
    107111
     
    155159  /// Get whether the cut generator should be called in the normal place
    156160  inline bool normal() const
    157   { return normal_;}
     161  { return (switches_&1)!=0;}
    158162  /// Set whether the cut generator should be called in the normal place
    159163  inline void setNormal(bool value)
    160   { normal_=value;}
     164  { switches_&=~1;switches_ |= value ? 1 : 0;}
    161165  /// Get whether the cut generator should be called when a solution is found
    162166  inline bool atSolution() const
    163   { return atSolution_;}
     167  { return (switches_&2)!=0;}
    164168  /// Set whether the cut generator should be called when a solution is found
    165169  inline void setAtSolution(bool value)
    166   { atSolution_=value;}
     170  { switches_&=~2;switches_ |= value ? 2 : 0;}
    167171  /** Get whether the cut generator should be called when the subproblem is
    168172      found to be infeasible.
    169173  */
    170174  inline bool whenInfeasible() const
    171   { return whenInfeasible_;}
     175  { return (switches_&4)!=0;}
    172176  /** Set whether the cut generator should be called when the subproblem is
    173177      found to be infeasible.
    174178  */
    175179  inline void setWhenInfeasible(bool value)
    176   { whenInfeasible_=value;}
     180  { switches_&=~4;switches_ |= value ? 4 : 0;}
    177181  /// Get whether the cut generator is being timed
    178182  inline bool timing() const
    179   { return timing_;}
     183  { return (switches_&64)!=0;}
    180184  /// Set whether the cut generator is being timed
    181185  inline void setTiming(bool value)
    182   { timing_=value; timeInCutGenerator_=0.0;}
     186  { switches_&=~64;switches_ |= value ? 64 : 0; timeInCutGenerator_=0.0;}
    183187  /// Return time taken in cut generator
    184188  inline double timeInCutGenerator() const
     
    203207  inline void incrementNumberCutsInTotal(int value=1)
    204208  { numberCuts_ += value;}
     209  /// Total number of elements added
     210  inline int numberElementsInTotal() const
     211  { return numberElements_;}
     212  inline void setNumberElementsInTotal(int value)
     213  { numberElements_ = value;}
     214  inline void incrementNumberElementsInTotal(int value=1)
     215  { numberElements_ += value;}
    205216  /// Total number of column cuts
    206217  inline int numberColumnCuts() const
     
    223234  /// Say if optimal basis needed
    224235  inline bool needsOptimalBasis() const
    225   { return generator_->needsOptimalBasis();}
     236  { return (switches_&128)!=0;}
     237  /// Set if optimal basis needed
     238  inline void setNeedsOptimalBasis(bool yesNo)
     239  { switches_&=~128;switches_ |= yesNo ? 128 : 0;}
    226240  /// Whether generator MUST be called again if any cuts (i.e. ignore break from loop)
    227241  inline bool mustCallAgain() const
    228   { return mustCallAgain_;}
     242  { return (switches_&8)!=0;}
    229243  /// Set whether generator MUST be called again if any cuts (i.e. ignore break from loop)
    230244  inline void setMustCallAgain(bool yesNo)
    231   { mustCallAgain_=yesNo;}
     245  { switches_&=~8;switches_ |= yesNo ? 8 : 0;}
    232246  /// Whether generator switched off for moment
    233247  inline bool switchedOff() const
    234   { return switchedOff_;}
     248  { return (switches_&16)!=0;}
    235249  /// Set whether generator switched off for moment
    236250  inline void setSwitchedOff(bool yesNo)
    237   { switchedOff_=yesNo;}
     251  { switches_&=~16;switches_ |= yesNo ? 16 : 0;}
     252  /// Whether last round of cuts did little
     253  inline bool ineffectualCuts() const
     254  { return (switches_&512)!=0;}
     255  /// Set whether last round of cuts did little
     256  inline void setIneffectualCuts(bool yesNo)
     257  { switches_&=~512;switches_ |= yesNo ? 512 : 0;}
     258  /// Whether to use if any cuts generated
     259  inline bool whetherToUse() const
     260  { return (switches_&1024)!=0;}
     261  /// Set whether to use if any cuts generated
     262  inline void setWhetherToUse(bool yesNo)
     263  { switches_&=~1024;switches_ |= yesNo ? 1024 : 0;}
    238264  /// Number of cuts generated at root
    239265  inline int numberCutsAtRoot() const
     
    246272  inline void setNumberActiveCutsAtRoot(int value)
    247273  { numberActiveCutsAtRoot_ = value;}
     274  /// Number of short cuts at root
     275  inline int numberShortCutsAtRoot() const
     276  { return numberShortCutsAtRoot_;}
    248277  /// Set model
    249278  inline void setModel(CbcModel * model)
     
    252281 
    253282private:
     283  /**@name Private gets and sets */
     284  //@{
     285  /// Whether global cuts at root
     286  inline bool globalCutsAtRoot() const
     287  { return (switches_&32)!=0;}
     288  /// Set whether global cuts at root
     289  inline void setGlobalCutsAtRoot(bool yesNo)
     290  { switches_&=~32;switches_ |= yesNo ? 32 : 0;}
     291  /// Whether global cuts
     292  inline bool globalCuts() const
     293  { return (switches_&256)!=0;}
     294  /// Set whether global cuts
     295  inline void setGlobalCuts(bool yesNo)
     296  { switches_&=~256;switches_ |= yesNo ? 256 : 0;}
     297  //@}
     298  /// Saved cuts
     299  OsiCuts savedCuts_;
     300  /// Time in cut generator
     301  double timeInCutGenerator_;
    254302  /// The client model
    255   CbcModel *model_;
     303  CbcModel *model_; 
    256304
    257305  // The CglCutGenerator object
    258306  CglCutGenerator * generator_;
     307
     308  /// Name of generator
     309  char * generatorName_;
    259310
    260311  /** Number of nodes between calls to the CglCutGenerator::generateCuts
     
    281332  int depthCutGeneratorInSub_;
    282333
    283   /// Name of generator
    284   char * generatorName_;
    285 
    286   /// Whether to call the generator in the normal place
    287   bool normal_;
    288 
    289   /// Whether to call the generator when a new solution is found
    290   bool atSolution_;
    291 
    292   /// Whether to call generator when a subproblem is found to be infeasible
    293   bool whenInfeasible_;
    294   /// Whether generator MUST be called again if any cuts (i.e. ignore break from loop)
    295   bool mustCallAgain_;
    296   /// Temporary switch off marker
    297   bool switchedOff_;
    298   /// Create global cuts (at root)
    299   bool globalCutsAtRoot_;
    300   /// Whether call generator being timed
    301   bool timing_;
    302   /// Time in cut generator
    303   double timeInCutGenerator_;
    304334  /// Level of cut inaccuracy (0 means exact e.g. cliques)
    305335  int inaccuracy_;
     
    308338  /// Total number of cuts added
    309339  int numberCuts_;
     340  /// Total number of elements added
     341  int numberElements_;
    310342  /// Total number of column cuts added
    311343  int numberColumnCuts_;
     
    316348  /// Number of cuts active at root
    317349  int numberActiveCutsAtRoot_;
     350  /// Number of short cuts at root
     351  int numberShortCutsAtRoot_;
     352  /// Switches - see gets and sets
     353  int switches_;
    318354};
    319355/** Abstract cut modifier base class
     
    350386  virtual int modify(const OsiSolverInterface * solver, OsiRowCut & cut) =0;
    351387  /// Create C++ lines to get to current state
    352   virtual void generateCpp( FILE * fp) {}
     388  virtual void generateCpp( FILE * ) {}
    353389protected:
    354390 
     
    394430  virtual int modify(const OsiSolverInterface * solver, OsiRowCut & cut) ;
    395431  /// Create C++ lines to get to current state
    396   virtual void generateCpp( FILE * fp) {}
     432  virtual void generateCpp( FILE * ) {}
    397433protected:
    398434  /// data
Note: See TracChangeset for help on using the changeset viewer.