44 #ifndef ROL_ALGORITHM_H
45 #define ROL_ALGORITHM_H
67 ROL::Ptr<AlgorithmState<Real> >
state_;
79 bool printHeader =
false ) {
82 state_ = ROL::makePtr<AlgorithmState<Real>>();
92 bool printHeader =
false ) {
105 std::ostream &outStream = std::cout,
106 bool printVectors =
false,
107 std::ostream &vectorStream = std::cout ) {
110 return run(x,x.
dual(),obj,bnd,print,outStream,printVectors,vectorStream);
121 std::ostream &outStream = std::cout,
122 bool printVectors =
false,
123 std::ostream &vectorStream = std::cout ) {
126 return run(x,g,obj,bnd,print,outStream,printVectors,vectorStream);
136 std::ostream &outStream = std::cout,
137 bool printVectors =
false,
138 std::ostream &vectorStream = std::cout ) {
139 return run(x,x.
dual(),obj,bnd,print,outStream,printVectors,vectorStream);
151 std::ostream &outStream = std::cout,
152 bool printVectors =
false,
153 std::ostream &vectorStream = std::cout ) {
155 x.
print(vectorStream);
158 std::vector<std::string> output;
161 if (
state_->iterateVec == ROL::nullPtr ) {
164 state_->iterateVec->set(x);
167 ROL::Ptr<Vector<Real> > s = x.
clone();
177 if (
state_->minIterVec == ROL::nullPtr ) {
180 state_->minIterVec->set(x);
190 x.
print(vectorStream);
205 std::stringstream hist;
206 hist <<
"Optimization Terminated with Status: ";
209 output.push_back(hist.str());
211 outStream << hist.str();
225 std::ostream &outStream = std::cout,
226 bool printVectors =
false,
227 std::ostream &vectorStream = std::cout ) {
229 return run(x, x.
dual(), l, l.
dual(), obj, con, print, outStream, printVectors, vectorStream);
245 std::ostream &outStream = std::cout,
246 bool printVectors =
false,
247 std::ostream &vectorStream = std::cout ) {
249 x.
print(vectorStream);
252 std::vector<std::string> output;
255 if (
state_->iterateVec == ROL::nullPtr ) {
258 state_->iterateVec->set(x);
261 if (
state_->lagmultVec == ROL::nullPtr ) {
264 state_->lagmultVec->set(l);
267 ROL::Ptr<Vector<Real> > s = x.
clone();
277 if (
state_->minIterVec == ROL::nullPtr ) {
280 state_->minIterVec->set(x);
290 x.
print(vectorStream);
298 std::stringstream hist;
299 hist <<
"Optimization Terminated with Status: ";
302 output.push_back(hist.str());
304 outStream << hist.str();
318 std::ostream &outStream = std::cout,
319 bool printVectors =
false,
320 std::ostream &vectorStream = std::cout) {
321 return run(x,x.
dual(),l,l.
dual(),obj,con,bnd,print,outStream,printVectors,vectorStream);
336 std::ostream &outStream = std::cout,
337 bool printVectors =
false,
338 std::ostream &vectorStream = std::cout ) {
340 x.
print(vectorStream);
343 std::vector<std::string> output;
346 if (
state_->iterateVec == ROL::nullPtr ) {
349 state_->iterateVec->set(x);
352 if (
state_->lagmultVec == ROL::nullPtr ) {
355 state_->lagmultVec->set(l);
358 ROL::Ptr<Vector<Real> > s = x.
clone();
361 step_->initialize(x, g, l, c, obj, con, bnd, *
state_);
368 if (
state_->minIterVec == ROL::nullPtr ) {
371 state_->minIterVec->set(x);
380 x.
print(vectorStream);
387 std::stringstream hist;
388 hist <<
"Optimization Terminated with Status: ";
391 output.push_back(hist.str());
393 outStream << hist.str();
399 return step_->printHeader();
406 ROL::Ptr<const AlgorithmState<Real> >
getState(
void)
const {