Cgl 0.60.3
Loading...
Searching...
No Matches
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
13class CoinWarmStartBasis;
16class CglStored : public CglCutGenerator {
17
18public:
29 virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs,
30 const CglTreeInfo info = CglTreeInfo());
32
38 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
57 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
97 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
116protected:
117 // Protected member methods
118
119 // Protected member data
120
128 OsiCuts cuts_;
134 double *bounds_;
136};
137#endif
138
139/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
140*/
Cut Generator Base Class.
Stored Cut Generator Class.
Definition CglStored.hpp:16
void setRequiredViolation(double value)
Set.
Definition CglStored.hpp:38
void setProbingInfo(CglTreeProbingInfo *info)
Takes over ownership of probing info.
Definition CglStored.hpp:48
int numberColumns_
Number of columns in model.
virtual ~CglStored()
Destructor.
void addCut(double lb, double ub, int size, const int *colIndices, const double *elements)
Add a row cut from elements.
double * bounds_
Tight bounds.
void addCut(double lb, double ub, const CoinPackedVector &vector)
Add a row cut from a packed vector.
const double * bestSolution() const
Best solution (or NULL)
Definition CglStored.hpp:76
void addCut(const OsiCuts &cs)
Add cuts.
CglTreeProbingInfo * probingInfo_
Pointer to probing information.
int sizeRowCuts() const
Definition CglStored.hpp:64
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.
void saveStuff(double bestObjective, const double *bestSolution, const double *lower, const double *upper)
Save stuff.
virtual CglCutGenerator * clone() const
Clone.
double * bestSolution_
Best solution (objective at end)
CglStored(const char *fileName)
Constructor from file.
void addCut(const OsiRowCut &cut)
Add a row cut.
double bestObjective() const
Best objective.
CglStored & operator=(const CglStored &rhs)
Assignment operator.
double requiredViolation_
Only add if more than this requiredViolation.
CglStored(int numberColumns=0)
Default constructor.
CglStored(const CglStored &rhs)
Copy constructor.
double getRequiredViolation() const
Get.
Definition CglStored.hpp:43
const double * tightLower() const
Tight lower bounds.
Definition CglStored.hpp:83
OsiCuts cuts_
Cuts.
const double * tightUpper() const
Tight upper bounds.
Definition CglStored.hpp:88
const OsiRowCut * rowCutPointer(int index) const
Definition CglStored.hpp:68
Information about where the cut generator is invoked from.