10#ifndef ROL_L1OBJECTIVE_H
11#define ROL_L1OBJECTIVE_H
25template<
typename Real>
31 struct ProjSymBnd :
public Elementwise::BinaryFunction<Real> {
32 Real
apply(
const Real &xc,
const Real &yc)
const {
return std::min(yc, std::max(-yc, xc)); }
51 tmp_->applyUnary(Elementwise::AbsoluteValue<Real>());
64 return tmp_->apply(d);
69 Pv.
axpy(
static_cast<Real
>(-1), v);
70 Pv.
scale(
static_cast<Real
>(1) / t);
Provides the interface to evaluate objective functions.
Defines the linear algebra or vector space interface.
virtual void set(const Vector &x)
Set where .
virtual void applyUnary(const Elementwise::UnaryFunction< Real > &f)
virtual void applyBinary(const Elementwise::BinaryFunction< Real > &f, const Vector &x)
virtual void scale(const Real alpha)=0
Compute where .
virtual void plus(const Vector &x)=0
Compute , where .
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Provides the interface to evaluate the weighted/shifted l1 objective function.
l1Objective(const Ptr< Vector< Real > > &weights, const Ptr< Vector< Real > > &shift)
const Ptr< Vector< Real > > shift_
void prox(Vector< Real > &Pv, const Vector< Real > &v, Real t, Real &tol)
Compute the proximity operator.
const Ptr< Vector< Real > > weights_
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Ptr< Vector< Real > > tmp_
Real dirDeriv(const Vector< Real > &x, const Vector< Real > &d, Real &tol)
Compute directional derivative.
ROL::l1Objective::ProjSymBnd psb_
l1Objective(const Ptr< Vector< Real > > &weights)
Real value(const Vector< Real > &x, Real &tol)
Compute value.
Real apply(const Real &xc, const Real &yc) const