35 #ifndef ROL_OBJECTIVE_FROM_BOUND_CONSTRAINT_H 36 #define ROL_OBJECTIVE_FROM_BOUND_CONSTRAINT_H 41 #include "Teuchos_ParameterList.hpp" 56 typedef Elementwise::Axpy<Real>
Axpy;
57 typedef Elementwise::Aypx<Real>
Aypx;
58 typedef Elementwise::Scale<Real>
Scale;
60 typedef Elementwise::Power<Real>
Power;
66 typedef Elementwise::ReductionSum<Real>
Sum;
79 std::string retString;
82 retString =
"Logarithmic";
85 retString =
"Quadratic";
88 retString =
"Double Well";
91 retString =
"Last Type (Dummy)";
94 retString =
"Invalid EBarrierType";
116 const Teuchos::RCP<const V>
lo_;
117 const Teuchos::RCP<const V>
up_;
125 Teuchos::ParameterList &parlist ) :
126 lo_( bc.getLowerVectorRCP() ),
127 up_( bc.getUpperVectorRCP() ) {
132 std::string bfstring = parlist.sublist(
"Barrier Function").get(
"Type",
"Logarithmic");
137 lo_( bc.getLowerVectorRCP() ),
138 up_( bc.getUpperVectorRCP() )
147 Teuchos::RCP<UnaryFunction> func;
153 a_->applyBinary(
Aypx(-1.0),x);
169 a_->applyBinary(
Aypx(-1.0),x);
174 b_->applyBinary(
Aypx(-1.0),x);
185 a_->applyBinary(
Aypx(-1.0),x);
197 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
198 ">>>(ObjectiveFromBoundConstraint::value): Undefined barrier function type!");
203 Real result =
b_->reduce(
Sum());
214 a_->applyBinary(
Aypx(-1.0),x);
229 a_->applyBinary(
Aypx(-1.0),x);
233 b_->applyBinary(
Aypx(-1.0),x);
243 a_->applyBinary(
Aypx(-1.0),x);
258 b_->applyBinary(
Aypx(-1.0),x);
264 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
265 ">>>(ObjectiveFromBoundConstraint::gradient): Undefined barrier function type!");
280 a_->applyBinary(
Axpy(-1.0),x);
296 a_->applyBinary(
Axpy(-1.0),x);
301 b_->applyBinary(
Axpy(-1.0),x);
311 a_->applyBinary(
Axpy(-1.0),x);
335 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
336 ">>>(ObjectiveFromBoundConstraint::hessVec): Undefined barrier function type!");
357 #endif // ROL_OBJECTIVE_FROM_BOUND_CONSTRAINT_H Provides the interface to evaluate objective functions.
const Teuchos::RCP< 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
Elementwise::Logarithm< Real > Logarithm
ObjectiveFromBoundConstraint(const BoundConstraint< Real > &bc)
Elementwise::Power< Real > Power
Defines the linear algebra or vector space interface.
Teuchos::RCP< Vector< Real > > getBarrierVector(void)
Elementwise::Scale< Real > Scale
Elementwise::ReductionSum< Real > Sum
enum ROL::ObjectiveFromBoundConstraint::EBarrierType eBarrierType_
std::string EBarrierToString(EBarrierType type)
ObjectiveFromBoundConstraint(const BoundConstraint< Real > &bc, Teuchos::ParameterList &parlist)
Elementwise::UnaryFunction< Real > UnaryFunction
Elementwise::Aypx< Real > Aypx
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.
Elementwise::Axpy< Real > Axpy
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
virtual void set(const Vector &x)
Set where .
const Teuchos::RCP< const V > lo_
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.