source: trunk/Couenne/src/cut/crossconv/CouenneCrossConv.hpp @ 605

Last change on this file since 605 was 605, checked in by pbelotti, 10 years ago

moving (yet) unused cut generators to common subdirectory cut/ -- will do the same for other generators later

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1/* $Id: CouenneCrossConv.hpp 605 2011-06-06 12:08:33Z pbelotti $
2 *
3 * Name:    CouenneCrossConv.hpp
4 * Author:  Pietro Belotti
5 * Purpose: Convexification cuts on redundant relationships between auxiliaries
6 *
7 * (C) Pietro Belotti, 2010-11.
8 * This file is licensed under the Eclipse Public License (EPL)
9 */
10
11#ifndef COUENNECROSSCONV_HPP
12#define COUENNECROSSCONV_HPP
13
14#include "BonRegisteredOptions.hpp"
15
16#include "CglCutGenerator.hpp"
17#include "OsiRowCut.hpp"
18#include "CouenneJournalist.hpp"
19
20namespace Ipopt {
21  template <class T> class SmartPtr;
22  class OptionsList;
23}
24
25namespace Couenne {
26
27  class CouenneProblem;
28
29  /// Base class definition for relations between auxiliaries
30
31  class AuxRelation {
32
33  public:
34
35    virtual int findRelations () = 0;
36
37    virtual void generateCuts (const OsiSolverInterface &, 
38                               OsiCuts &, 
39                               const CglTreeInfo = CglTreeInfo ()) const;
40  protected:
41
42  };
43 
44  /// Identifies 5-ples of variables of the form
45  ///
46  /// x_3 := log x_1
47  /// x_4 := log x_2
48  /// x_5 := x_1 x_2 in [l,u]
49  ///
50  /// and generates a cut
51  ///
52  /// x_3 + x_4 in [max {0, log l}, max {0, log u}].
53  ///
54  /// This has to be repeatedly generated, even when l=u (l and/or u
55  /// could change in other nodes).
56
57  class SumLogAuxRel: public AuxRelation {
58
59  public:
60
61    virtual int findRelations ();
62
63    virtual void generateCuts (const OsiSolverInterface &, 
64                               OsiCuts &, 
65                               const CglTreeInfo = CglTreeInfo ()) const;
66  };
67
68
69  /// Identifies 5-ples of variables of the form
70  ///
71  /// x_k := x_i x_j
72  /// x_l := x_i x_p
73  ///
74  /// x_q := x_k x_p     OR     x_q := x_k / x_j
75  /// x_r := x_k x_j            x_r := x_l / x_p
76  ///
77  /// and generates, ONLY ONCE, a cut
78  ///
79  /// x_q = x_r (in both cases).
80
81  class MultiProdRel: public AuxRelation {
82
83  public:
84
85    virtual int findRelations ();
86
87    virtual void generateCuts (const OsiSolverInterface &, 
88                               OsiCuts &, 
89                               const CglTreeInfo = CglTreeInfo ()) const;
90  };
91
92  /// Identifies 5-tuple of the form
93  ///
94  /// x_j := x_i / x_k
95  /// x_p := x_i / x_q
96  ///
97  /// x_l := x_j / x_p   OR   x_l := x_j x_k
98  /// x_m := x_q / x_k        x_m := x_p x_q
99  ///
100  /// and generates, ONLY once, a cut
101  ///
102  /// x_l = x_m (in both cases).
103
104  class BiProdDivRel: public AuxRelation {
105
106  public:
107
108    virtual int findRelations ();
109
110    virtual void generateCuts (const OsiSolverInterface &, 
111                               OsiCuts &, 
112                               const CglTreeInfo = CglTreeInfo ()) const;
113  };
114
115  /// Identifies 5-tuple of the form
116  ///
117  /// x_j := x_i ^ alpha
118  /// x_p := x_i ^ beta
119  ///
120  /// and generates cuts based on the relation
121  ///
122  /// x_p = x_j ^ {beta/alpha}
123
124  class PowRel: public AuxRelation {
125
126  public:
127
128    virtual int findRelations ();
129
130    virtual void generateCuts (const OsiSolverInterface &, 
131                               OsiCuts &, 
132                               const CglTreeInfo = CglTreeInfo ()) const;
133  };
134
135
136  /// Cut Generator that uses relationships between auxiliaries
137
138  class CouenneCrossConv: public CglCutGenerator {
139
140  public:
141
142    /// constructor
143    CouenneCrossConv (CouenneProblem *,
144                      JnlstPtr,
145                      const Ipopt::SmartPtr <Ipopt::OptionsList>);
146
147    /// copy constructor
148    CouenneCrossConv  (const CouenneCrossConv &);
149
150    /// destructor
151    virtual ~CouenneCrossConv ();
152
153    /// clone method (necessary for the abstract CglCutGenerator class)
154    virtual CouenneCrossConv *clone () const
155    {return new CouenneCrossConv (*this);}
156
157    /// the main CglCutGenerator
158    virtual void generateCuts (const OsiSolverInterface &, 
159                       OsiCuts &, 
160                       const CglTreeInfo = CglTreeInfo ()) const;
161
162    /// Add list of options to be read from file
163    static void registerOptions (Ipopt::SmartPtr <Bonmin::RegisteredOptions> roptions);
164
165    /// Set up data structure to detect redundancies
166    virtual void setup ();
167
168  protected:
169
170    /// Journalist
171    JnlstPtr jnlst_;
172
173    /// pointer to the CouenneProblem representation
174    CouenneProblem *problem_;
175  };
176}
177
178#endif
Note: See TracBrowser for help on using the repository browser.