10#ifndef ROL_OBJECTIVE_FROM_BOUND_CONSTRAINT_H
11#define ROL_OBJECTIVE_FROM_BOUND_CONSTRAINT_H
16#include "ROL_ParameterList.hpp"
31 typedef Elementwise::Fill<Real>
Fill;
33 typedef Elementwise::Power<Real>
Power;
39 typedef Elementwise::ReductionSum<Real>
Sum;
52 std::string retString;
55 retString =
"Logarithmic";
58 retString =
"Quadratic";
61 retString =
"Double Well";
64 retString =
"Last Type (Dummy)";
67 retString =
"Invalid EBarrierType";
86 const ROL::Ptr<const V>
lo_;
87 const ROL::Ptr<const V>
up_;
97 ROL::ParameterList &parlist ) :
98 lo_( bc.getLowerBound() ),
99 up_( bc.getUpperBound() ) {
107 std::string bfstring = parlist.sublist(
"Barrier Function").get(
"Type",
"Logarithmic");
112 lo_( bc.getLowerBound() ),
113 up_( bc.getUpperBound() ),
125 const Real
zero(0), one(1), two(2);
127 ROL::Ptr<UnaryFunction> func;
129 a_->zero();
b_->zero();
178 a_->applyUnary(
Fill(one));
187 b_->applyUnary(
Fill(one));
196 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
197 ">>>(ObjectiveFromBoundConstraint::value): Undefined barrier function type!");
201 Real result =
b_->reduce(
Sum());
207 const Real
zero(0), one(1), two(2);
209 a_->zero();
b_->zero();
254 a_->applyUnary(
Fill(one));
262 b_->applyUnary(
Fill(one));
279 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
280 ">>>(ObjectiveFromBoundConstraint::gradient): Undefined barrier function type!");
289 const Real one(1), two(2), eight(8);
356 b_->applyUnary(
Fill(two));
363 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
364 ">>>(ObjectiveFromBoundConstraint::hessVec): Undefined barrier function type!");
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0 zero)()
Provides the interface to apply upper and lower bound constraints.
bool isLowerActivated(void) const
Check if lower bound are on.
bool isUpperActivated(void) const
Check if upper bound are on.
Real value(const Vector< Real > &x, Real &tol)
EBarrierType StringToEBarrierType(std::string s)
Elementwise::ThresholdLower< Real > ThresholdLower
Elementwise::Multiply< Real > Multiply
Elementwise::Reciprocal< Real > Reciprocal
Elementwise::ReductionSum< Real > Sum
Elementwise::Heaviside< Real > Heaviside
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
enum ROL::ObjectiveFromBoundConstraint::EBarrierType eBarrierType_
ObjectiveFromBoundConstraint(const BoundConstraint< Real > &bc)
ROL::Ptr< Vector< Real > > getBarrierVector(void)
Elementwise::Logarithm< Real > Logarithm
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
std::string EBarrierToString(EBarrierType type)
Elementwise::Power< Real > Power
const ROL::Ptr< const V > lo_
const ROL::Ptr< const V > up_
Elementwise::ThresholdUpper< Real > ThresholdUpper
Elementwise::UnaryFunction< Real > UnaryFunction
ObjectiveFromBoundConstraint(const BoundConstraint< Real > &bc, ROL::ParameterList &parlist)
Elementwise::Fill< Real > Fill
Defines the linear algebra or vector space interface.
virtual void set(const Vector &x)
Set where .
virtual void applyBinary(const Elementwise::BinaryFunction< Real > &f, const Vector &x)
std::string removeStringFormat(std::string s)