Cgl 0.59.7

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CglLandPValidator.hpp
Go to the documentation of this file.
1 // Copyright (C) 2005-2009, Pierre Bonami and others. All Rights Reserved.
2 // Author: Pierre Bonami
3 // Tepper School of Business
4 // Carnegie Mellon University, Pittsburgh, PA 15213
5 // Date: 11/22/05
6 //
7 // $Id: CglLandPValidator.hpp 1302 2015-08-14 15:48:32Z stefan $
8 //
9 // This code is licensed under the terms of the Eclipse Public License (EPL).
10 //---------------------------------------------------------------------------
11
12 #ifndef CglLandPValidator_H
13 #define CglLandPValidator_H
14 #include "OsiSolverInterface.hpp"
15 #include "CglParam.hpp"
16 #include <vector>
17
19 //[5] = {"Accepted", "violation too small", "small coefficient too small", "big dynamic","too dense"}
20
21
22 namespace LAP
23 {
24
26 class Validator
27 {
28 public:
30 enum RejectionsReasons
31 {
32 NoneAccepted=0 ,
33 SmallViolation ,
34 SmallCoefficient ,
35 BigDynamic ,
36 DenseCut,
37 EmptyCut,
38 DummyEnd
39 };
40
42 Validator(double maxFillIn = 1.,
43 double maxRatio = 1e8,
44 double minViolation = 0,
45 bool scale = false,
46 double rhsScale = 1);
47
49 int cleanCut(OsiRowCut & aCut, const double * solCut,const OsiSolverInterface &si, const CglParam & par,
50 const double * colLower, const double * colUpper);
52 int cleanCut2(OsiRowCut & aCut, const double * solCut, const OsiSolverInterface &si, const CglParam & par,
53 const double * colLower, const double * colUpper);
55 int operator()(OsiRowCut & aCut, const double * solCut,const OsiSolverInterface &si, const CglParam & par,
56 const double * colLower, const double * colUpper)
57 {
58 return cleanCut(aCut, solCut, si, par, colLower, colUpper);
59 }
62 void setMaxFillIn(double value)
63 {
64 maxFillIn_ = value;
65 }
66 void setMaxRatio(double value)
67 {
68 maxRatio_ = value;
69 }
70 void setMinViolation(double value)
71 {
72 minViolation_ = value;
73 }
74
75 void setRhsScale(double v)
76 {
77 rhsScale_ = v;
78 }
82 double getMaxFillIn()
83 {
84 return maxFillIn_;
85 }
86 double getMaxRatio()
87 {
88 return maxRatio_;
89 }
90 double getMinViolation()
91 {
92 return minViolation_;
93 }
96 const char* failureString(RejectionsReasons code) const
97 {
98 return rejections_[static_cast<int> (code)];
99 }
100 const char* failureString(int code) const
101 {
102 return rejections_[ code];
103 }
104 int numRejected(RejectionsReasons code)const
105 {
106 return numRejected_[static_cast<int> (code)];
107 }
108 int numRejected(int code)const
109 {
110 return numRejected_[ code];
111 }
112 private:
114 double maxFillIn_;
116 double maxRatio_;
118 double minViolation_;
120 bool scale_;
122 double rhsScale_;
124 static const char* rejections_[DummyEnd];
126 std::vector<int> numRejected_;
127 };
128
129 }/* Ends namespace LAP.*/
130 #endif
LAP::Validator::setMaxFillIn
void setMaxFillIn(double value)
Definition: CglLandPValidator.hpp:62
LAP::Validator::rhsScale_
double rhsScale_
Scale of right-hand-side.
Definition: CglLandPValidator.hpp:122
LAP::Validator::numRejected_
std::vector< int > numRejected_
Number of cut rejected for each of the reasons.
Definition: CglLandPValidator.hpp:126
LAP::Validator::failureString
const char * failureString(int code) const
Definition: CglLandPValidator.hpp:100
CglParam.hpp
LAP::Validator::numRejected
int numRejected(RejectionsReasons code) const
Definition: CglLandPValidator.hpp:104
LAP::Validator::Validator
Validator(double maxFillIn=1., double maxRatio=1e8, double minViolation=0, bool scale=false, double rhsScale=1)
Constructor with default values.
LAP::Validator::getMaxRatio
double getMaxRatio()
Definition: CglLandPValidator.hpp:86
LAP::Validator::EmptyCut
After cleaning cut has become empty.
Definition: CglLandPValidator.hpp:37
LAP::Validator::setMinViolation
void setMinViolation(double value)
Definition: CglLandPValidator.hpp:70
LAP::Validator::getMaxFillIn
double getMaxFillIn()
Definition: CglLandPValidator.hpp:82
LAP::Validator::cleanCut2
int cleanCut2(OsiRowCut &aCut, const double *solCut, const OsiSolverInterface &si, const CglParam &par, const double *colLower, const double *colUpper)
Clean an OsiCut by another method.
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:62
LAP::Validator::rejections_
static const char * rejections_[DummyEnd]
Strings explaining reason for rejections.
Definition: CglLandPValidator.hpp:124
LAP::Validator::getMinViolation
double getMinViolation()
Definition: CglLandPValidator.hpp:90
LAP::Validator::SmallCoefficient
There is a small coefficient we can not get rid off.
Definition: CglLandPValidator.hpp:34
LAP::Validator::NoneAccepted
Definition: CglLandPValidator.hpp:32
LAP::Validator::scale_
bool scale_
Do we do scaling?
Definition: CglLandPValidator.hpp:120
LAP::Validator::numRejected
int numRejected(int code) const
Definition: CglLandPValidator.hpp:108
CglParam
Class collecting parameters for all cut generators.
Definition: CglParam.hpp:22
LAP::Validator::DenseCut
cut is too dense
Definition: CglLandPValidator.hpp:36
LAP::Validator::maxRatio_
double maxRatio_
max ratio between smallest and biggest coefficient
Definition: CglLandPValidator.hpp:116
LAP::Validator::minViolation_
double minViolation_
minimum violation for accepting a cut
Definition: CglLandPValidator.hpp:118
LAP::scale
void scale(OsiRowCut &cut)
scale the cut passed as argument
LAP::Validator::failureString
const char * failureString(RejectionsReasons code) const
Definition: CglLandPValidator.hpp:96
LAP::Validator::DummyEnd
dummy
Definition: CglLandPValidator.hpp:38
OsiRowCut
Row Cut Class.
Definition: OsiRowCut.hpp:29
LAP::Validator::RejectionsReasons
RejectionsReasons
Reasons for rejecting a cut.
Definition: CglLandPValidator.hpp:30
LAP::Validator::SmallViolation
Violation of the cut is too small.
Definition: CglLandPValidator.hpp:33
LAP::Validator::BigDynamic
Dynamic of coefficinet is too important.
Definition: CglLandPValidator.hpp:35
LAP::Validator::cleanCut
int cleanCut(OsiRowCut &aCut, const double *solCut, const OsiSolverInterface &si, const CglParam &par, const double *colLower, const double *colUpper)
Clean an OsiCut.
OsiSolverInterface.hpp
LAP::Validator::setRhsScale
void setRhsScale(double v)
Definition: CglLandPValidator.hpp:75
LAP::Validator::operator()
int operator()(OsiRowCut &aCut, const double *solCut, const OsiSolverInterface &si, const CglParam &par, const double *colLower, const double *colUpper)
Call the cut cleaner.
Definition: CglLandPValidator.hpp:55
LAP::Validator::setMaxRatio
void setMaxRatio(double value)
Definition: CglLandPValidator.hpp:66
LAP::Validator
Class to validate or reject a cut.
Definition: CglLandPValidator.hpp:26
LAP::Validator::maxFillIn_
double maxFillIn_
max percentage of given formulation fillIn should be accepted for cut fillin.
Definition: CglLandPValidator.hpp:114