coin-Cgl
CglAllDifferent.hpp
Go to the documentation of this file.
1 // Copyright (C) 2005, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 #ifndef CglAllDifferent_H
4 #define CglAllDifferent_H
5 
6 #include <string>
7 
8 #include "CglCutGenerator.hpp"
9 
19 
20 public:
21 
22 
27  virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs,
28  const CglTreeInfo info = CglTreeInfo()) const;
30 
31 
34  CglAllDifferent ();
36 
38  CglAllDifferent(int numberSets, const int * starts, const int * which);
39 
42  const CglAllDifferent &);
43 
45  virtual CglCutGenerator * clone() const;
46 
49  operator=(
50  const CglAllDifferent& rhs);
51 
53  virtual
56  virtual std::string generateCpp( FILE * fp);
57 
59  virtual void refreshSolver(OsiSolverInterface * solver);
67  virtual bool mayGenerateRowCutsInTree() const
68  { return false;}
70 
72  inline void setLogLevel(int value)
74  { logLevel_=value;}
76  inline int getLogLevel() const
77  { return logLevel_;}
79  inline void setMaxLook(int value)
80  { maxLook_=value;}
82  inline int getMaxLook() const
83  { return maxLook_;}
85 
86 private:
87 
88  // Private member methods
91 
92 
93  // Private member data
94 
97  int numberSets_;
102  int maxLook_;
106  int * start_;
108  int * which_;
112 };
113 #endif
int * originalWhich_
Original members.
virtual CglCutGenerator * clone() const
Clone.
virtual bool mayGenerateRowCutsInTree() const
Returns true if may generate Row cuts in tree (rather than root node).
int * which_
Members (0,1,....) not as in original model.
void setMaxLook(int value)
Set Maximum number of sets to look at at once.
virtual void refreshSolver(OsiSolverInterface *solver)
This can be used to refresh any inforamtion.
int getLogLevel() const
Get log level.
int logLevel_
Log level - 0 none, 1 - a bit, 2 - more details.
virtual std::string generateCpp(FILE *fp)
Create C++ lines to get to current state.
virtual ~CglAllDifferent()
Destructor.
int maxLook_
Maximum number of sets to look at at once.
Cut Generator Base Class.
int getMaxLook() const
Get Maximum number of sets to look at at once.
void setLogLevel(int value)
Set log level.
AllDifferent Cut Generator Class This has a number of sets.
int numberSets_
Number of sets.
CglAllDifferent & operator=(const CglAllDifferent &rhs)
Assignment operator.
Information about where the cut generator is invoked from.
Definition: CglTreeInfo.hpp:13
int * start_
Start of each set.
CglAllDifferent()
Default constructor.
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) const
This fixes (or reduces bounds) on sets of all different variables.
int numberDifferent_
Total number of variables in all different sets.