Bonmin
1.8.9
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Algorithms
OaGenerators
BonOaNlpOptim.hpp
Go to the documentation of this file.
1
// (C) Copyright Carnegie Mellon University 2005, 2006
2
// All Rights Reserved.
3
// This code is published under the Eclipse Public License.
4
//
5
// Authors :
6
// P. Bonami, Carnegie Mellon University
7
//
8
// Date : 05/26/2005
9
10
#ifndef BonOaNlpOptim_HPP
11
#define BonOaNlpOptim_HPP
12
#include "
CglCutGenerator.hpp
"
13
#include "
BonOsiTMINLPInterface.hpp
"
14
#include "
BonOAMessages.hpp
"
15
#include "
BonBabSetupBase.hpp
"
16
namespace
Bonmin
17
{
19
class
OaNlpOptim
:
public
CglCutGenerator
20
{
21
public
:
23
OaNlpOptim
(
OsiTMINLPInterface
* si = NULL,
24
int
maxDepth = 10,
bool
addOnlyViolated =
false
,
25
bool
globalCuts =
true
);
26
28
OaNlpOptim
(
BabSetupBase
&b);
30
OaNlpOptim
(
const
OaNlpOptim
©)
31
:
32
CglCutGenerator
(copy),
33
nlp_(copy.nlp_),
34
maxDepth_(copy.maxDepth_),
35
nSolve_(0),
36
addOnlyViolated_(copy.addOnlyViolated_),
37
global_(copy.global_),
38
solves_per_level_(copy.solves_per_level_)
39
{
40
handler_ =
new
CoinMessageHandler
();
41
handler_ ->
setLogLevel
(copy.handler_->
logLevel
());
42
messages_ =
OaMessages
();
43
}
44
void
passInMessageHandler
(
const
CoinMessageHandler
* handler)
45
{
46
delete
handler_;
47
handler_ = handler->
clone
();
48
}
49
50
virtual
CglCutGenerator
*
clone
()
const
51
{
52
return
new
OaNlpOptim
(*
this
);
53
}
54
56
virtual
~OaNlpOptim
()
57
{
58
if
(handler_)
59
delete
handler_;
60
}
61
63
void
assignInterface
(
OsiTMINLPInterface
* si);
65
virtual
void
generateCuts
(
const
OsiSolverInterface
& si,
OsiCuts
& cs,
66
const
CglTreeInfo
info);
67
68
69
70
inline
void
setMaxDepth
(
int
value)
71
{
72
maxDepth_ = value;
73
}
74
inline
void
setAddOnlyViolated
(
bool
yesno)
75
{
76
addOnlyViolated_ = yesno;
77
}
78
inline
void
setGlobalCuts
(
bool
yesno)
79
{
80
global_ = yesno;
81
}
82
inline
int
getNSolve
()
83
{
84
return
nSolve_;
85
}
86
87
void
setLogLevel
(
int
value)
88
{
89
handler_->setLogLevel(value);
90
}
91
93
static
void
registerOptions
(
Ipopt::SmartPtr<Bonmin::RegisteredOptions>
roptions);
94
95
private
:
97
OsiTMINLPInterface
* nlp_;
98
100
int
maxDepth_;
101
103
mutable
int
nSolve_;
105
CoinMessageHandler
* handler_;
107
CoinMessages
messages_;
109
bool
addOnlyViolated_;
111
bool
global_;
113
double
solves_per_level_;
114
};
115
}
116
#endif
BonBabSetupBase.hpp
BonOAMessages.hpp
BonOsiTMINLPInterface.hpp
CglCutGenerator.hpp
Bonmin::BabSetupBase
A class to have all elements necessary to setup a branch-and-bound.
Definition
BonBabSetupBase.hpp:26
Bonmin::OaMessages
Output messages for Outer approximation cutting planes.
Definition
BonOAMessages.hpp:38
Bonmin::OaNlpOptim::OaNlpOptim
OaNlpOptim(BabSetupBase &b)
Constructor with basic setup.
Bonmin::OaNlpOptim::setLogLevel
void setLogLevel(int value)
set log level
Definition
BonOaNlpOptim.hpp:87
Bonmin::OaNlpOptim::passInMessageHandler
void passInMessageHandler(const CoinMessageHandler *handler)
Definition
BonOaNlpOptim.hpp:44
Bonmin::OaNlpOptim::OaNlpOptim
OaNlpOptim(OsiTMINLPInterface *si=NULL, int maxDepth=10, bool addOnlyViolated=false, bool globalCuts=true)
Default constructor.
Bonmin::OaNlpOptim::~OaNlpOptim
virtual ~OaNlpOptim()
Desctructor.
Definition
BonOaNlpOptim.hpp:56
Bonmin::OaNlpOptim::setAddOnlyViolated
void setAddOnlyViolated(bool yesno)
Definition
BonOaNlpOptim.hpp:74
Bonmin::OaNlpOptim::assignInterface
void assignInterface(OsiTMINLPInterface *si)
Assign an OsiTMINLPInterface.
Bonmin::OaNlpOptim::registerOptions
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Register OaNlpOptim options.
Bonmin::OaNlpOptim::getNSolve
int getNSolve()
Definition
BonOaNlpOptim.hpp:82
Bonmin::OaNlpOptim::setGlobalCuts
void setGlobalCuts(bool yesno)
Definition
BonOaNlpOptim.hpp:78
Bonmin::OaNlpOptim::setMaxDepth
void setMaxDepth(int value)
Definition
BonOaNlpOptim.hpp:70
Bonmin::OaNlpOptim::OaNlpOptim
OaNlpOptim(const OaNlpOptim ©)
Copy constructor.
Definition
BonOaNlpOptim.hpp:30
Bonmin::OaNlpOptim::generateCuts
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info)
cut generation method
Bonmin::OaNlpOptim::clone
virtual CglCutGenerator * clone() const
Abstract constructor.
Definition
BonOaNlpOptim.hpp:50
Bonmin::OsiTMINLPInterface
This is class provides an Osi interface for a Mixed Integer Linear Program expressed as a TMINLP (so ...
Definition
BonOsiTMINLPInterface.hpp:49
CglCutGenerator::CglCutGenerator
CglCutGenerator()
CglTreeInfo
CoinMessageHandler
CoinMessageHandler::clone
virtual CoinMessageHandler * clone() const
CoinMessageHandler::logLevel
int logLevel() const
CoinMessages
Ipopt::SmartPtr
OsiCuts
OsiSolverInterface
Bonmin
(C) Copyright International Business Machines Corporation 2007
Definition
BonAmplSetup.hpp:16
Generated by
1.17.0