44 #ifndef PH_PROBOBJECTIVE_H
45 #define PH_PROBOBJECTIVE_H
60 const Ptr<Objective<Real>>
obj_;
90 const Real one(1), two(2);
93 Real ex = std::exp(-two*x/
eps_);
96 else if (deriv == 1) {
97 Real ex = std::exp(-two*x/
eps_);
98 val = (two/
eps_)*ex/std::pow(one+ex,2);
100 else if (deriv == 2) {
101 Real ex = std::exp(two*x/
eps_);
102 val = std::pow(two/
eps_,2)*ex*(one-ex)/std::pow(one+ex,3);
110 ParameterList &parlist)
115 ParameterList &list = parlist.sublist(
"SOL").sublist(
"Probability").sublist(
"Smoothed POE");
117 eps_ = list.get<Real>(
"Smoothing Parameter");
121 obj_->update(x,flag,iter);
129 if (std::abs(prob) > ROL_EPSILON<Real>()) {
132 return static_cast<Real
>(0);
138 if (std::abs(prob) > ROL_EPSILON<Real>()) {
151 if (std::abs(prob1) > ROL_EPSILON<Real>()) {
152 obj_->hessVec(hv,v,x,tol);
158 if (std::abs(prob2) > ROL_EPSILON<Real>()) {
160 Real gv = v.
dot(
g_->dual());
166 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 .
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.
virtual Real dot(const Vector &x) const =0
Compute where .
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_