44 #ifndef ROL_OBJECTIVEMMA_H 45 #define ROL_OBJECTIVEMMA_H 64 template <
typename T>
using RCP = Teuchos::RCP<T>;
92 Real tol=std::sqrt(ROL_EPSILON<Real>()) ) :
93 obj_(obj), bnd_(bnd), tol_(tol) {
95 l_ = bnd_->getLowerVectorRCP();
96 u_ = bnd_->getUpperVectorRCP();
106 Elementwise::ThresholdUpper<Real> positive(0.0);
107 Elementwise::Power<Real> square(2.0);
108 Elementwise::Multiply<Real> mult;
110 obj_->update(x,flag,iter);
112 fval_ = obj_->value(x,tol);
113 obj_->gradient(*p_,x,tol);
116 p_->applyUnary(positive);
117 q_->applyUnary(negative);
121 d_->applyUnary(square);
122 p_->applyBinary(mult,*d_);
126 d_->applyUnary(square);
127 q_->applyBinary(mult,*d_);
136 Elementwise::ReductionSum<Real> sum;
137 Elementwise::DivideAndInvert<Real> divinv;
142 d_->applyBinary(divinv,*p_);
144 fval += d_->reduce(sum);
148 d_->applyBinary(divinv,*q_);
150 fval += d_->reduce(sum);
161 Elementwise::DivideAndInvert<Real> divinv;
162 Elementwise::Power<Real> square(2.0);
166 d_->applyUnary(square);
167 d_->applyBinary(divinv,*p_);
173 d_->applyUnary(square);
174 d_->applyBinary(divinv,*q_);
182 Elementwise::DivideAndInvert<Real> divinv;
183 Elementwise::Multiply<Real> mult;
184 Elementwise::Power<Real> cube(3.0);
188 d_->applyUnary(cube);
189 d_->applyBinary(divinv,*p_);
196 d_->applyUnary(cube);
197 d_->applyBinary(divinv,*q_);
207 Elementwise::DivideAndInvert<Real> divinv;
208 Elementwise::Multiply<Real> mult;
209 Elementwise::Power<Real> cube(3.0);
213 d_->applyUnary(cube);
214 d_->applyBinary(divinv,*p_);
221 d_->applyUnary(cube);
222 d_->applyBinary(divinv,*q_);
226 hv.applyBinary(divinv,v);
238 #endif // ROL_OBJECTIVEMMA_H Provides the interface to evaluate objective functions.
virtual void plus(const Vector &x)=0
Compute , where .
Provides the interface to to Method of Moving Asymptotes Objective function.
ObjectiveMMA(const Teuchos::RCP< Objective< Real > > &obj, const Teuchos::RCP< BoundConstraint< Real > > &bnd, const Vector< Real > &x, Real tol=std::sqrt(ROL_EPSILON< Real >()))
virtual void applyBinary(const Elementwise::BinaryFunction< Real > &f, const Vector &x)
BoundConstraint< Real > BND
virtual Teuchos::RCP< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
Defines the linear algebra or vector space interface.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
void invHessVec(Vector< Real > &h, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply inverse Hessian approximation to vector.
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
Provides the interface to apply upper and lower bound constraints.
Real value(const Vector< Real > &x, Real &tol)
Compute value.
virtual void set(const Vector &x)
Set where .