summaryrefslogtreecommitdiff
path: root/newstructure/thirdparty/linux/include/coin/BonOaFeasChecker.hpp
blob: 5ef8c142268fc7f45f59b7fc92b4563f23615889 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// (C) Copyright International Business Machines 2006
// All Rights Reserved.
// This code is published under the Eclipse Public License.
//
// Authors :
// P. Bonami, Carnegie Mellon University
//
// Date :  12/26/2006


#ifndef BonOaFeasibilityChecker_HPP
#define BonOaFeasibilityChecker_HPP
#include "BonOaDecBase.hpp"

namespace Bonmin
{
  /** Class to perform OA in its classical form.*/
  class OaFeasibilityChecker : public OaDecompositionBase
  {
  public:
    /// New usefull constructor
    OaFeasibilityChecker(BabSetupBase &b);
    /// Copy constructor
    OaFeasibilityChecker(const OaFeasibilityChecker &copy)
        :
        OaDecompositionBase(copy),
        pol_(copy.pol_),
        type_(copy.type_),
        cut_count_(copy.cut_count_),
        maximum_oa_cuts_(copy.maximum_oa_cuts_)
    {}
    /// Destructor
    ~OaFeasibilityChecker();

    /** Register OA options.*/
    static void registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions);

    virtual CglCutGenerator * clone() const
    {
      return new OaFeasibilityChecker(*this);
    }
  protected:
    /// virtual method which performs the OA algorithm by modifying lp and nlp.
    virtual double performOa(OsiCuts & cs, solverManip &lpManip,
        BabInfo * babInfo, double &cutoff, const CglTreeInfo & info) const;
    /// virutal method to decide if local search is performed
    virtual bool doLocalSearch(BabInfo * babInfo) const
    {
      return 0;
    }

    /** See documentation for feas_check_discard_policy option.*/
    enum CutsPolicies {
      DetectCycles = 0,
      KeepAll,
      TreatAsNormal};
    /** Policy for keeping cuts.*/
    CutsPolicies pol_;
 
    /** See documentation for feas_check_cut_types option.*/
    enum CutsTypes {
      OA = 0,
      Benders};
    /** Type of cuts.*/
    CutsTypes type_;

    /** Count the total number of cuts generated.*/
    mutable unsigned int cut_count_;
    /** maximum number of OA cuts.*/
    unsigned int maximum_oa_cuts_;
  };
}
#endif