10 #ifndef ROL_RANDVARFUNCTIONAL_HPP
11 #define ROL_RANDVARFUNCTIONAL_HPP
15 #include "ROL_Ptr.hpp"
59 Ptr<Vector<Real> >
g_;
60 Ptr<Vector<Real> >
hv_;
71 bool isComputed =
false;
77 val = obj.
value(x,tol);
88 bool isComputed =
false;
107 bool isComputed =
false;
125 bool isComputed =
false;
237 virtual void setSample(
const std::vector<Real> &point,
const Real weight) {
238 point_.assign(point.begin(),point.end());
249 if (xstat != nullPtr && !xstat->empty()) {
264 const std::vector<Real> &xstat,
281 const std::vector<Real> &xstat,
304 const std::vector<Real> &vstat,
306 const std::vector<Real> &xstat,
321 const std::vector<Real> &xstat,
340 std::vector<Real> &gstat,
342 const std::vector<Real> &xstat,
359 std::vector<Real> &hvstat,
361 const std::vector<Real> &vstat,
363 const std::vector<Real> &xstat,
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)
virtual Real apply(const Vector< Real > &x) const
Apply to a dual vector. This is equivalent to the call .
Real computeValue(Objective< Real > &obj, const Vector< Real > &x, Real &tol)
Ptr< VectorController< Real > > hessvec_storage_
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.
virtual void resetStorage(UpdateType type)
std::vector< Real > point_
Ptr< Vector< Real > > dualVector_
virtual void setStorage(const Ptr< ScalarController< Real >> &value_storage, const Ptr< VectorController< Real >> &gradient_storage)
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 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.
virtual void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Ptr< ScalarController< Real > > value_storage_
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 ~RandVarFunctional()
Ptr< ScalarController< Real > > gradvec_storage_
virtual void updateValue(Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
Update internal storage for value computation.
Ptr< VectorController< Real > > gradient_storage_
void useStorage(bool storage)
virtual void setParameter(const std::vector< Real > ¶m)
void computeGradient(Vector< Real > &g, Objective< Real > &obj, const Vector< Real > &x, Real &tol)
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 setHessVecStorage(const Ptr< ScalarController< Real >> &gradvec_storage, const Ptr< VectorController< Real >> &hessvec_storage)
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)