44 #ifndef ROL_RISKNEUTRALOBJECTIVE_HPP 45 #define ROL_RISKNEUTRALOBJECTIVE_HPP 47 #include "Teuchos_RefCountPtr.hpp" 74 const std::vector<Real> ¶m, Real &tol) {
82 value_storage_.insert(std::pair<std::vector<Real>,Real>(param,val));
88 const std::vector<Real> ¶m, Real &tol) {
96 Teuchos::RCP<Vector<Real> > tmp = g.
clone();
104 const std::vector<Real> ¶m, Real &tol) {
117 const bool storage =
true )
128 const bool storage =
true )
138 const bool storage =
true )
170 Real myval(0), ptval(0), val(0), one(1), two(2), error(two*tol + one);
171 std::vector<Real> ptvals;
172 while ( error > tol ) {
177 ptvals.push_back(ptval);
190 std::vector<Teuchos::RCP<Vector<Real> > > ptgs;
191 Real one(1), two(2), error(two*tol + one);
192 while ( error > tol ) {
Provides the interface to evaluate objective functions.
virtual void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
RiskNeutralObjective(const Teuchos::RCP< Objective< Real > > &pObj, const Teuchos::RCP< SampleGenerator< Real > > &vsampler, const Teuchos::RCP< SampleGenerator< Real > > &gsampler, const Teuchos::RCP< SampleGenerator< Real > > &hsampler, const bool storage=true)
Teuchos::RCP< SampleGenerator< Real > > GradientSampler_
Teuchos::RCP< Vector< Real > > sumDual_
Teuchos::RCP< SampleGenerator< Real > > ValueSampler_
virtual Teuchos::RCP< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
void getHessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, const std::vector< Real > ¶m, Real &tol)
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
Teuchos::RCP< Vector< Real > > gradient_
Teuchos::RCP< Objective< Real > > ParametrizedObjective_
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
virtual ~RiskNeutralObjective()
Teuchos::RCP< Vector< Real > > pointDual_
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
void getValue(Real &val, const Vector< Real > &x, const std::vector< Real > ¶m, Real &tol)
virtual void precond(Vector< Real > &Pv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply preconditioner to vector.
std::map< std::vector< Real >, Real > value_storage_
std::map< std::vector< Real >, Teuchos::RCP< Vector< Real > > > gradient_storage_
virtual void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
void getGradient(Vector< Real > &g, const Vector< Real > &x, const std::vector< Real > ¶m, Real &tol)
RiskNeutralObjective(const Teuchos::RCP< Objective< Real > > &pObj, const Teuchos::RCP< SampleGenerator< Real > > &sampler, const bool storage=true)
RiskNeutralObjective(const Teuchos::RCP< Objective< Real > > &pObj, const Teuchos::RCP< SampleGenerator< Real > > &vsampler, const Teuchos::RCP< SampleGenerator< Real > > &gsampler, const bool storage=true)
virtual Real value(const Vector< Real > &x, Real &tol)
Compute value.
virtual void set(const Vector &x)
Set where .
Teuchos::RCP< SampleGenerator< Real > > HessianSampler_