SOPT
Sparse OPTimisation
Classes | Public Types | Public Member Functions | List of all members
sopt::proximal::L1< SCALAR > Class Template Reference

L1 proximal, including linear transform. More...

#include <l1_proximal.h>

+ Inheritance diagram for sopt::proximal::L1< SCALAR >:
+ Collaboration diagram for sopt::proximal::L1< SCALAR >:

Classes

class  Breaker
 
struct  Diagnostic
 How did calling L1 go? More...
 
struct  DiagnosticAndResult
 Result from calling L1. More...
 
class  FistaMixing
 
class  NoMixing
 

Public Types

using Scalar = typename L1TightFrame< SCALAR >::Scalar
 Underlying scalar type. More...
 
using Real = typename L1TightFrame< SCALAR >::Real
 Underlying real scalar type. More...
 

Public Member Functions

template<typename T0 >
Diagnostic operator() (Eigen::MatrixBase< T0 > &out, Real gamma, Vector< Scalar > const &x) const
 Computes proximal for given γ More...
 
template<typename T0 >
DiagnosticAndResult operator() (Real const &gamma, Eigen::MatrixBase< T0 > const &x) const
 Lazy version. More...
 
 L1 ()
 
 SOPT_MACRO (itermax, t_uint)
 Maximum number of iterations before bailing out. More...
 
 SOPT_MACRO (tolerance, Real)
 Tolerance criteria. More...
 
 SOPT_MACRO (positivity_constraint, bool)
 Whether to apply positivity constraints. More...
 
 SOPT_MACRO (real_constraint, bool)
 Whether the output should be constrained to be real. More...
 
 SOPT_MACRO (fista_mixing, bool)
 Whether to do fista mixing or not. More...
 
Vector< Real > const & weights () const
 Weights of the l1 norm. More...
 
template<typename T >
L1< Scalar > & weights (Eigen::MatrixBase< T > const &w)
 Set weights to an array of values. More...
 
L1< Scalar > & weights (Real const &w)
 Set weights to a single value. More...
 
Real nu () const
 Bounds on the squared norm of the operator Ψ More...
 
L1< Scalar > & nu (Real const &nu)
 Sets the bound on the squared norm of the operator Ψ More...
 
LinearTransform< Vector< Scalar > > const & Psi () const
 Linear transform applied to input prior to L1 norm. More...
 
L1< Scalar > &::type Psi (ARGS &&... args)
 
template<typename... T>
auto tight_frame (T &&... args) const -> decltype(this->L1TightFrame< Scalar >::operator()(std::forward< T >(args)...))
 Special case if Ψ ia a tight frame. More...
 

Detailed Description

template<typename SCALAR>
class sopt::proximal::L1< SCALAR >

L1 proximal, including linear transform.

This function computes the prox operator of the l1 norm for the input vector \(x\). It solves the problem:

\[ min_{z} 0.5||x - z||_2^2 + γ ||Ψ^† z||_w1 \]

where \(Ψ \in C^{N_x \times N_r} \) is the sparsifying operator, and

\[|| ||_w1\]

is the weighted L1 norm.

Definition at line 169 of file l1_proximal.h.

Member Typedef Documentation

◆ Real

template<typename SCALAR >
using sopt::proximal::L1< SCALAR >::Real = typename L1TightFrame<SCALAR>::Real

Underlying real scalar type.

Definition at line 187 of file l1_proximal.h.

◆ Scalar

template<typename SCALAR >
using sopt::proximal::L1< SCALAR >::Scalar = typename L1TightFrame<SCALAR>::Scalar

Underlying scalar type.

Definition at line 185 of file l1_proximal.h.

Constructor & Destructor Documentation

◆ L1()

template<typename SCALAR >
sopt::proximal::L1< SCALAR >::L1 ( )
inline

Definition at line 246 of file l1_proximal.h.

247  : L1TightFrame<SCALAR>(),
248  itermax_(0),
249  tolerance_(1e-8),
250  positivity_constraint_(false),
251  real_constraint_(false),
252  fista_mixing_(true) {}

Member Function Documentation

◆ nu() [1/2]

template<typename SCALAR >
Real sopt::proximal::L1< SCALAR >::nu ( ) const
inline

Bounds on the squared norm of the operator Ψ

Definition at line 294 of file l1_proximal.h.

294 { return L1TightFrame<Scalar>::nu(); }

Referenced by function_l1p(), main(), and sopt::proximal::L1< SCALAR >::nu().

◆ nu() [2/2]

template<typename SCALAR >
L1<Scalar>& sopt::proximal::L1< SCALAR >::nu ( Real const &  nu)
inline

Sets the bound on the squared norm of the operator Ψ

Definition at line 296 of file l1_proximal.h.

296  {
297  L1TightFrame<SCALAR>::nu(nu);
298  return *this;
299  }
Real nu() const
Bounds on the squared norm of the operator Ψ
Definition: l1_proximal.h:294

References sopt::proximal::L1< SCALAR >::nu().

◆ operator()() [1/2]

template<typename SCALAR >
template<typename T0 >
Diagnostic sopt::proximal::L1< SCALAR >::operator() ( Eigen::MatrixBase< T0 > &  out,
Real  gamma,
Vector< Scalar > const &  x 
) const
inline

Computes proximal for given γ

Definition at line 215 of file l1_proximal.h.

