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

#include <imaging_primal_dual.h>

Classes

struct  Diagnostic
 Values indicating how the algorithm ran. More...
 
struct  DiagnosticAndResult
 Holds result vector as well. More...
 

Public Types

using value_type = typename PD::value_type
 
using Scalar = typename PD::Scalar
 
using Real = typename PD::Real
 
using t_Vector = typename PD::t_Vector
 
using t_LinearTransform = typename PD::t_LinearTransform
 
template<typename T >
using t_Proximal = std::function< void(t_Vector &, const T &, const t_Vector &)>
 
using t_IsConverged = typename PD::t_IsConverged
 
using t_Constraint = typename PD::t_Constraint
 
using t_Random_Updater = typename PD::t_Random_Updater
 
using value_type = typename PD::value_type
 
using Scalar = typename PD::Scalar
 
using Real = typename PD::Real
 
using t_Vector = typename PD::t_Vector
 
using t_LinearTransform = typename PD::t_LinearTransform
 
template<typename T >
using t_Proximal = std::function< void(t_Vector &, const T &, const t_Vector &)>
 
using t_IsConverged = typename PD::t_IsConverged
 
using t_Constraint = typename PD::t_Constraint
 
using t_Random_Updater = typename PD::t_Random_Updater
 

Public Member Functions

template<typename DERIVED >
 ImagingPrimalDual (Eigen::MatrixBase< DERIVED > const &target)
 
virtual ~ImagingPrimalDual ()
 
 SOPT_MACRO (l1_proximal, t_Proximal< Real >)
 The l1 prox functioning as f. More...
 
 SOPT_MACRO (l1_proximal_weighted, t_Proximal< Vector< Real >>)
 The l1 prox with weights functioning as f. More...
 
 SOPT_MACRO (l1_proximal_weights, Vector< Real >)
 The l1 prox weights functioning. More...
 
 SOPT_MACRO (l2ball_proximal, proximal::WeightedL2Ball< Scalar >)
 The weighted L2 proximal functioning as g. More...
 
 SOPT_MACRO (residual_tolerance, Real)
 Convergence of the relative variation of the objective functions. More...
 
 SOPT_MACRO (relative_variation, Real)
 Convergence of the relative variation of the objective functions. More...
 
 SOPT_MACRO (residual_convergence, t_IsConverged)
 Convergence of the residuals. More...
 
 SOPT_MACRO (objective_convergence, t_IsConverged)
 Convergence of the residuals. More...
 
 SOPT_MACRO (itermax, t_uint)
 Maximum number of iterations. More...
 
 SOPT_MACRO (regulariser_strength, Real)
 regulariser_strength parameter More...
 
 SOPT_MACRO (update_scale, Real)
 update parameter More...
 
 SOPT_MACRO (positivity_constraint, bool)
 Apply positivity constraint. More...
 
 SOPT_MACRO (real_constraint, bool)
 Apply real constraint. More...
 
 SOPT_MACRO (sigma, Real)
 sigma parameter More...
 
 SOPT_MACRO (tau, Real)
 tau parameter More...
 
 SOPT_MACRO (xi, Real)
 xi parameter More...
 
 SOPT_MACRO (rho, Real)
 rho parameter More...
 
 SOPT_MACRO (precondition_stepsize, Real)
 precondtion step size parameter More...
 
 SOPT_MACRO (precondition_weights, t_Vector)
 precondition weights parameter More...
 
 SOPT_MACRO (precondition_iters, t_uint)
 precondition iterations parameter More...
 
 SOPT_MACRO (is_converged, t_IsConverged)
 A function verifying convergence. More...
 
 SOPT_MACRO (Phi, t_LinearTransform)
 Measurement operator. More...
 
 SOPT_MACRO (Psi, t_LinearTransform)
 Wavelet operator. More...
 
 SOPT_MACRO (random_measurement_updater, t_Random_Updater)
 lambda that determines if to update measurements More...
 
 SOPT_MACRO (random_wavelet_updater, t_Random_Updater)
 lambda that determines if to update wavelets More...
 
t_Vector const & target () const
 Vector of target measurements. More...
 
template<typename DERIVED >
ImagingPrimalDual< Scalar > & target (Eigen::MatrixBase< DERIVED > const &target)
 Sets the vector of target measurements. More...
 
Diagnostic operator() (t_Vector &out) const
 Calls Primal Dual. More...
 
Diagnostic operator() (t_Vector &out, std::tuple< t_Vector, t_Vector > const &guess) const
 Calls Primal Dual. More...
 
Diagnostic operator() (t_Vector &out, std::tuple< t_Vector const &, t_Vector const & > const &guess) const
 Calls Primal Dual. More...
 
DiagnosticAndResult operator() (std::tuple< t_Vector, t_Vector > const &guess) const
 Calls Primal Dual. More...
 
DiagnosticAndResult operator() (std::tuple< t_Vector const &, t_Vector const & > const &guess) const
 Calls Primal Dual. More...
 
DiagnosticAndResult operator() () const
 Calls Primal Dual. More...
 
DiagnosticAndResult operator() (DiagnosticAndResult const &warmstart) const
 Makes it simple to chain different calls to PD. More...
 
ImagingPrimalDual &::type Phi (ARGS &&... args)
 
