44 #ifndef ROL_RANDVARFUNCTIONAL_HPP
45 #define ROL_RANDVARFUNCTIONAL_HPP
48 #include "ROL_Ptr.hpp"
91 Ptr<Vector<Real> >
g_;
92 Ptr<Vector<Real> >
hv_;
103 bool isComputed =
false;
109 val = obj.
value(x,tol);
120 bool isComputed =
false;
139 bool isComputed =
false;
156 bool isComputed =
false;
258 virtual void setSample(
const std::vector<Real> &point,
const Real weight) {
259 point_.assign(point.begin(),point.end());
270 if (xstat != nullPtr) {
285 const std::vector<Real> &xstat,
302 const std::vector<Real> &xstat,
325 const std::vector<Real> &vstat,
327 const std::vector<Real> &xstat,
342 const std::vector<Real> &xstat,
361 std::vector<Real> &gstat,
363 const std::vector<Real> &xstat,
380 std::vector<Real> &hvstat,
382 const std::vector<Real> &vstat,
384 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)