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

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

astyled the devel branch

  • Property svn:eol-style set to native
  • Property svn:keywords set to "Author Date Id Revision"
File size: 1.8 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
16{
17  class OACutGenerator : public CglCutGenerator
18  {
19  public:
20    /// Default constructor
21    OACutGenerator(OsiTMINLPInterface * si = NULL,
22        int maxDepth = 10);
23    /// Copy constructor
24    OACutGenerator(const OACutGenerator &copy)
25        :
26        nlp_(copy.nlp_),
27        maxDepth_(copy.maxDepth_)
28    {
29      handler_ = new CoinMessageHandler();
30      handler_ -> setLogLevel(copy.handler_->logLevel());
31      messages_ = OaMessages();
32    }
33
34    ///Abstract constructor
35    virtual CglCutGenerator * clone() const
36    {
37      return new OACutGenerator(*this);
38    }
39
40    /** Desctructor */
41    virtual ~OACutGenerator()
42    {
43      delete handler_;
44    }
45
46    /// Assign an OsiTMINLPInterface
47    void assignInterface(OsiTMINLPInterface * si);
48    /// cut generation method
49    virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs,
50        const CglTreeInfo info) const;
51
52
53
54    void setMaxDepth(int value)
55    {
56      maxDepth_ = value;
57    }
58    inline int getNSolve()
59    {
60      return nSolve_;
61    }
62    /**set log level */
63    void setLogLevel(int value)
64    {
65      handler_->setLogLevel(value);
66    }
67  private:
68    /// Pointer to the Ipopt interface
69    OsiTMINLPInterface * nlp_;
70
71    /** maximum depth at which generate cuts*/
72    int maxDepth_;
73
74    ///Number of NLP resolution done
75    mutable int nSolve_;
76    /** messages handler. */
77    CoinMessageHandler * handler_;
78    /** handler */
79    CoinMessages messages_;
80  };
81}
82#endif
Note: See TracBrowser for help on using the repository browser.