35#ifndef ROL_OBJECTIVE_FROM_BOUND_CONSTRAINT_H
36#define ROL_OBJECTIVE_FROM_BOUND_CONSTRAINT_H
41#include "ROL_ParameterList.hpp"
56 typedef Elementwise::Fill<Real>
Fill;
58 typedef Elementwise::Power<Real>
Power;
64 typedef Elementwise::ReductionSum<Real>
Sum;
77 std::string retString;
80 retString =
"Logarithmic";
83 retString =
"Quadratic";
86 retString =
"Double Well";
89 retString =
"Last Type (Dummy)";
92 retString =
"Invalid EBarrierType";
111 const ROL::Ptr<const V>
lo_;
112 const ROL::Ptr<const V>
up_;
122 ROL::ParameterList &parlist ) :
123 lo_( bc.getLowerBound() ),
124 up_( bc.getUpperBound() ) {
132 std::string bfstring = parlist.sublist(
"Barrier Function").get(
"Type",
"Logarithmic");
137 lo_( bc.getLowerBound() ),
138 up_( bc.getUpperBound() ),
150 const Real
zero(0), one(1), two(2);
152 ROL::Ptr<UnaryFunction> func;
154 a_->zero();
b_->zero();
203 a_->applyUnary(
Fill(one));
212 b_->applyUnary(
Fill(one));
221 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
222 ">>>(ObjectiveFromBoundConstraint::value): Undefined barrier function type!");
226 Real result =
b_->reduce(
Sum());
232 const Real
zero(0), one(1), two(2);
234 a_->zero();
b_->zero();
279 a_->applyUnary(
Fill(one));
287 b_->applyUnary(
Fill(one));
304 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
305 ">>>(ObjectiveFromBoundConstraint::gradient): Undefined barrier function type!");
314 const Real one(1), two(2), eight(8);
381 b_->applyUnary(
Fill(two));
388 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
389 ">>>(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.
Create a penalty objective from upper and lower bound vectors.
Real value(const Vector< Real > &x, Real &tol)
Compute value.
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)
Compute gradient.
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)
Apply Hessian approximation to vector.
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
Provides the interface to evaluate objective functions.
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)