10 #ifndef ROL_RISKNEUTRALOBJECTIVE_HPP
11 #define ROL_RISKNEUTRALOBJECTIVE_HPP
52 const std::vector<Real> ¶m, Real &tol) {
53 bool isComputed =
false;
67 const std::vector<Real> ¶m, Real &tol) {
68 bool isComputed =
false;
82 const std::vector<Real> ¶m, Real &tol) {
93 const bool storage =
true )
104 const bool storage =
true )
114 const bool storage =
true )
127 value_ =
static_cast<Real
>(0);
144 value_ =
static_cast<Real
>(0);
160 Real myval(0), ptval(0), val(0), one(1), two(2), error(two*tol + one);
161 std::vector<Real> ptvals;
162 while ( error > tol ) {
167 ptvals.push_back(ptval);
182 std::vector<Ptr<Vector<Real>>> ptgs;
183 Real one(1), two(2), error(two*tol + one);
184 while ( error > tol ) {
void update(const Vector< Real > &x, UpdateType type, int iter=-1)
Update objective function.
Provides the interface to evaluate objective functions.
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
Ptr< VectorController< Real > > gradient_storage_
RiskNeutralObjective(const Ptr< Objective< Real >> &pObj, const Ptr< SampleGenerator< Real >> &vsampler, const Ptr< SampleGenerator< Real >> &gsampler, const Ptr< SampleGenerator< Real >> &hsampler, const bool storage=true)
Ptr< Vector< Real > > pointDual_
Ptr< Vector< Real > > gradient_
void precond(Vector< Real > &Pv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply preconditioner to vector.
RiskNeutralObjective(const Ptr< Objective< Real >> &pObj, const Ptr< SampleGenerator< Real >> &sampler, const bool storage=true)
void initialize(const Vector< Real > &x)
void getHessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, const std::vector< Real > ¶m, Real &tol)
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
virtual void zero()
Set to zero vector.
Ptr< SampleGenerator< Real > > ValueSampler_
Defines the linear algebra or vector space interface.
RiskNeutralObjective(const Ptr< Objective< Real >> &pObj, const Ptr< SampleGenerator< Real >> &vsampler, const Ptr< SampleGenerator< Real >> &gsampler, const bool storage=true)
Ptr< ScalarController< Real > > value_storage_
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)
Ptr< Objective< Real > > ParametrizedObjective_
Ptr< Vector< Real > > sumDual_
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Real value(const Vector< Real > &x, Real &tol)
Compute value.
Ptr< SampleGenerator< Real > > GradientSampler_
void getGradient(Vector< Real > &g, const Vector< Real > &x, const std::vector< Real > ¶m, Real &tol)
virtual void set(const Vector &x)
Set where .
Ptr< SampleGenerator< Real > > HessianSampler_