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));
220 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
221 ">>>(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));
303 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
304 ">>>(ObjectiveFromBoundConstraint::gradient): Undefined barrier function type!");
314 const Real one(1), two(2), eight(8);
381 b_->applyUnary(
Fill(two));
387 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
388 ">>>(ObjectiveFromBoundConstraint::hessVec): Undefined barrier function type!");
409 #endif // ROL_OBJECTIVE_FROM_BOUND_CONSTRAINT_H
Provides the interface to evaluate objective functions.
const ROL::Ptr< const V > up_
virtual void applyBinary(const Elementwise::BinaryFunction< Real > &f, const Vector &x)
Elementwise::Multiply< Real > Multiply
std::string removeStringFormat(std::string s)
Elementwise::ThresholdUpper< Real > ThresholdUpper
ROL::Ptr< Vector< Real > > getBarrierVector(void)
Elementwise::Logarithm< Real > Logarithm
ObjectiveFromBoundConstraint(const BoundConstraint< Real > &bc)
Elementwise::Power< Real > Power
Defines the linear algebra or vector space interface.
ObjectiveFromBoundConstraint(const BoundConstraint< Real > &bc, ROL::ParameterList &parlist)
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
Elementwise::ReductionSum< Real > Sum
enum ROL::ObjectiveFromBoundConstraint::EBarrierType eBarrierType_
std::string EBarrierToString(EBarrierType type)
Elementwise::UnaryFunction< Real > UnaryFunction
EBarrierType StringToEBarrierType(std::string s)
Elementwise::Reciprocal< Real > Reciprocal
Provides the interface to apply upper and lower bound constraints.
Elementwise::Heaviside< Real > Heaviside
Real value(const Vector< Real > &x, Real &tol)
Compute value.
const ROL::Ptr< const V > lo_
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
virtual void set(const Vector &x)
Set where .
bool isLowerActivated(void) const
Check if lower bound are on.
Elementwise::Fill< Real > Fill
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
Elementwise::ThresholdLower< Real > ThresholdLower
Create a penalty objective from upper and lower bound vectors.
bool isUpperActivated(void) const
Check if upper bound are on.