proximal::WeightedL2Ball< Scalar > & l2ball_proximal ()
 Proximal of the L2 ball. More...
 
ImagingPrimalDual &::type Psi (ARGS &&... args)
 
 SOPT_MACRO (epsilon, l2ball, WeightedL2Ball)
 
 SOPT_MACRO (weights, l2ball, WeightedL2Ball)
 
ImagingPrimalDual< Scalar > & residual_convergence (Real const &tolerance)
 Helper function to set-up default residual convergence function. More...
 
ImagingPrimalDual< Scalar > & objective_convergence (Real const &tolerance)
 Helper function to set-up default residual convergence function. More...
 
ImagingPrimalDual< Scalar > & is_converged (std::function< bool(t_Vector const &x)> const &func)
 Convergence function that takes only the output as argument. More...
 
template<typename DERIVED >
 ImagingPrimalDual (Eigen::MatrixBase< DERIVED > const &target)
 
virtual ~ImagingPrimalDual ()
 
 SOPT_MACRO (l2_proximal, t_Proximal< Real >)
 The l2 prox functioning as f. More...
 
 SOPT_MACRO (l2_proximal_weighted, t_Proximal< Vector< Real >>)
 The l2 prox with weights functioning as f. More...
 
 SOPT_MACRO (l2_proximal_weights, Vector< Real >)
 The l2 prox weights functioning. More...
 
 SOPT_MACRO (l2ball_proximal, proximal::WeightedL2Ball< Scalar >)
 The weighted L2 proximal functioning as g. More...
 
 SOPT_MACRO (residual_tolerance, Real)
 Convergence of the relative variation of the objective functions. More...
 
 SOPT_MACRO (relative_variation, Real)
 Convergence of the relative variation of the objective functions. More...
 
 SOPT_MACRO (residual_convergence, t_IsConverged)
 Convergence of the residuals. More...
 
 SOPT_MACRO (objective_convergence, t_IsConverged)
 Convergence of the residuals. More...
 
 SOPT_MACRO (itermax, t_uint)
 Maximum number of iterations. More...
 
 SOPT_MACRO (gamma, Real)
 gamma parameter More...
 
 SOPT_MACRO (update_scale, Real)
 update parameter More...
 
 SOPT_MACRO (positivity_constraint, bool)
 Apply positivity constraint. More...
 
 SOPT_MACRO (real_constraint, bool)
 Apply real constraint. More...
 
 SOPT_MACRO (sigma, Real)
 sigma parameter More...
 
 SOPT_MACRO (tau, Real)
 tau parameter More...
 
 SOPT_MACRO (xi, Real)
 xi parameter More...
 
 SOPT_MACRO (rho, Real)
 rho parameter More...
 
 SOPT_MACRO (precondition_stepsize, Real)
 precondtion step size parameter More...
 
 SOPT_MACRO (precondition_weights, t_Vector)
 precondition weights parameter More...
 
 SOPT_MACRO (precondition_iters, t_uint)
 precondition iterations parameter More...
 
 SOPT_MACRO (is_converged, t_IsConverged)
 A function verifying convergence. More...
 
 SOPT_MACRO (Phi, t_LinearTransform)
 Measurement operator. More...
 
 SOPT_MACRO (Psi, t_LinearTransform)
 Wavelet operator. More...
 
 SOPT_MACRO (random_measurement_updater, t_Random_Updater)
 lambda that determines if to update measurements More...
 
 SOPT_MACRO (random_wavelet_updater, t_Random_Updater)
 lambda that determines if to update wavelets More...
 
t_Vector const & target () const
 Vector of target measurements. More...
 
template<typename DERIVED >
ImagingPrimalDual< Scalar > & target (Eigen::MatrixBase< DERIVED > const &target)
 Sets the vector of target measurements. More...
 
Diagnostic operator() (t_Vector &out) const
 Calls Primal Dual. More...
 
Diagnostic operator() (t_Vector &out, std::tuple< t_Vector, t_Vector > const &guess) const
 Calls Primal Dual. More...
 
Diagnostic operator() (t_Vector &out, std::tuple< t_Vector const &, t_Vector const & > const &guess) const
 Calls Primal Dual. More...
 
DiagnosticAndResult operator() (std::tuple< t_Vector, t_Vector > const &guess) const
 Calls Primal Dual. More...
 
DiagnosticAndResult operator() (std::tuple< t_Vector const &, t_Vector const & > const &guess) const
 Calls Primal Dual. More...
 
DiagnosticAndResult operator() () const
 Calls Primal Dual. More...
 
DiagnosticAndResult operator() (DiagnosticAndResult const &warmstart) const
 Makes it simple to chain different calls to PD. More...
 
ImagingPrimalDual &::type Phi (ARGS &&... args)
 
proximal::WeightedL2Ball< Scalar > & l2ball_proximal ()
 Proximal of the L2 ball. More...
 
ImagingPrimalDual &::type Psi (ARGS &&... args)
 
 SOPT_MACRO (epsilon, l2ball, WeightedL2Ball)
 
 SOPT_MACRO (weights, l2ball, WeightedL2Ball)
 
ImagingPrimalDual< Scalar > & residual_convergence (Real const &tolerance)
 Helper function to set-up default residual convergence function. More...
 
