44 #ifndef PH_ERROROBJECTIVE_H
45 #define PH_ERROROBJECTIVE_H
61 const Ptr<Objective<Real>>
obj_;
62 Ptr<ExpectationQuad<Real>>
quad_;
92 ParameterList &parlist)
97 std::string risk = parlist.sublist(
"SOL").sublist(
"Error Measure").get(
"Name",
"Least Squares");
101 quad_ = makePtr<MeanVarianceQuadrangle<Real>>(parlist);
break;
103 quad_ = makePtr<TruncatedMeanQuadrangle<Real>>(parlist);
break;
105 quad_ = makePtr<QuantileQuadrangle<Real>>(parlist);
break;
107 quad_ = makePtr<MoreauYosidaCVaR<Real>>(parlist);
break;
109 quad_ = makePtr<GenMoreauYosidaCVaR<Real>>(parlist);
break;
111 quad_ = makePtr<LogExponentialQuadrangle<Real>>(parlist);
break;
113 quad_ = makePtr<LogQuantileQuadrangle<Real>>(parlist);
break;
115 quad_ = makePtr<SmoothedWorstCaseQuadrangle<Real>>(parlist);
break;
117 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
118 "Invalid error measure type " << risk <<
"!");
123 obj_->update(x,flag,iter);
146 Real gv = v.
dot(
g_->dual());
147 obj_->hessVec(hv,v,x,tol);
152 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 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.
virtual Real dot(const Vector &x) const =0
Compute where .
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)