source: branches/devel/Bonmin/src/OaInterface/BonOACutGenerator.hpp @ 58

Last change on this file since 58 was 58, checked in by pbonami, 13 years ago

Finish renaming

  • Property svn:eol-style set to native
  • Property svn:keywords set to "Author Date Id Revision"
File size: 1.7 KB
Line 
1// (C) Copyright Carnegie Mellon University 2005
2// All Rights Reserved.
3// This code is published under the Common Public License.
4//
5// Authors :
6// P. Bonami, Carnegie Mellon University
7//
8// Date :  05/26/2005
9
10#ifndef BonOACutGenerator_HPP
11#define BonOACutGenerator_HPP
12#include "CglCutGenerator.hpp"
13#include "BonOsiTMINLPInterface.hpp"
14#include "BonOAMessages.hpp"
15namespace Bonmin{
16class OACutGenerator : public CglCutGenerator
17{
18public:
19  /// Default constructor
20  OACutGenerator(OsiTMINLPInterface * si = NULL,
21      int maxDepth = 10);
22  /// Copy constructor
23  OACutGenerator(const OACutGenerator &copy)
24      :
25      nlp_(copy.nlp_),
26      maxDepth_(copy.maxDepth_)
27  {
28    handler_ = new CoinMessageHandler();
29    handler_ -> setLogLevel(copy.handler_->logLevel());
30    messages_ = OaMessages();
31  }
32
33  ///Abstract constructor
34  virtual CglCutGenerator * clone() const
35  {
36    return new OACutGenerator(*this);
37  }
38
39  /** Desctructor */
40  virtual ~OACutGenerator()
41  {
42    delete handler_;
43  }
44
45  /// Assign an OsiTMINLPInterface
46  void assignInterface(OsiTMINLPInterface * si);
47  /// cut generation method
48  virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs,
49      const CglTreeInfo info) const;
50
51
52
53  void setMaxDepth(int value)
54  {
55    maxDepth_ = value;
56  }
57  inline int getNSolve()
58  {
59    return nSolve_;
60  }
61  /**set log level */
62  void setLogLevel(int value)
63  {
64    handler_->setLogLevel(value);
65  }
66private:
67  /// Pointer to the Ipopt interface
68  OsiTMINLPInterface * nlp_;
69
70  /** maximum depth at which generate cuts*/
71  int maxDepth_;
72
73  ///Number of NLP resolution done
74  mutable int nSolve_;
75  /** messages handler. */
76  CoinMessageHandler * handler_;
77  /** handler */
78  CoinMessages messages_;
79};
80}
81#endif
Note: See TracBrowser for help on using the repository browser.