ImagingPrimalDual< Scalar > & objective_convergence (Real const &tolerance)
 Helper function to set-up default residual convergence function. More...
 
ImagingPrimalDual< Scalar > & is_converged (std::function< bool(t_Vector const &x)> const &func)
 Convergence function that takes only the output as argument. More...
 

Detailed Description

template<typename SCALAR>
class sopt::algorithm::ImagingPrimalDual< SCALAR >

Definition at line 20 of file imaging_primal_dual.h.

Member Typedef Documentation

◆ Real [1/2]

template<typename SCALAR >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::Real = typename PD::Real

Definition at line 27 of file imaging_primal_dual.h.

◆ Real [2/2]

template<typename SCALAR >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::Real = typename PD::Real

Definition at line 26 of file l2_primal_dual.h.

◆ Scalar [1/2]

template<typename SCALAR >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::Scalar = typename PD::Scalar

Definition at line 26 of file imaging_primal_dual.h.

◆ Scalar [2/2]

template<typename SCALAR >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::Scalar = typename PD::Scalar

Definition at line 25 of file l2_primal_dual.h.

◆ t_Constraint [1/2]

template<typename SCALAR >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::t_Constraint = typename PD::t_Constraint

Definition at line 33 of file imaging_primal_dual.h.

◆ t_Constraint [2/2]

template<typename SCALAR >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::t_Constraint = typename PD::t_Constraint

Definition at line 32 of file l2_primal_dual.h.

◆ t_IsConverged [1/2]

template<typename SCALAR >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::t_IsConverged = typename PD::t_IsConverged

Definition at line 32 of file imaging_primal_dual.h.

◆ t_IsConverged [2/2]

template<typename SCALAR >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::t_IsConverged = typename PD::t_IsConverged

Definition at line 31 of file l2_primal_dual.h.

◆ t_LinearTransform [1/2]

template<typename SCALAR >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::t_LinearTransform = typename PD::t_LinearTransform

Definition at line 29 of file imaging_primal_dual.h.

◆ t_LinearTransform [2/2]

template<typename SCALAR >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::t_LinearTransform = typename PD::t_LinearTransform

Definition at line 28 of file l2_primal_dual.h.

◆ t_Proximal [1/2]

template<typename SCALAR >
template<typename T >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::t_Proximal = std::function<void(t_Vector &, const T &, const t_Vector &)>

Definition at line 31 of file imaging_primal_dual.h.

◆ t_Proximal [2/2]

template<typename SCALAR >
template<typename T >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::t_Proximal = std::function<void(t_Vector &, const T &, const t_Vector &)>

Definition at line 30 of file l2_primal_dual.h.

◆ t_Random_Updater [1/2]

template<typename SCALAR >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::t_Random_Updater = typename PD::t_Random_Updater

Definition at line 34 of file imaging_primal_dual.h.

◆ t_Random_Updater [2/2]

template<typename SCALAR >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::t_Random_Updater = typename PD::t_Random_Updater

Definition at line 33 of file l2_primal_dual.h.

◆ t_Vector [1/2]

template<typename SCALAR >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::t_Vector = typename PD::t_Vector

Definition at line 28 of file imaging_primal_dual.h.

◆ t_Vector [2/2]

template<typename SCALAR >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::t_Vector = typename PD::t_Vector

Definition at line 27 of file l2_primal_dual.h.

◆ value_type [1/2]

template<typename SCALAR >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::value_type = typename PD::value_type

Definition at line 25 of file imaging_primal_dual.h.

◆ value_type [2/2]

template<typename SCALAR >
using sopt::algorithm::ImagingPrimalDual< SCALAR >::value_type = typename PD::value_type

Definition at line 24 of file l2_primal_dual.h.

Constructor & Destructor Documentation

◆ ImagingPrimalDual() [1/2]

template<typename SCALAR >
template<typename DERIVED >
sopt::algorithm::ImagingPrimalDual< SCALAR >::ImagingPrimalDual ( Eigen::MatrixBase< DERIVED > const &  target)
inline

Setups imaging wrapper for PD

Parameters
[in]f_proximalproximal operator of the \(f\) function.
[in]g_proximalproximal operator of the \(g\) function

Definition at line 52 of file imaging_primal_dual.h.

53  : l1_proximal_([](t_Vector &out, const Real &regulariser_strength, const t_Vector &x) {
54  proximal::l1_norm<t_Vector, t_Vector>(out, regulariser_strength, x);
55  }),
56  l1_proximal_weighted_([](t_Vector &out, const Vector<Real> &regulariser_strength, const t_Vector &x) {
57  proximal::l1_norm<t_Vector, t_Vector, Vector<Real>>(out, regulariser_strength, x);
58  }),
59  l1_proximal_weights_(Vector<Real>::Ones(1)),
60  l2ball_proximal_(1e0),
61  residual_tolerance_(1e-4),
62  relative_variation_(1e-4),
63  residual_convergence_(nullptr),
64  objective_convergence_(nullptr),
65  itermax_(std::numeric_limits<t_uint>::max()),
66  sigma_(1),
67  tau_(0.5),
68  regulariser_strength_(0.5),
69  update_scale_(1),
70  precondition_stepsize_(0.5),
71  precondition_weights_(t_Vector::Ones(target.size())),
72  precondition_iters_(0),
73  xi_(1),
74  rho_(1),
75  is_converged_(),
76  Phi_(linear_transform_identity<Scalar>()),
77  Psi_(linear_transform_identity<Scalar>()),
78  random_measurement_updater_([]() { return true; }),
79  random_wavelet_updater_([]() { return true; }),
80  target_(target) {}
sopt::Vector< Scalar > t_Vector
t_Vector const & target() const
Vector of target measurements.
sopt::Vector< Scalar > Vector
Definition: inpainting.cc:28

