10 #ifndef ROL_L1OBJECTIVE_H
11 #define ROL_L1OBJECTIVE_H
25 template<
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.
virtual void scale(const Real alpha)=0
Compute where .
virtual void plus(const Vector &x)=0
Compute , where .
const double weights[4][5]
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
virtual void applyBinary(const Elementwise::BinaryFunction< Real > &f, const Vector &x)
void prox(Vector< Real > &Pv, const Vector< Real > &v, Real t, Real &tol)
l1Objective(const Ptr< Vector< Real >> &weights)
Defines the linear algebra or vector space interface.
Real value(const Vector< Real > &x, Real &tol)
Compute value.
ROL::l1Objective::ProjSymBnd psb_
Real dirDeriv(const Vector< Real > &x, const Vector< Real > &d, Real &tol)
Compute directional derivative.
virtual void applyUnary(const Elementwise::UnaryFunction< Real > &f)
const Ptr< Vector< Real > > weights_
Ptr< Vector< Real > > tmp_
Provides the interface to evaluate the weighted/shifted l1 objective function.
virtual void set(const Vector &x)
Set where .
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
l1Objective(const Ptr< Vector< Real >> &weights, const Ptr< Vector< Real >> &shift)
const Ptr< Vector< Real > > shift_
Real apply(const Real &xc, const Real &yc) const