10 #ifndef ROL_OBJECTIVEMMA_H
11 #define ROL_OBJECTIVEMMA_H
30 template <
typename T>
using ROL::Ptr = ROL::Ptr<T>;
58 Real tol=std::sqrt(ROL_EPSILON<Real>()) ) :
61 l_ =
bnd_->getLowerBound();
62 u_ =
bnd_->getUpperBound();
72 Elementwise::ThresholdUpper<Real> positive(0.0);
73 Elementwise::Power<Real> square(2.0);
74 Elementwise::Multiply<Real> mult;
76 obj_->update(x,flag,iter);
82 p_->applyUnary(positive);
83 q_->applyUnary(negative);
87 d_->applyUnary(square);
88 p_->applyBinary(mult,*
d_);
92 d_->applyUnary(square);
93 q_->applyBinary(mult,*
d_);
102 Elementwise::ReductionSum<Real> sum;
103 Elementwise::DivideAndInvert<Real> divinv;
108 d_->applyBinary(divinv,*
p_);
110 fval +=
d_->reduce(sum);
114 d_->applyBinary(divinv,*
q_);
116 fval +=
d_->reduce(sum);
127 Elementwise::DivideAndInvert<Real> divinv;
128 Elementwise::Power<Real> square(2.0);
132 d_->applyUnary(square);
133 d_->applyBinary(divinv,*
p_);
139 d_->applyUnary(square);
140 d_->applyBinary(divinv,*
q_);
148 Elementwise::DivideAndInvert<Real> divinv;
149 Elementwise::Multiply<Real> mult;
150 Elementwise::Power<Real> cube(3.0);
154 d_->applyUnary(cube);
155 d_->applyBinary(divinv,*
p_);
162 d_->applyUnary(cube);
163 d_->applyBinary(divinv,*
q_);
173 Elementwise::DivideAndInvert<Real> divinv;
174 Elementwise::Multiply<Real> mult;
175 Elementwise::Power<Real> cube(3.0);
179 d_->applyUnary(cube);
180 d_->applyBinary(divinv,*
p_);
187 d_->applyUnary(cube);
188 d_->applyBinary(divinv,*
q_);
192 hv.applyBinary(divinv,v);
204 #endif // ROL_OBJECTIVEMMA_H
Provides the interface to evaluate objective functions.
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
virtual void plus(const Vector &x)=0
Compute , where .
Provides the interface to to Method of Moving Asymptotes Objective function.
virtual void applyBinary(const Elementwise::BinaryFunction< Real > &f, const Vector &x)
BoundConstraint< Real > BND
Defines the linear algebra or vector space interface.
ObjectiveMMA(const ROL::Ptr< Objective< Real > > &obj, const ROL::Ptr< BoundConstraint< Real > > &bnd, const Vector< Real > &x, Real tol=std::sqrt(ROL_EPSILON< Real >()))
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.
const ROL::Ptr< OBJ > obj_
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 .
const ROL::Ptr< BND > bnd_