Ipopt
3.11.4
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
src
Algorithm
IpAlgStrategy.hpp
Go to the documentation of this file.
1
// Copyright (C) 2004, 2006 International Business Machines and others.
2
// All Rights Reserved.
3
// This code is published under the Eclipse Public License.
4
//
5
// $Id: IpAlgStrategy.hpp 1861 2010-12-21 21:34:47Z andreasw $
6
//
7
// Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
8
9
#ifndef __IPALGSTRATEGY_HPP__
10
#define __IPALGSTRATEGY_HPP__
11
12
#include "
IpOptionsList.hpp
"
13
#include "
IpJournalist.hpp
"
14
#include "
IpIpoptCalculatedQuantities.hpp
"
15
#include "
IpIpoptNLP.hpp
"
16
#include "
IpIpoptData.hpp
"
17
18
namespace
Ipopt
19
{
20
35
class
AlgorithmStrategyObject
:
public
ReferencedObject
36
{
37
public
:
41
AlgorithmStrategyObject
()
42
:
43
initialize_called_
(false)
44
{}
45
47
virtual
~AlgorithmStrategyObject
()
48
{}
50
66
bool
Initialize
(
const
Journalist
& jnlst,
67
IpoptNLP
& ip_nlp,
68
IpoptData
& ip_data,
69
IpoptCalculatedQuantities
& ip_cq,
70
const
OptionsList
& options,
71
const
std::string& prefix)
72
{
73
initialize_called_
=
true
;
74
// Copy the pointers for the problem defining objects
75
jnlst_
= &jnlst;
76
ip_nlp_
= &ip_nlp;
77
ip_data_
= &ip_data;
78
ip_cq_
= &ip_cq;
79
80
bool
retval =
InitializeImpl
(options, prefix);
81
if
(!retval) {
82
initialize_called_
=
false
;
83
}
84
85
return
retval;
86
}
87
92
bool
ReducedInitialize
(
const
Journalist
& jnlst,
93
const
OptionsList
& options,
94
const
std::string& prefix)
95
{
96
initialize_called_
=
true
;
97
// Copy the pointers for the problem defining objects
98
jnlst_
= &jnlst;
99
ip_nlp_
= NULL;
100
ip_data_
= NULL;
101
ip_cq_
= NULL;
102
103
bool
retval =
InitializeImpl
(options, prefix);
104
if
(!retval) {
105
initialize_called_
=
false
;
106
}
107
108
return
retval;
109
}
110
111
protected
:
114
virtual
bool
InitializeImpl
(
const
OptionsList
& options,
115
const
std::string& prefix)=0;
116
120
const
Journalist
&
Jnlst
()
const
121
{
122
DBG_ASSERT
(
initialize_called_
);
123
return
*
jnlst_
;
124
}
125
IpoptNLP
&
IpNLP
()
const
126
{
127
DBG_ASSERT
(
initialize_called_
);
128
DBG_ASSERT
(
IsValid
(
ip_nlp_
));
129
return
*
ip_nlp_
;
130
}
131
IpoptData
&
IpData
()
const
132
{
133
DBG_ASSERT
(
initialize_called_
);
134
DBG_ASSERT
(
IsValid
(
ip_data_
));
135
return
*
ip_data_
;
136
}
137
IpoptCalculatedQuantities
&
IpCq
()
const
138
{
139
DBG_ASSERT
(
initialize_called_
);
140
DBG_ASSERT
(
IsValid
(
ip_cq_
));
141
return
*
ip_cq_
;
142
}
143
bool
HaveIpData
()
const
144
{
145
return
IsValid
(
ip_data_
);
146
}
148
149
private
:
159
//AlgorithmStrategyObject();
160
161
163
AlgorithmStrategyObject
(
const
AlgorithmStrategyObject
&);
164
166
void
operator=
(
const
AlgorithmStrategyObject
&);
168
172
SmartPtr<const Journalist>
jnlst_
;
173
SmartPtr<IpoptNLP>
ip_nlp_
;
174
SmartPtr<IpoptData>
ip_data_
;
175
SmartPtr<IpoptCalculatedQuantities>
ip_cq_
;
177
180
bool
initialize_called_
;
181
};
182
183
}
// namespace Ipopt
184
185
#endif
Generated on Mon Oct 21 2013 19:08:15 for Ipopt by
1.8.4