SOPT
Sparse OPTimisation
non_differentiable_func.h
Go to the documentation of this file.
1 #ifndef SOPT_NON_DIFFERENTIABLE_FUNC_H
2 #define SOPT_NON_DIFFERENTIABLE_FUNC_H
3 
4 #include <numeric>
5 #include <tuple>
6 #include <utility>
8 
9 // Abstract base class providing the interface for non differentiable functions g(x)
10 // with a proximal operator.
11 template <typename SCALAR> class NonDifferentiableFunc {
12 
13 public:
14  using FB = sopt::algorithm::ForwardBackward<SCALAR>;
15  using Real = typename FB::Real;
16  using t_Vector = typename FB::t_Vector;
17  using t_Proximal = typename FB::t_Proximal;
19 
20  // A function that prints a log message
21  virtual void log_message() const = 0;
22 
23  // Return a function representing the proximal operator for this function.
24  // Function must be of type t_Proximal, that is
25  // void proximal_operator(Vector, real, Vector)
26  virtual t_Proximal proximal_operator() const = 0;
27 
28  // Returns the function itself
29  virtual Real function(t_Vector const &x) const = 0;
30 
31  // Transforms input image to a different basis.
32  // Return linear_transform_identity() if transform not necessary.
33  virtual const t_LinearTransform &Psi() const = 0;
34 
35 }; // class NonDifferentiableFunc
36 #endif
sopt::Vector< Scalar > t_Vector
typename FB::t_Proximal t_Proximal
virtual void log_message() const =0
virtual t_Proximal proximal_operator() const =0
virtual const t_LinearTransform & Psi() const =0
typename FB::t_Vector t_Vector
typename FB::t_LinearTransform t_LinearTransform
sopt::algorithm::ForwardBackward< SCALAR > FB
sopt::LinearTransform< t_Vector > t_LinearTransform