Ipopt
3.11.0
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Interfaces
IpIpoptApplication.hpp
Go to the documentation of this file.
1
// Copyright (C) 2004, 2010 International Business Machines and others.
2
// All Rights Reserved.
3
// This code is published under the Eclipse Public License.
4
//
5
// $Id: IpIpoptApplication.hpp 2173 2013-03-30 17:25:39Z stefan $
6
//
7
// Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
8
9
#ifndef __IPIPOPTAPPLICATION_HPP__
10
#define __IPIPOPTAPPLICATION_HPP__
11
12
#ifndef IPOPT_EXPORT
13
#ifdef _MSC_VER
14
#ifdef IPOPT_DLL
15
#define IPOPT_EXPORT(type) __declspec(dllexport) type __cdecl
16
#else
17
#define IPOPT_EXPORT(type) type __cdecl
18
#endif
19
#else
20
#define IPOPT_EXPORT(type) type
21
#endif
22
#endif
23
24
#include <iostream>
25
26
#include "
IpJournalist.hpp
"
27
#include "
IpTNLP.hpp
"
28
#include "
IpNLP.hpp
"
29
/* Return codes for the Optimize call for an application */
30
#include "
IpReturnCodes.hpp
"
31
32
namespace
Ipopt
33
{
34
DECLARE_STD_EXCEPTION
(IPOPT_APPLICATION_ERROR);
35
36
/* forward declarations */
37
class
IpoptAlgorithm;
38
class
IpoptNLP;
39
class
IpoptData;
40
class
IpoptCalculatedQuantities;
41
class
AlgorithmBuilder;
42
class
RegisteredOptions;
43
class
OptionsList;
44
class
SolveStatistics;
45
47
class
IpoptApplication
:
public
ReferencedObject
48
{
49
public
:
50
IpoptApplication
(
bool
create_console_out =
true
,
51
bool
create_empty =
false
);
52
55
IpoptApplication
(
SmartPtr<RegisteredOptions>
reg_options,
56
SmartPtr<OptionsList>
options,
57
SmartPtr<Journalist>
jnlst);
58
59
virtual
~IpoptApplication
();
60
64
virtual
SmartPtr<IpoptApplication>
clone
();
65
73
virtual
ApplicationReturnStatus
Initialize
(std::string params_file =
"ipopt.opt"
);
74
virtual
ApplicationReturnStatus
Initialize
(std::istream& is);
75
79
virtual
ApplicationReturnStatus
OptimizeTNLP
(
const
SmartPtr<TNLP>
& tnlp);
80
82
virtual
ApplicationReturnStatus
OptimizeNLP
(
const
SmartPtr<NLP>
& nlp);
83
85
virtual
ApplicationReturnStatus
OptimizeNLP
(
const
SmartPtr<NLP>
& nlp,
SmartPtr<AlgorithmBuilder>
& alg_builder);
86
92
virtual
ApplicationReturnStatus
ReOptimizeTNLP
(
const
SmartPtr<TNLP>
& tnlp);
93
99
virtual
ApplicationReturnStatus
ReOptimizeNLP
(
const
SmartPtr<NLP>
& nlp);
101
104
virtual
bool
OpenOutputFile
(std::string
file_name
,
EJournalLevel
print_level
);
105
109
virtual
SmartPtr<Journalist>
Jnlst
()
110
{
111
return
jnlst_
;
112
}
113
116
virtual
SmartPtr<RegisteredOptions>
RegOptions
()
117
{
118
return
reg_options_
;
119
}
120
122
virtual
SmartPtr<OptionsList>
Options
()
123
{
124
return
options_
;
125
}
126
128
virtual
SmartPtr<const OptionsList>
Options
()
const
129
{
130
return
ConstPtr
(
options_
);
131
}
132
135
virtual
SmartPtr<SolveStatistics>
Statistics
();
136
138
virtual
SmartPtr<IpoptNLP>
IpoptNLPObject
();
139
141
SmartPtr<IpoptData>
IpoptDataObject
();
142
144
virtual
SmartPtr<IpoptCalculatedQuantities>
IpoptCQObject
();
145
147
SmartPtr<IpoptAlgorithm>
AlgorithmObject
();
149
154
void
PrintCopyrightMessage
();
155
158
static
void
RegisterOptions
(
SmartPtr<RegisteredOptions>
roptions);
160
162
static
void
163
RegisterAllIpoptOptions
(
const
SmartPtr<RegisteredOptions>
& roptions);
164
165
private
:
175
// IpoptApplication();
176
178
IpoptApplication
(
const
IpoptApplication
&);
179
181
void
operator=
(
const
IpoptApplication
&);
183
186
ApplicationReturnStatus
call_optimize
();
187
191
bool
read_params_dat_
;
193
195
SmartPtr<Journalist>
jnlst_
;
196
198
SmartPtr<RegisteredOptions>
reg_options_
;
199
201
SmartPtr<OptionsList>
options_
;
202
205
SmartPtr<SolveStatistics>
statistics_
;
206
209
SmartPtr<IpoptAlgorithm>
alg_
;
210
213
SmartPtr<IpoptNLP>
ip_nlp_
;
214
218
SmartPtr<IpoptData>
ip_data_
;
219
223
SmartPtr<IpoptCalculatedQuantities>
ip_cq_
;
224
227
SmartPtr<NLP>
nlp_adapter_
;
228
232
bool
inexact_algorithm_
;
235
bool
replace_bounds_
;
237
};
238
239
}
// namespace Ipopt
240
241
extern
"C"
IPOPT_EXPORT
(
class
Ipopt::IpoptApplication
*) IpoptApplicationFactory();
242
243
#endif
Generated by
1.8.4