Cgl  0.60.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CglStored.hpp
Go to the documentation of this file.
1 // $Id: CglStored.hpp 1442 2019-01-06 16:39:41Z unxusr $
2 // Copyright (C) 2005, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 
6 #ifndef CglStored_H
7 #define CglStored_H
8 
9 #include <string>
10 
11 #include "CglCutGenerator.hpp"
12 
13 class CoinWarmStartBasis;
14 class CglTreeProbingInfo;
16 class CglStored : public CglCutGenerator {
17 
18 public:
29  virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs,
30  const CglTreeInfo info = CglTreeInfo());
32 
37  inline void setRequiredViolation(double value)
39  {
40  requiredViolation_ = value;
41  }
43  inline double getRequiredViolation() const
44  {
45  return requiredViolation_;
46  }
49  {
50  probingInfo_ = info;
51  }
53 
56  void addCut(const OsiCuts &cs);
59  void addCut(const OsiRowCut &cut);
61  void addCut(double lb, double ub, const CoinPackedVector &vector);
63  void addCut(double lb, double ub, int size, const int *colIndices, const double *elements);
64  inline int sizeRowCuts() const
65  {
66  return cuts_.sizeRowCuts();
67  }
68  const OsiRowCut *rowCutPointer(int index) const
69  {
70  return cuts_.rowCutPtr(index);
71  }
73  void saveStuff(double bestObjective, const double *bestSolution,
74  const double *lower, const double *upper);
76  inline const double *bestSolution() const
77  {
78  return bestSolution_;
79  }
81  double bestObjective() const;
83  const double *tightLower() const
84  {
85  return bounds_;
86  }
88  const double *tightUpper() const
89  {
90  return bounds_ + numberColumns_;
91  }
93 
96  CglStored(int numberColumns = 0);
98 
100  CglStored(const CglStored &rhs);
101 
103  CglStored(const char *fileName);
104 
106  virtual CglCutGenerator *clone() const;
107 
109  CglStored &
110  operator=(const CglStored &rhs);
111 
113  virtual ~CglStored();
115 
116 protected:
117  // Protected member methods
118 
119  // Protected member data
120 
123  double requiredViolation_;
132  double *bestSolution_;
134  double *bounds_;
136 };
137 #endif
138 
139 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
140 */
double * bestSolution_
Best solution (objective at end)
Definition: CglStored.hpp:132
CglStored(int numberColumns=0)
Default constructor.
CglStored & operator=(const CglStored &rhs)
Assignment operator.
int numberColumns_
Number of columns in model.
Definition: CglStored.hpp:130
double requiredViolation_
Only add if more than this requiredViolation.
Definition: CglStored.hpp:124
double getRequiredViolation() const
Get.
Definition: CglStored.hpp:43
Stored Cut Generator Class.
Definition: CglStored.hpp:16
OsiRowCut * rowCutPtr(int i)
Get pointer to i&#39;th row cut.
Definition: OsiCuts.hpp:416
const OsiRowCut * rowCutPointer(int index) const
Definition: CglStored.hpp:68
Information about where the cut generator is invoked from.
Definition: CglTreeInfo.hpp:15
Collections of row cuts and column cuts.
Definition: OsiCuts.hpp:19
The default COIN simplex (basis-oriented) warm start class.
virtual CglCutGenerator * clone() const
Clone.
Abstract Base Class for describing an interface to a solver.
const double * tightUpper() const
Tight upper bounds.
Definition: CglStored.hpp:88
Cut Generator Base Class.
const double * bestSolution() const
Best solution (or NULL)
Definition: CglStored.hpp:76
double bestObjective() const
Best objective.
const double * tightLower() const
Tight lower bounds.
Definition: CglStored.hpp:83
void setProbingInfo(CglTreeProbingInfo *info)
Takes over ownership of probing info.
Definition: CglStored.hpp:48
Row Cut Class.
Definition: OsiRowCut.hpp:29
CglTreeProbingInfo * probingInfo_
Pointer to probing information.
Definition: CglStored.hpp:126
OsiCuts cuts_
Cuts.
Definition: CglStored.hpp:128
virtual ~CglStored()
Destructor.
double * bounds_
Tight bounds.
Definition: CglStored.hpp:134
void setRequiredViolation(double value)
Set.
Definition: CglStored.hpp:38
void saveStuff(double bestObjective, const double *bestSolution, const double *lower, const double *upper)
Save stuff.
int sizeRowCuts() const
Definition: CglStored.hpp:64
void addCut(const OsiCuts &cs)
Add cuts.
Sparse Vector.
int sizeRowCuts() const
Number of row cuts in collection.
Definition: OsiCuts.hpp:398
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())
Generate Mixed Integer Stored cuts for the model of the solver interface, si.