44 #ifndef ROL_SIMULATED_OBJECTIVE_H 45 #define ROL_SIMULATED_OBJECTIVE_H 55 const Teuchos::RCP<SampleGenerator<Real> >
sampler_;
56 const Teuchos::RCP<Objective_SimOpt<Real> >
pobj_;
69 Teuchos::RCP<const Vector<Real> > uptr = uz.
get_1();
70 Teuchos::RCP<const Vector<Real> > zptr = uz.
get_2();
73 std::vector<Real> param;
79 param =
sampler_->getMyPoint(static_cast<int>(i));
80 weight =
sampler_->getMyWeight(static_cast<int>(i));
81 pobj_->setParameter(param);
82 tmpval =
pobj_->value(*(pu.
get(i)), *zptr, tol);
83 tmpsum += tmpval*weight;
95 Teuchos::RCP<const Vector<Real> > xuptr = xuz.
get_1();
96 Teuchos::RCP<const Vector<Real> > xzptr = xuz.
get_2();
100 Teuchos::RCP<Vector<Real> > guptr = guz.
get_1();
101 Teuchos::RCP<Vector<Real> > gzptr = guz.
get_2();
104 std::vector<Real> param;
106 Teuchos::RCP<Vector<Real> > tmp1 = gzptr->clone();
107 Teuchos::RCP<Vector<Real> > tmp2 = gzptr->clone();
109 param =
sampler_->getMyPoint(static_cast<int>(i));
110 weight =
sampler_->getMyWeight(static_cast<int>(i));
111 pobj_->setParameter(param);
114 pobj_->gradient(gi, xi, tol);
130 Teuchos::RCP<const Vector<Real> > xuptr = xuz.
get_1();
131 Teuchos::RCP<const Vector<Real> > xzptr = xuz.
get_2();
135 Teuchos::RCP<const Vector<Real> > vuptr = vuz.
get_1();
136 Teuchos::RCP<const Vector<Real> > vzptr = vuz.
get_2();
140 Teuchos::RCP<Vector<Real> > hvuptr = hvuz.
get_1();
141 Teuchos::RCP<Vector<Real> > hvzptr = hvuz.
get_2();
144 std::vector<Real> param;
146 Teuchos::RCP<Vector<Real> > tmp1 = hvzptr->clone();
147 Teuchos::RCP<Vector<Real> > tmp2 = hvzptr->clone();
149 param =
sampler_->getMyPoint(static_cast<int>(i));
150 weight =
sampler_->getMyWeight(static_cast<int>(i));
151 pobj_->setParameter(param);
155 pobj_->hessVec(hvi, vi, xi, tol);
Provides the interface to evaluate objective functions.
Provides the interface to evaluate simulation-based objective functions.
const Teuchos::RCP< SampleGenerator< Real > > sampler_
Defines the linear algebra or vector space interface for simulation-based optimization.
size_type numVectors() const
Teuchos::RCP< const Vector< Real > > get_2() const
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
Defines the linear algebra of a vector space on a generic partitioned vector where the individual vec...
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
const Teuchos::RCP< Objective_SimOpt< Real > > pobj_
virtual void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
virtual ~SimulatedObjective()
Teuchos::RCP< const Vector< Real > > get_1() const
Real value(const Vector< Real > &x, Real &tol)
Compute value.
SimulatedObjective(const Teuchos::RCP< SampleGenerator< Real > > &sampler, const Teuchos::RCP< Objective_SimOpt< Real > > &pobj)
Teuchos::RCP< const Vector< Real > > get(size_type i) const