◆ ~ImagingPrimalDual() [1/2]

template<typename SCALAR >
virtual sopt::algorithm::ImagingPrimalDual< SCALAR >::~ImagingPrimalDual ( )
inlinevirtual

Definition at line 81 of file imaging_primal_dual.h.

81 {}

◆ ImagingPrimalDual() [2/2]

template<typename SCALAR >
template<typename DERIVED >
sopt::algorithm::ImagingPrimalDual< SCALAR >::ImagingPrimalDual ( Eigen::MatrixBase< DERIVED > const &  target)
inline

Setups imaging wrapper for PD

Parameters
[in]f_proximalproximal operator of the \(f\) function.
[in]g_proximalproximal operator of the \(g\) function

Definition at line 51 of file l2_primal_dual.h.

52  : l2_proximal_([](t_Vector &out, const Real &gamma, const t_Vector &x) {
53  proximal::l2_norm(out, gamma, x);
54  }),
55  l2_proximal_weighted_([](t_Vector &out, const Vector<Real> &gamma, const t_Vector &x) {
56  proximal::l2_norm(out, gamma, x);
57  }),
58  l2_proximal_weights_(Vector<Real>::Ones(1)),
59  l2ball_proximal_(1e0),
60  residual_tolerance_(1e-4),
61  relative_variation_(1e-4),
62  residual_convergence_(nullptr),
63  objective_convergence_(nullptr),
64  itermax_(std::numeric_limits<t_uint>::max()),
65  sigma_(1),
66  tau_(0.5),
67  gamma_(0.5),
68  update_scale_(1),
69  precondition_stepsize_(0.5),
70  precondition_weights_(t_Vector::Ones(target.size())),
71  precondition_iters_(0),
72  xi_(1),
73  rho_(1),
74  is_converged_(),
75  Phi_(linear_transform_identity<Scalar>()),
76  Psi_(linear_transform_identity<Scalar>()),
77  random_measurement_updater_([]() { return true; }),
78  random_wavelet_updater_([]() { return true; }),
79  target_(target) {}
void l2_norm(Eigen::DenseBase< T0 > &out, typename real_type< typename T0::Scalar >::type gamma, Eigen::DenseBase< T1 > const &x)
Proximal of the l2 norm (note this is different from the l2 ball indicator function)
Definition: proximal.h:84

References sopt::proximal::l2_norm().

◆ ~ImagingPrimalDual() [2/2]

template<typename SCALAR >
virtual sopt::algorithm::ImagingPrimalDual< SCALAR >::~ImagingPrimalDual ( )
inlinevirtual

Definition at line 80 of file l2_primal_dual.h.

80 {}

Member Function Documentation

◆ is_converged() [1/2]

template<typename SCALAR >
ImagingPrimalDual<Scalar>& sopt::algorithm::ImagingPrimalDual< SCALAR >::is_converged ( std::function< bool(t_Vector const &x)> const &  func)
inline

Convergence function that takes only the output as argument.

Definition at line 263 of file imaging_primal_dual.h.

263  {
264  return is_converged([func](t_Vector const &x, t_Vector const &) { return func(x); });
265  }
ImagingPrimalDual< Scalar > & is_converged(std::function< bool(t_Vector const &x)> const &func)
Convergence function that takes only the output as argument.

Referenced by sopt::algorithm::ImagingPrimalDual< SCALAR >::is_converged().

◆ is_converged() [2/2]

template<typename SCALAR >
ImagingPrimalDual<Scalar>& sopt::algorithm::ImagingPrimalDual< SCALAR >::is_converged ( std::function< bool(t_Vector const &x)> const &  func)
inline

Convergence function that takes only the output as argument.

Definition at line 262 of file l2_primal_dual.h.

262  {
263  return is_converged([func](t_Vector const &x, t_Vector const &) { return func(x); });
264  }

References sopt::algorithm::ImagingPrimalDual< SCALAR >::is_converged().

◆ l2ball_proximal() [1/2]

template<typename SCALAR >
proximal::WeightedL2Ball<Scalar>& sopt::algorithm::ImagingPrimalDual< SCALAR >::l2ball_proximal ( )
inline

Proximal of the L2 ball.

Non-const version to setup the object.

Definition at line 222 of file imaging_primal_dual.h.

222 { return l2ball_proximal_; }

◆ l2ball_proximal() [2/2]

template<typename SCALAR >
proximal::WeightedL2Ball<Scalar>& sopt::algorithm::ImagingPrimalDual< SCALAR >::l2ball_proximal ( )
inline

Proximal of the L2 ball.

Non-const version to setup the object.

Definition at line 221 of file l2_primal_dual.h.

221 { return l2ball_proximal_; }

◆ objective_convergence() [1/2]

