44 #ifndef ROL_OBJECTIVE_SIMOPT_H 45 #define ROL_OBJECTIVE_SIMOPT_H 94 Real v = this->
value(u,z,ftol);
96 Teuchos::RCP<Vector<Real> > unew = u.
clone();
101 unew->axpy(h,*(u.
basis(i)));
103 deriv = (this->
value(*unew,z,ftol) - v)/h;
114 Real v = this->
value(u,z,ftol);
116 Teuchos::RCP<Vector<Real> > znew = z.
clone();
118 for (
int i = 0; i < g.
dimension(); i++) {
121 znew->axpy(h,*(z.
basis(i)));
123 deriv = (this->
value(u,*znew,ftol) - v)/h;
132 const ROL::Vector_SimOpt<Real> &xs = Teuchos::dyn_cast<
const ROL::Vector_SimOpt<Real> >(
134 Teuchos::RCP<Vector<Real> > g1 = gs.
get_1()->clone();
135 Teuchos::RCP<Vector<Real> > g2 = gs.
get_2()->clone();
151 h = std::max(1.0,u.
norm()/v.
norm())*tol;
154 Teuchos::RCP<Vector<Real> > unew = u.
clone();
161 Teuchos::RCP<Vector<Real> > g = hv.
clone();
175 h = std::max(1.0,u.
norm()/v.
norm())*tol;
178 Teuchos::RCP<Vector<Real> > znew = z.
clone();
185 Teuchos::RCP<Vector<Real> > g = hv.
clone();
199 h = std::max(1.0,u.
norm()/v.
norm())*tol;
202 Teuchos::RCP<Vector<Real> > unew = u.
clone();
209 Teuchos::RCP<Vector<Real> > g = hv.
clone();
223 h = std::max(1.0,u.
norm()/v.
norm())*tol;
226 Teuchos::RCP<Vector<Real> > znew = z.
clone();
233 Teuchos::RCP<Vector<Real> > g = hv.
clone();
244 const ROL::Vector_SimOpt<Real> &vs = Teuchos::dyn_cast<
const ROL::Vector_SimOpt<Real> >(
246 const ROL::Vector_SimOpt<Real> &xs = Teuchos::dyn_cast<
const ROL::Vector_SimOpt<Real> >(
248 Teuchos::RCP<Vector<Real> > h11 = (hvs.
get_1())->clone();
250 Teuchos::RCP<Vector<Real> > h12 = (hvs.
get_1())->clone();
252 Teuchos::RCP<Vector<Real> > h21 = (hvs.
get_2())->clone();
254 Teuchos::RCP<Vector<Real> > h22 = (hvs.
get_2())->clone();
Provides the interface to evaluate objective functions.
Provides the interface to evaluate simulation-based objective functions.
virtual void scale(const Real alpha)=0
Compute where .
Teuchos::RCP< const Vector< Real > > get_1() const
virtual int dimension() const
Return dimension of the vector space.
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Defines the linear algebra or vector space interface for simulation-based optimization.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
virtual void hessVec_12(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
void set_1(const Vector< Real > &vec)
virtual Teuchos::RCP< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
virtual void gradient_2(Vector< Real > &g, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
Compute gradient with respect to second component.
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
virtual Real dot(const Vector &x) const =0
Compute where .
virtual void hessVec_21(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
virtual Real value(const Vector< Real > &u, const Vector< Real > &z, Real &tol)=0
Compute value.
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
virtual void gradient_1(Vector< Real > &g, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
Compute gradient with respect to first component.
virtual void hessVec_22(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
virtual void update(const Vector< Real > &u, const Vector< Real > &z, bool flag=true, int iter=-1)
Update objective function. u is an iterate, z is an iterate, flag = true if the iterate has changed...
virtual Teuchos::RCP< Vector > basis(const int i) const
Return i-th basis vector.
virtual Real norm() const =0
Returns where .
Real value(const Vector< Real > &x, Real &tol)
Compute value.
virtual void hessVec_11(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
Apply Hessian approximation to vector.
Teuchos::RCP< const Vector< Real > > get_2() const
void set_2(const Vector< Real > &vec)
static const double ROL_EPSILON
Platform-dependent machine epsilon.