44 #ifndef ROL_RISKNEUTRALOBJECTIVE_HPP
45 #define ROL_RISKNEUTRALOBJECTIVE_HPP
73 const std::vector<Real> ¶m, Real &tol) {
81 value_storage_.insert(std::pair<std::vector<Real>,Real>(param,val));
87 const std::vector<Real> ¶m, Real &tol) {
95 ROL::Ptr<Vector<Real> > tmp = g.
clone();
103 const std::vector<Real> ¶m, Real &tol) {
116 const bool storage =
true )
127 const bool storage =
true )
137 const bool storage =
true )
154 value_ =
static_cast<Real
>(0);
158 if ( flag && iter>=0 ) {
169 Real myval(0), ptval(0), val(0), one(1), two(2), error(two*tol + one);
170 std::vector<Real> ptvals;
171 while ( error > tol ) {
176 ptvals.push_back(ptval);
190 std::vector<ROL::Ptr<Vector<Real> > > ptgs;
191 Real one(1), two(2), error(two*tol + one);
192 while ( error > tol ) {
Provides the interface to evaluate objective functions.
ROL::Ptr< Vector< Real > > pointDual_
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
virtual void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
RiskNeutralObjective(const ROL::Ptr< Objective< Real > > &pObj, const ROL::Ptr< SampleGenerator< Real > > &vsampler, const ROL::Ptr< SampleGenerator< Real > > &gsampler, const ROL::Ptr< SampleGenerator< Real > > &hsampler, const bool storage=true)
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.
ROL::Ptr< Vector< Real > > sumDual_
virtual ~RiskNeutralObjective()
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)
std::map< std::vector< Real >, ROL::Ptr< Vector< Real > > > gradient_storage_
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_
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 ROL::Ptr< Objective< Real > > &pObj, const ROL::Ptr< SampleGenerator< Real > > &sampler, const bool storage=true)
ROL::Ptr< Vector< Real > > gradient_
virtual Real value(const Vector< Real > &x, Real &tol)
Compute value.
virtual void set(const Vector &x)
Set where .
ROL::Ptr< SampleGenerator< Real > > GradientSampler_
ROL::Ptr< SampleGenerator< Real > > ValueSampler_
ROL::Ptr< Objective< Real > > ParametrizedObjective_
ROL::Ptr< SampleGenerator< Real > > HessianSampler_
RiskNeutralObjective(const ROL::Ptr< Objective< Real > > &pObj, const ROL::Ptr< SampleGenerator< Real > > &vsampler, const ROL::Ptr< SampleGenerator< Real > > &gsampler, const bool storage=true)