215  {
216  // Note that we *must* call eval on x, in case it is an expression involving out
217  if (gamma <= 0) {
218  apply_constraints(out, x);
219  return Diagnostic(0, 0, 0.5 * (out - x).squaredNorm(), true);
220  }
221 
222  if (fista_mixing())
223  return operator()(out, gamma, x, FistaMixing());
224  else
225  return operator()(out, gamma, x, NoMixing());
226  }
Diagnostic operator()(Eigen::MatrixBase< T0 > &out, Real gamma, Vector< Scalar > const &x) const
Computes proximal for given γ
Definition: l1_proximal.h:215

◆ operator()() [2/2]

template<typename SCALAR >
template<typename T0 >
DiagnosticAndResult sopt::proximal::L1< SCALAR >::operator() ( Real const &  gamma,
Eigen::MatrixBase< T0 > const &  x 
) const
inline

Lazy version.

Definition at line 230 of file l1_proximal.h.

230  {
231  DiagnosticAndResult result;
232  static_cast<Diagnostic &>(result) = operator()(result.proximal, gamma, x);
233  return result;
234  }

References sopt::proximal::L1< SCALAR >::DiagnosticAndResult::proximal.

◆ Psi() [1/2]

template<typename SCALAR >
LinearTransform<Vector<Scalar> > const& sopt::proximal::L1< SCALAR >::Psi ( ) const
inline

Linear transform applied to input prior to L1 norm.

Definition at line 302 of file l1_proximal.h.

302 { return L1TightFrame<Scalar>::Psi(); }
L1TightFrame &::type Psi(ARGS &&... args)
Definition: l1_proximal.h:93

References sopt::proximal::L1TightFrame< SCALAR >::Psi().

Referenced by sopt::algorithm::ImagingProximalADMM< SCALAR >::Psi(), and sopt::algorithm::L1GProximal< SCALAR >::Psi().

◆ Psi() [2/2]

template<typename SCALAR >
L1<Scalar>& ::type sopt::proximal::L1< SCALAR >::Psi ( ARGS &&...  args)
inline

Definition at line 305 of file l1_proximal.h.

305  {
306  L1TightFrame<Scalar>::Psi(std::forward<ARGS>(args)...);
307  return *this;
308  }

References sopt::proximal::L1TightFrame< SCALAR >::Psi().

◆ SOPT_MACRO() [1/5]

template<typename SCALAR >
sopt::proximal::L1< SCALAR >::SOPT_MACRO ( fista_mixing  ,
bool   
)

Whether to do fista mixing or not.

◆ SOPT_MACRO() [2/5]

template<typename SCALAR >
sopt::proximal::L1< SCALAR >::SOPT_MACRO ( itermax  ,
t_uint   
)

Maximum number of iterations before bailing out.

0 means algorithm breaks only if convergence is reached.

◆ SOPT_MACRO() [3/5]

template<typename SCALAR >
sopt::proximal::L1< SCALAR >::SOPT_MACRO ( positivity_constraint  ,
bool   
)

Whether to apply positivity constraints.

◆ SOPT_MACRO() [4/5]

template<typename SCALAR >
sopt::proximal::L1< SCALAR >::SOPT_MACRO ( real_constraint  ,
bool   
)

Whether the output should be constrained to be real.

◆ SOPT_MACRO() [5/5]

template<typename SCALAR >
sopt::proximal::L1< SCALAR >::SOPT_MACRO ( tolerance  ,
Real   
)

Tolerance criteria.

◆ tight_frame()

template<typename SCALAR >
template<typename... T>
auto sopt::proximal::L1< SCALAR >::tight_frame ( T &&...  args) const -> decltype(this->L1TightFrame<Scalar>::operator()(std::forward<T>(args)...))
inline

Special case if Ψ ia a tight frame.

See also
L1TightFrame

Definition at line 313 of file l1_proximal.h.

314  {
315  return this->L1TightFrame<Scalar>::operator()(std::forward<T>(args)...);
316  }
std::enable_if< is_complex< Scalar >::value==is_complex< typename T0::Scalar >::value and is_complex< Scalar >::value==is_complex< typename T1::Scalar >::value >::type operator()(Eigen::MatrixBase< T0 > &out, Real gamma, Eigen::MatrixBase< T1 > const &x) const
Computes proximal for given γ
Definition: l1_proximal.h:128

References sopt::proximal::L1TightFrame< SCALAR >::operator()().

◆ weights() [1/3]

template<typename SCALAR >
Vector<Real> const& sopt::proximal::L1< SCALAR >::weights ( ) const
inline

Weights of the l1 norm.

Definition at line 280 of file l1_proximal.h.

280 { return L1TightFrame<Scalar>::weights(); }
Vector< Real > const & weights() const
Weights of the l1 norm.
Definition: l1_proximal.h:74

References sopt::proximal::L1TightFrame< SCALAR >::weights().

◆ weights() [2/3]

template<typename SCALAR >
template<typename T >
L1<Scalar>& sopt::proximal::L1< SCALAR >::weights ( Eigen::MatrixBase< T > const &  w)
inline

Set weights to an array of values.

Definition at line 283 of file l1_proximal.h.

283  {
285  return *this;
286  }

References sopt::proximal::L1TightFrame< SCALAR >::weights().

◆ weights() [3/3]

template<typename SCALAR >
L1<Scalar>& sopt::proximal::L1< SCALAR >::weights ( Real const &  w)
inline

Set weights to a single value.

Definition at line 288 of file l1_proximal.h.

288  {
290  return this;
291  }

References sopt::proximal::L1TightFrame< SCALAR >::weights().


The documentation for this class was generated from the following file: