10 #ifndef PH_PROBOBJECTIVE_H
11 #define PH_PROBOBJECTIVE_H
26 const Ptr<Objective<Real>>
obj_;
56 const Real one(1), two(2);
59 Real ex = std::exp(-two*x/
eps_);
62 else if (deriv == 1) {
63 Real ex = std::exp(-two*x/
eps_);
64 val = (two/
eps_)*ex/std::pow(one+ex,2);
66 else if (deriv == 2) {
67 Real ex = std::exp(two*x/
eps_);
68 val = std::pow(two/
eps_,2)*ex*(one-ex)/std::pow(one+ex,3);
76 ParameterList &parlist)
81 ParameterList &list = parlist.sublist(
"SOL").sublist(
"Probability").sublist(
"Smoothed POE");
83 eps_ = list.get<Real>(
"Smoothing Parameter");
87 obj_->update(x,flag,iter);
95 if (std::abs(prob) > ROL_EPSILON<Real>()) {
98 return static_cast<Real
>(0);
104 if (std::abs(prob) > ROL_EPSILON<Real>()) {
117 if (std::abs(prob1) > ROL_EPSILON<Real>()) {
118 obj_->hessVec(hv,v,x,tol);
124 if (std::abs(prob2) > ROL_EPSILON<Real>()) {
133 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...
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 .
Provides the interface for the progressive hedging probability objective.
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
const Ptr< Objective< Real > > obj_
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
void getGradient(const Vector< Real > &x, Real &tol)
void getValue(const Vector< Real > &x, Real &tol)
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
PH_ProbObjective(const Ptr< Objective< Real >> &obj, ParameterList &parlist)
Real value(const Vector< Real > &x, Real &tol)
Compute value.
virtual void setParameter(const std::vector< Real > ¶m)
void setParameter(const std::vector< Real > ¶m)
Real smoothHeaviside(const Real x, const int deriv=0) const
virtual void set(const Vector &x)
Set where .
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
bool isGradientInitialized_