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

- File List
- File Members

# /home/coin/SVN-release/Cgl-0.52.0/Cgl/src/CglLandP/CglLandPValidator.hpp

Go to the documentation of this file.

    00001 // Copyright (C) 2005, Pierre Bonami and others.  All Rights Reserved.
    00002 // Author:   Pierre Bonami
    00003 //           Tepper School of Business
    00004 //           Carnegie Mellon University, Pittsburgh, PA 15213
    00005 // Date:     11/22/05
    00006 //---------------------------------------------------------------------------
    00007
    00008 #ifndef CglValidator_H
    00009 #define CglValidator_H
    00010 #include "OsiSolverInterface.hpp"
    00011 #include "CglParam.hpp"
    00012 #include <vector>
    00013
    00015 //[5] = {"Accepted", "violation too small", "small coefficient too small", "big dynamic","too dense"}
    00016
    00017
    00018
    00020 class CglValidator
    00021 {
    00022 public:
    00024   enum RejectionsReasons{
    00025     NoneAccepted=0 ,
    00026     SmallViolation ,
    00027     SmallCoefficient ,
    00028     BigDynamic ,
    00029     DenseCut,
    00030     EmptyCut,
    00031     DummyEnd
    00032   };
    00033
    00035   CglValidator(double maxFillIn = 1.,
    00036                double maxRatio = 1e8,
    00037                double minViolation = 0,
    00038           bool scale = false);
    00039
    00041   int cleanCut(OsiRowCut & aCut, const double * solCut,const OsiSolverInterface &si, const CglParam & par) const;
    00043   int cleanCut2(OsiRowCut & aCut, const double * solCut, const OsiSolverInterface &si, const CglParam & par) const;
    00045   int operator()(OsiRowCut & aCut, const double * solCut,const OsiSolverInterface &si, const CglParam & par) const
    00046   {return cleanCut2(aCut, solCut, si, par);}
    00049   void setMaxFillIn(double value) { maxFillIn_ = value;}
    00050   void setMaxRatio(double value) { maxRatio_ = value;}
    00051   void setMinViolation(double value) {minViolation_ = value;}
    00055   double getMaxFillIn() {return maxFillIn_;}
    00056   double getMaxRatio() { return maxRatio_;}
    00057   double getMinViolation() {return minViolation_;}
    00060   const std::string& failureString(RejectionsReasons code) const {return rejections_[(int) code];}
    00061   const std::string& failureString(int code) const {return rejections_[ code];}
    00062   int numRejected(RejectionsReasons code)const{ return numRejected_[(int) code];}
    00063   int numRejected(int code)const{ return numRejected_[ code];}
    00064 private:
    00065   static void fillRejectionReasons();
    00067   double maxFillIn_;
    00069   double maxRatio_;
    00071   double minViolation_;
    00073   bool scale_;
    00075   static std::vector<std::string> rejections_;
    00077   mutable std::vector<int> numRejected_;
    00078 };
    00079 #endif