44 #ifndef ROL_RANDVARFUNCTIONAL_HPP
45 #define ROL_RANDVARFUNCTIONAL_HPP
48 #include "ROL_Ptr.hpp"
92 Ptr<Vector<Real> >
g_;
93 Ptr<Vector<Real> >
hv_;
104 bool isComputed =
false;
110 val = obj.
value(x,tol);
121 bool isComputed =
false;
140 bool isComputed =
false;
157 bool isComputed =
false;
259 virtual void setSample(
const std::vector<Real> &point,
const Real weight) {
260 point_.assign(point.begin(),point.end());
271 if (xstat != nullPtr) {
286 const std::vector<Real> &xstat,
303 const std::vector<Real> &xstat,
326 const std::vector<Real> &vstat,
328 const std::vector<Real> &xstat,
343 const std::vector<Real> &xstat,
362 std::vector<Real> &gstat,
364 const std::vector<Real> &xstat,
381 std::vector<Real> &hvstat,
383 const std::vector<Real> &vstat,
385 const std::vector<Real> &xstat,
virtual void setHessVecStorage(const Ptr< SampledScalar< Real >> &gradvec_storage, const Ptr< SampledVector< Real >> &hessvec_storage)
Provides the interface to evaluate objective functions.
virtual void updateHessVec(Objective< Real > &obj, const Vector< Real > &v, const std::vector< Real > &vstat, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
Update internal risk measure storage for Hessian-time-a-vector computation.
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
void computeHessVec(Vector< Real > &hv, Objective< Real > &obj, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
virtual void setSample(const std::vector< Real > &point, const Real weight)
Real computeValue(Objective< Real > &obj, const Vector< Real > &x, Real &tol)
Ptr< Vector< Real > > hv_
virtual Real value(const Vector< Real > &x, Real &tol)=0
Compute value.
virtual void getHessVec(Vector< Real > &hv, std::vector< Real > &hvstat, const Vector< Real > &v, const std::vector< Real > &vstat, const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
Return risk measure Hessian-times-a-vector.
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
std::vector< Real > point_
Ptr< Vector< Real > > dualVector_
Defines the linear algebra or vector space interface.
virtual Real getValue(const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
Return risk measure value.
virtual Real dot(const Vector &x) const =0
Compute where .
virtual void getGradient(Vector< Real > &g, std::vector< Real > &gstat, const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
Return risk measure (sub)gradient.
void sumAll(Real *input, Real *output, int dim) const
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
virtual void resetStorage(bool flag=true)
Reset internal storage.
Ptr< SampledVector< Real > > hessvec_storage_
virtual void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
virtual void updateGradient(Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
Update internal risk measure storage for gradient computation.
virtual void setStorage(const Ptr< SampledScalar< Real >> &value_storage, const Ptr< SampledVector< Real >> &gradient_storage)
virtual ~RandVarFunctional()
Ptr< SampledScalar< Real > > value_storage_
virtual void updateValue(Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
Update internal storage for value computation.
void useStorage(bool storage)
Ptr< SampledVector< Real > > gradient_storage_
virtual void setParameter(const std::vector< Real > ¶m)
void computeGradient(Vector< Real > &g, Objective< Real > &obj, const Vector< Real > &x, Real &tol)
Ptr< SampledScalar< Real > > gradvec_storage_
Real computeGradVec(Vector< Real > &g, Objective< Real > &obj, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Provides the interface to implement any functional that maps a random variable to a (extended) real n...
virtual void initialize(const Vector< Real > &x)
Initialize temporary variables.
virtual Real computeStatistic(const Ptr< const std::vector< Real >> &xstat) const
Compute statistic.
void useHessVecStorage(bool storage)