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

#include <real_indicator.h>

+ Inheritance diagram for sopt::algorithm::RealIndicator< SCALAR >:
+ Collaboration diagram for sopt::algorithm::RealIndicator< SCALAR >:

Public Types

using NDF = NonDifferentiableFunc< SCALAR >
 
using Real = typename NDF::Real
 
using t_Vector = typename NDF::t_Vector
 
using t_Proximal = typename NDF::t_Proximal
 
using t_LinearTransform = typename NDF::t_LinearTransform
 
- Public Types inherited from NonDifferentiableFunc< SCALAR >
using FB = sopt::algorithm::ForwardBackward< SCALAR >
 
using Real = typename FB::Real
 
using t_Vector = typename FB::t_Vector
 
using t_Proximal = typename FB::t_Proximal
 
using t_LinearTransform = typename FB::t_LinearTransform
 

Public Member Functions

 RealIndicator ()
 
void log_message () const override
 
Real function (t_Vector const &x) const override
 
t_Proximal proximal_operator () const override
 
t_LinearTransform const & Psi () const override
 

Public Attributes

t_LinearTransform linear_operator = sopt::linear_transform_identity<SCALAR>()
 

Detailed Description

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

Definition at line 15 of file real_indicator.h.

Member Typedef Documentation

◆ NDF

template<typename SCALAR >
using sopt::algorithm::RealIndicator< SCALAR >::NDF = NonDifferentiableFunc<SCALAR>

Definition at line 18 of file real_indicator.h.

◆ Real

template<typename SCALAR >
using sopt::algorithm::RealIndicator< SCALAR >::Real = typename NDF::Real

Definition at line 19 of file real_indicator.h.

◆ t_LinearTransform

template<typename SCALAR >
using sopt::algorithm::RealIndicator< SCALAR >::t_LinearTransform = typename NDF::t_LinearTransform

Definition at line 22 of file real_indicator.h.

◆ t_Proximal

template<typename SCALAR >
using sopt::algorithm::RealIndicator< SCALAR >::t_Proximal = typename NDF::t_Proximal

Definition at line 21 of file real_indicator.h.

◆ t_Vector

template<typename SCALAR >
using sopt::algorithm::RealIndicator< SCALAR >::t_Vector = typename NDF::t_Vector

Definition at line 20 of file real_indicator.h.

Constructor & Destructor Documentation

◆ RealIndicator()

template<typename SCALAR >
sopt::algorithm::RealIndicator< SCALAR >::RealIndicator ( )
inline

Definition at line 24 of file real_indicator.h.

24 {}

Member Function Documentation

◆ function()

template<typename SCALAR >
RealIndicator< SCALAR >::Real sopt::algorithm::RealIndicator< SCALAR >::function ( t_Vector const &  x) const
overridevirtual

Implements NonDifferentiableFunc< SCALAR >.

Definition at line 54 of file real_indicator.h.

55 {
56  if constexpr (std::is_same<SCALAR, sopt::t_complex>::value)
57  {
58  for (auto &z : x) {
59  if (z.imag() != 0) {
60  SOPT_HIGH_LOG("Non-real vector in real indicator function; real projection has not been properly performed.");
61  return 1; // should in principle be inf but not sure how to model this
62  }
63  }
64  }
65  return 0;
66 }
#define SOPT_HIGH_LOG(...)
High priority message.
Definition: logging.h:223

References SOPT_HIGH_LOG.

◆ log_message()

template<typename SCALAR >
void sopt::algorithm::RealIndicator< SCALAR >::log_message ( ) const
inlineoverridevirtual

Implements NonDifferentiableFunc< SCALAR >.

Definition at line 26 of file real_indicator.h.

27  {
28  SOPT_HIGH_LOG("Using Real Indicator for g(x)");
29  }

References SOPT_HIGH_LOG.

◆ proximal_operator()

template<typename SCALAR >
t_Proximal sopt::algorithm::RealIndicator< SCALAR >::proximal_operator ( ) const
inlineoverridevirtual

Implements NonDifferentiableFunc< SCALAR >.

Definition at line 36 of file real_indicator.h.

37  {
38  return [this](t_Vector &out, Real gamma, t_Vector const &image) {
39  out = image.real();
40  };
41  }
sopt::Vector< Scalar > t_Vector

◆ Psi()

template<typename SCALAR >
t_LinearTransform const& sopt::algorithm::RealIndicator< SCALAR >::Psi ( ) const
inlineoverridevirtual

Implements NonDifferentiableFunc< SCALAR >.

Definition at line 45 of file real_indicator.h.

46  {
47  return linear_operator;
48  }
t_LinearTransform linear_operator

References sopt::algorithm::RealIndicator< SCALAR >::linear_operator.

Member Data Documentation

◆ linear_operator

template<typename SCALAR >
t_LinearTransform sopt::algorithm::RealIndicator< SCALAR >::linear_operator = sopt::linear_transform_identity<SCALAR>()

Definition at line 50 of file real_indicator.h.

Referenced by sopt::algorithm::RealIndicator< SCALAR >::Psi().


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