template<typename SCALAR >
ImagingPrimalDual<Scalar>& sopt::algorithm::ImagingPrimalDual< SCALAR >::objective_convergence ( Real const &  tolerance)
inline

Helper function to set-up default residual convergence function.

Definition at line 259 of file imaging_primal_dual.h.

259  {
260  return objective_convergence(nullptr).relative_variation(tolerance);
261  }
ImagingPrimalDual< Scalar > & objective_convergence(Real const &tolerance)
Helper function to set-up default residual convergence function.

Referenced by sopt::algorithm::ImagingPrimalDual< SCALAR >::objective_convergence().

◆ objective_convergence() [2/2]

template<typename SCALAR >
ImagingPrimalDual<Scalar>& sopt::algorithm::ImagingPrimalDual< SCALAR >::objective_convergence ( Real const &  tolerance)
inline

Helper function to set-up default residual convergence function.

Definition at line 258 of file l2_primal_dual.h.

258  {
259  return objective_convergence(nullptr).relative_variation(tolerance);
260  }

References sopt::algorithm::ImagingPrimalDual< SCALAR >::objective_convergence().

◆ operator()() [1/14]

template<typename SCALAR >
DiagnosticAndResult sopt::algorithm::ImagingPrimalDual< SCALAR >::operator() ( ) const
inline

Calls Primal Dual.

Parameters
[in]guessinitial guess

Definition at line 200 of file imaging_primal_dual.h.

