10 #ifndef PH_ERROROBJECTIVE_H
11 #define PH_ERROROBJECTIVE_H
27 const Ptr<Objective<Real>>
obj_;
28 Ptr<ExpectationQuad<Real>>
quad_;
58 ParameterList &parlist)
63 std::string risk = parlist.sublist(
"SOL").sublist(
"Error Measure").get(
"Name",
"Least Squares");
67 quad_ = makePtr<MeanVarianceQuadrangle<Real>>(parlist);
break;
69 quad_ = makePtr<TruncatedMeanQuadrangle<Real>>(parlist);
break;
71 quad_ = makePtr<QuantileQuadrangle<Real>>(parlist);
break;
73 quad_ = makePtr<MoreauYosidaCVaR<Real>>(parlist);
break;
75 quad_ = makePtr<GenMoreauYosidaCVaR<Real>>(parlist);
break;
77 quad_ = makePtr<LogExponentialQuadrangle<Real>>(parlist);
break;
79 quad_ = makePtr<LogQuantileQuadrangle<Real>>(parlist);
break;
81 quad_ = makePtr<SmoothedWorstCaseQuadrangle<Real>>(parlist);
break;
83 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
84 "Invalid error measure type " << risk <<
"!");
89 obj_->update(x,flag,iter);
114 obj_->hessVec(hv,v,x,tol);
119 obj_->setParameter(param);
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...
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
const Ptr< Objective< Real > > obj_
virtual void scale(const Real alpha)=0
Compute where .
virtual Real apply(const Vector< Real > &x) const
Apply to a dual vector. This is equivalent to the call .
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
Defines the linear algebra or vector space interface.
void getValue(const Vector< Real > &x, Real &tol)
Real value(const Vector< Real > &x, Real &tol)
Compute value.
Provides the interface for the progressive hedging error objective.
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
bool isGradientInitialized_
Ptr< ExpectationQuad< Real > > quad_
virtual void setParameter(const std::vector< Real > ¶m)
EErrorMeasure StringToEErrorMeasure(std::string s)
virtual void set(const Vector &x)
Set where .
PH_ErrorObjective(const Ptr< Objective< Real >> &obj, ParameterList &parlist)
void setParameter(const std::vector< Real > ¶m)
void getGradient(const Vector< Real > &x, Real &tol)