200  {
201  DiagnosticAndResult result;
202  static_cast<Diagnostic &>(result) = operator()(result.x,
204  return result;
205  }
ImagingPrimalDual &::type Phi(ARGS &&... args)
std::tuple< t_Vector, t_Vector > initial_guess() const
Computes initial guess for x and the residual using the targets.
Definition: primal_dual.h:233

References sopt::algorithm::PrimalDual< SCALAR >::initial_guess(), sopt::algorithm::ImagingPrimalDual< SCALAR >::Phi(), sopt::algorithm::ImagingPrimalDual< SCALAR >::target(), and sopt::algorithm::ImagingPrimalDual< SCALAR >::DiagnosticAndResult::x.

Referenced by sopt::algorithm::ImagingPrimalDual< SCALAR >::operator()().

◆ operator()() [2/14]

template<typename SCALAR >
DiagnosticAndResult sopt::algorithm::ImagingPrimalDual< SCALAR >::operator() ( ) const
inline

Calls Primal Dual.

Parameters
[in]guessinitial guess

Definition at line 199 of file l2_primal_dual.h.

199  {
200  DiagnosticAndResult result;
201  static_cast<Diagnostic &>(result) = operator()(result.x,
203  return result;
204  }

References sopt::algorithm::PrimalDual< SCALAR >::initial_guess(), sopt::algorithm::ImagingPrimalDual< SCALAR >::Phi(), and sopt::algorithm::ImagingPrimalDual< SCALAR >::target().

◆ operator()() [3/14]

template<typename SCALAR >
DiagnosticAndResult sopt::algorithm::ImagingPrimalDual< SCALAR >::operator() ( DiagnosticAndResult const &  warmstart) const
inline

Makes it simple to chain different calls to PD.

Definition at line 207 of file imaging_primal_dual.h.

207  {
208  DiagnosticAndResult result = warmstart;
209  static_cast<Diagnostic &>(result) = operator()(result.x, warmstart.x, warmstart.residual);
210  return result;
211  }

References sopt::algorithm::PrimalDual< SCALAR >::Diagnostic::residual, and sopt::algorithm::ImagingPrimalDual< SCALAR >::DiagnosticAndResult::x.

◆ operator()() [4/14]

template<typename SCALAR >
DiagnosticAndResult sopt::algorithm::ImagingPrimalDual< SCALAR >::operator() ( DiagnosticAndResult const &  warmstart) const
inline

Makes it simple to chain different calls to PD.

Definition at line 206 of file l2_primal_dual.h.

206  {
207  DiagnosticAndResult result = warmstart;
208  static_cast<Diagnostic &>(result) = operator()(result.x, warmstart.x, warmstart.residual);
209  return result;
210  }

◆ operator()() [5/14]

template<typename SCALAR >
DiagnosticAndResult sopt::algorithm::ImagingPrimalDual< SCALAR >::operator() ( std::tuple< t_Vector const &, t_Vector const & > const &  guess) const
inline

Calls Primal Dual.

Parameters
[in]guessinitial guess

Definition at line 192 of file imaging_primal_dual.h.

193  {
194  DiagnosticAndResult result;
195  static_cast<Diagnostic &>(result) = operator()(result.x, guess);
196  return result;
197  }

References sopt::algorithm::ImagingPrimalDual< SCALAR >::DiagnosticAndResult::x.

◆ operator()() [6/14]

template<typename SCALAR >
DiagnosticAndResult sopt::algorithm::ImagingPrimalDual< SCALAR >::operator() ( std::tuple< t_Vector const &, t_Vector const & > const &  guess) const
inline

Calls Primal Dual.

Parameters
[in]guessinitial guess

Definition at line 191 of file l2_primal_dual.h.

192  {
193  DiagnosticAndResult result;
194  static_cast<Diagnostic &>(result) = operator()(result.x, guess);
195  return result;
196  }

◆ operator()() [7/14]

template<typename SCALAR >
DiagnosticAndResult sopt::algorithm::ImagingPrimalDual< SCALAR >::operator() ( std::tuple< t_Vector, t_Vector > const &  guess) const
inline

Calls Primal Dual.

Parameters
[in]guessinitial guess

Definition at line 187 of file imaging_primal_dual.h.

187  {
188  return operator()(std::tie(std::get<0>(guess), std::get<1>(guess)));
189  }
DiagnosticAndResult operator()() const
Calls Primal Dual.

References sopt::algorithm::ImagingPrimalDual< SCALAR >::operator()().

◆ operator()() [8/14]

template<typename SCALAR >
DiagnosticAndResult sopt::algorithm::ImagingPrimalDual< SCALAR >::operator() ( std::tuple< t_Vector, t_Vector > const &  guess) const
inline

Calls Primal Dual.

Parameters
[in]guessinitial guess

Definition at line 186 of file l2_primal_dual.h.

186  {
187  return operator()(std::tie(std::get<0>(guess), std::get<1>(guess)));
188  }

References sopt::algorithm::ImagingPrimalDual< SCALAR >::operator()().

◆ operator()() [9/14]

template<typename SCALAR >
Diagnostic sopt::algorithm::ImagingPrimalDual< SCALAR >::operator() ( t_Vector out) const
inline

◆ operator()() [10/14]

template<typename SCALAR >
Diagnostic sopt::algorithm::ImagingPrimalDual< SCALAR >::operator() ( t_Vector out) const
inline

◆ operator()() [11/14]

template<typename SCALAR >
Diagnostic sopt::algorithm::ImagingPrimalDual< SCALAR >::operator() ( t_Vector out,
std::tuple< t_Vector const &, t_Vector const & > const &  guess 
) const
inline

Calls Primal Dual.

Parameters
[out]outOutput vector x
[in]guessinitial guess

Definition at line 181 of file imaging_primal_dual.h.

182  {
183  return operator()(out, std::get<0>(guess), std::get<1>(guess));
184  }

References sopt::algorithm::ImagingPrimalDual< SCALAR >::operator()().

◆ operator()() [12/14]

template<typename SCALAR >
Diagnostic sopt::algorithm::ImagingPrimalDual< SCALAR >::operator() ( t_Vector out,
std::tuple< t_Vector const &, t_Vector const & > const &  guess 
) const
inline

Calls Primal Dual.

Parameters
[out]outOutput vector x
[in]guessinitial guess

Definition at line 180 of file l2_primal_dual.h.

181  {
182  return operator()(out, std::get<0>(guess), std::get<1>(guess));
183  }

References sopt::algorithm::ImagingPrimalDual< SCALAR >::operator()().

◆ operator()() [13/14]

template<typename SCALAR >
Diagnostic sopt::algorithm::ImagingPrimalDual< SCALAR >::operator() ( t_Vector out,
std::tuple< t_Vector, t_Vector > const &  guess 
) const
inline

Calls Primal Dual.

Parameters
[out]outOutput vector x
[in]guessinitial guess

Definition at line 175 of file imaging_primal_dual.h.

175  {
176  return operator()(out, std::get<0>(guess), std::get<1>(guess));
177  }

References sopt::algorithm::ImagingPrimalDual< SCALAR >::operator()().

◆ operator()() [14/14]

template<typename SCALAR >
Diagnostic sopt::algorithm::ImagingPrimalDual< SCALAR >::operator() ( t_Vector out,
std::tuple< t_Vector, t_Vector > const &  guess 
) const
inline

Calls Primal Dual.

Parameters
[out]outOutput vector x
[in]guessinitial guess

Definition at line 174 of file l2_primal_dual.h.

174  {
175  return operator()(out, std::get<0>(guess), std::get<1>(guess));
176  }

References sopt::algorithm::ImagingPrimalDual< SCALAR >::operator()().

◆ Phi() [1/2]

template<typename SCALAR >
ImagingPrimalDual& ::type sopt::algorithm::ImagingPrimalDual< SCALAR >::Phi ( ARGS &&...  args)
inline

Definition at line 215 of file imaging_primal_dual.h.

215  {
216  Phi_ = linear_transform(std::forward<ARGS>(args)...);
217  return *this;
218  }
LinearTransform< VECTOR > linear_transform(OperatorFunction< VECTOR > const &direct, OperatorFunction< VECTOR > const &indirect, std::array< t_int, 3 > const &sizes={{1, 1, 0}})

References sopt::linear_transform().

Referenced by main(), sopt::algorithm::ImagingPrimalDual< SCALAR >::operator()(), and TEST_CASE().

◆ Phi() [2/2]

template<typename SCALAR >
ImagingPrimalDual& ::type sopt::algorithm::ImagingPrimalDual< SCALAR >::Phi ( ARGS &&...  args)
inline

Definition at line 214 of file l2_primal_dual.h.

214  {
215  Phi_ = linear_transform(std::forward<ARGS>(args)...);
216  return *this;
217  }

References sopt::linear_transform().

◆ Psi() [1/2]

template<typename SCALAR >
ImagingPrimalDual& ::type sopt::algorithm::ImagingPrimalDual< SCALAR >::Psi ( ARGS &&...  args)
inline

Definition at line 226 of file imaging_primal_dual.h.

226  {
227  Psi_ = linear_transform(std::forward<ARGS>(args)...);
228  return *this;
229  }

References sopt::linear_transform().

Referenced by main(), and TEST_CASE().

◆ Psi() [2/2]

template<typename SCALAR >
ImagingPrimalDual& ::type sopt::algorithm::ImagingPrimalDual< SCALAR >::Psi ( ARGS &&...  args)
inline

Definition at line 225 of file l2_primal_dual.h.

225  {
226  Psi_ = linear_transform(std::forward<ARGS>(args)...);
227  return *this;
228  }

References sopt::linear_transform().

◆ residual_convergence() [1/2]

template<typename SCALAR >
ImagingPrimalDual<Scalar>& sopt::algorithm::ImagingPrimalDual< SCALAR >::residual_convergence ( Real const &  tolerance)
inline

Helper function to set-up default residual convergence function.

Definition at line 255 of file imaging_primal_dual.h.

255  {
256  return residual_convergence(nullptr).residual_tolerance(tolerance);
257  }
ImagingPrimalDual< Scalar > & residual_convergence(Real const &tolerance)
Helper function to set-up default residual convergence function.

Referenced by main(), sopt::algorithm::ImagingPrimalDual< SCALAR >::residual_convergence(), and TEST_CASE().

◆ residual_convergence() [2/2]

template<typename SCALAR >
ImagingPrimalDual<Scalar>& sopt::algorithm::ImagingPrimalDual< SCALAR >::residual_convergence ( Real const &  tolerance)
inline

Helper function to set-up default residual convergence function.

Definition at line 254 of file l2_primal_dual.h.

254  {
255  return residual_convergence(nullptr).residual_tolerance(tolerance);
256  }

References sopt::algorithm::ImagingPrimalDual< SCALAR >::residual_convergence().

◆ SOPT_MACRO() [1/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( epsilon  ,
l2ball  ,
WeightedL2Ball   
)

◆ SOPT_MACRO() [2/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( epsilon  ,
l2ball  ,
WeightedL2Ball   
)

◆ SOPT_MACRO() [3/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( gamma  ,
Real   
)

gamma parameter

◆ SOPT_MACRO() [4/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( is_converged  ,
t_IsConverged   
)

A function verifying convergence.

◆ SOPT_MACRO() [5/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( is_converged  ,
t_IsConverged   
)

A function verifying convergence.

◆ SOPT_MACRO() [6/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( itermax  ,
t_uint   
)

Maximum number of iterations.

◆ SOPT_MACRO() [7/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( itermax  ,
t_uint   
)

Maximum number of iterations.

◆ SOPT_MACRO() [8/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( l1_proximal  ,
t_Proximal< Real  
)

The l1 prox functioning as f.

◆ SOPT_MACRO() [9/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( l1_proximal_weighted  ,
t_Proximal< Vector< Real >>   
)

The l1 prox with weights functioning as f.

◆ SOPT_MACRO() [10/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( l1_proximal_weights  ,
Vector< Real  
)

The l1 prox weights functioning.

◆ SOPT_MACRO() [11/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( l2_proximal  ,
t_Proximal< Real  
)

The l2 prox functioning as f.

◆ SOPT_MACRO() [12/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( l2_proximal_weighted  ,
t_Proximal< Vector< Real >>   
)

The l2 prox with weights functioning as f.

◆ SOPT_MACRO() [13/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( l2_proximal_weights  ,
Vector< Real  
)

The l2 prox weights functioning.

◆ SOPT_MACRO() [14/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( l2ball_proximal  ,
proximal::WeightedL2Ball< Scalar  
)

The weighted L2 proximal functioning as g.

◆ SOPT_MACRO() [15/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( l2ball_proximal  ,
proximal::WeightedL2Ball< Scalar  
)

The weighted L2 proximal functioning as g.

◆ SOPT_MACRO() [16/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( objective_convergence  ,
t_IsConverged   
)

Convergence of the residuals.

If negative, this convergence criteria is disabled.

◆ SOPT_MACRO() [17/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( objective_convergence  ,
t_IsConverged   
)

Convergence of the residuals.

If negative, this convergence criteria is disabled.

◆ SOPT_MACRO() [18/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( Phi  ,
t_LinearTransform   
)

Measurement operator.

◆ SOPT_MACRO() [19/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( Phi  ,
t_LinearTransform   
)

Measurement operator.

◆ SOPT_MACRO() [20/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( positivity_constraint  ,
bool   
)

Apply positivity constraint.

◆ SOPT_MACRO() [21/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( positivity_constraint  ,
bool   
)

Apply positivity constraint.

◆ SOPT_MACRO() [22/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( precondition_iters  ,
t_uint   
)

precondition iterations parameter

◆ SOPT_MACRO() [23/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( precondition_iters  ,
t_uint   
)

precondition iterations parameter

◆ SOPT_MACRO() [24/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( precondition_stepsize  ,
Real   
)

precondtion step size parameter

◆ SOPT_MACRO() [25/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( precondition_stepsize  ,
Real   
)

precondtion step size parameter

◆ SOPT_MACRO() [26/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( precondition_weights  ,
t_Vector   
)

precondition weights parameter

◆ SOPT_MACRO() [27/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( precondition_weights  ,
t_Vector   
)

precondition weights parameter

◆ SOPT_MACRO() [28/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( Psi  ,
t_LinearTransform   
)

Wavelet operator.

◆ SOPT_MACRO() [29/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( Psi  ,
t_LinearTransform   
)

Wavelet operator.

◆ SOPT_MACRO() [30/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( random_measurement_updater  ,
t_Random_Updater   
)

lambda that determines if to update measurements

◆ SOPT_MACRO() [31/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( random_measurement_updater  ,
t_Random_Updater   
)

lambda that determines if to update measurements

◆ SOPT_MACRO() [32/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( random_wavelet_updater  ,
t_Random_Updater   
)

lambda that determines if to update wavelets

◆ SOPT_MACRO() [33/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( random_wavelet_updater  ,
t_Random_Updater   
)

lambda that determines if to update wavelets

◆ SOPT_MACRO() [34/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( real_constraint  ,
bool   
)

Apply real constraint.

◆ SOPT_MACRO() [35/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( real_constraint  ,
bool   
)

Apply real constraint.

◆ SOPT_MACRO() [36/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( regulariser_strength  ,
Real   
)

regulariser_strength parameter

◆ SOPT_MACRO() [37/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( relative_variation  ,
Real   
)

Convergence of the relative variation of the objective functions.

If negative, this convergence criteria is disabled.

◆ SOPT_MACRO() [38/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( relative_variation  ,
Real   
)

Convergence of the relative variation of the objective functions.

If negative, this convergence criteria is disabled.

◆ SOPT_MACRO() [39/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( residual_convergence  ,
t_IsConverged   
)

Convergence of the residuals.

If negative, this convergence criteria is disabled.

◆ SOPT_MACRO() [40/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( residual_convergence  ,
t_IsConverged   
)

Convergence of the residuals.

If negative, this convergence criteria is disabled.

◆ SOPT_MACRO() [41/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( residual_tolerance  ,
Real   
)

Convergence of the relative variation of the objective functions.

If negative, this convergence criteria is disabled.

◆ SOPT_MACRO() [42/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( residual_tolerance  ,
Real   
)

Convergence of the relative variation of the objective functions.

If negative, this convergence criteria is disabled.

◆ SOPT_MACRO() [43/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( rho  ,
Real   
)

rho parameter

◆ SOPT_MACRO() [44/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( rho  ,
Real   
)

rho parameter

◆ SOPT_MACRO() [45/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( sigma  ,
Real   
)

sigma parameter

◆ SOPT_MACRO() [46/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( sigma  ,
Real   
)

sigma parameter

◆ SOPT_MACRO() [47/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( tau  ,
Real   
)

tau parameter

◆ SOPT_MACRO() [48/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( tau  ,
Real   
)

tau parameter

◆ SOPT_MACRO() [49/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( update_scale  ,
Real   
)

update parameter

◆ SOPT_MACRO() [50/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( update_scale  ,
Real   
)

update parameter

◆ SOPT_MACRO() [51/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( weights  ,
l2ball  ,
WeightedL2Ball   
)

◆ SOPT_MACRO() [52/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( weights  ,
l2ball  ,
WeightedL2Ball   
)

◆ SOPT_MACRO() [53/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( xi  ,
Real   
)

xi parameter

◆ SOPT_MACRO() [54/54]

template<typename SCALAR >
sopt::algorithm::ImagingPrimalDual< SCALAR >::SOPT_MACRO ( xi  ,
Real   
)

xi parameter

◆ target() [1/4]

template<typename SCALAR >
t_Vector const& sopt::algorithm::ImagingPrimalDual< SCALAR >::target ( ) const
inline

Vector of target measurements.

Definition at line 159 of file imaging_primal_dual.h.

159 { return target_; }

Referenced by sopt::algorithm::ImagingPrimalDual< SCALAR >::operator()(), and sopt::algorithm::ImagingPrimalDual< SCALAR >::target().

◆ target() [2/4]

template<typename SCALAR >
t_Vector const& sopt::algorithm::ImagingPrimalDual< SCALAR >::target ( ) const
inline

Vector of target measurements.

Definition at line 158 of file l2_primal_dual.h.

158 { return target_; }

◆ target() [3/4]

template<typename SCALAR >
template<typename DERIVED >
ImagingPrimalDual<Scalar>& sopt::algorithm::ImagingPrimalDual< SCALAR >::target ( Eigen::MatrixBase< DERIVED > const &  target)
inline

Sets the vector of target measurements.

Definition at line 162 of file imaging_primal_dual.h.

162  {
163  target_ = target;
164  return *this;
165  }

References sopt::algorithm::ImagingPrimalDual< SCALAR >::target().

◆ target() [4/4]

template<typename SCALAR >
template<typename DERIVED >
ImagingPrimalDual<Scalar>& sopt::algorithm::ImagingPrimalDual< SCALAR >::target ( Eigen::MatrixBase< DERIVED > const &  target)
inline

Sets the vector of target measurements.

Definition at line 161 of file l2_primal_dual.h.

161  {
162  target_ = target;
163  return *this;
164  }

References sopt::algorithm::ImagingPrimalDual< SCALAR >::target().


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