1 #ifndef SOPT_L1_NON_DIFF_FUNCTION_H
2 #define SOPT_L1_NON_DIFF_FUNCTION_H
4 #include "sopt/config.h"
26 template <
typename SCALAR>
30 using FB = ForwardBackward<SCALAR>;
31 using Real =
typename FB::Real;
41 : tight_frame_ (tight_frame),
49 SOPT_HIGH_LOG(
"Performing Forward Backward with L1 and L2 norms");
54 auto &weights = l1_proximal_weights();
55 auto input =
static_cast<t_Vector>(
Psi().adjoint() * x);
90 #define SOPT_MACRO(VAR, TYPE) \
92 TYPE const &l1_proximal_##VAR() const { return l1_proximal().VAR(); } \
94 L1GProximal<SCALAR> &l1_proximal_##VAR(TYPE const ARG) { \
95 l1_proximal().VAR(ARG); \
106 SOPT_MACRO(adjoint_space_comm, mpi::Communicator);
107 SOPT_MACRO(direct_space_comm, mpi::Communicator);
112 template <
typename... ARGS>
126 template <
typename T0,
typename T1>
128 Eigen::MatrixBase<T1>
const &x)
const {
129 return l1_proximal_real_constraint()
130 ? call_l1_proximal(out, gamma, x.real().template cast<typename T1::Scalar>())
131 : call_l1_proximal(out, gamma, x);
135 template <
typename T0,
typename T1>
137 Eigen::MatrixBase<T1>
const &x)
const {
140 return {0, 0,
l1_proximal().objective(x, out, gamma),
true};
sopt::Vector< Scalar > t_Vector
typename FB::Scalar Scalar
L1GProximal< SCALAR > &::type Psi(ARGS &&... args)
L1GProximal(bool tight_frame=false)
typename FB::t_Proximal t_Proximal
L1GProximal< SCALAR > & l1_proximal(proximal::L1< Scalar > const &arg)
SOPT_MACRO(positivity_constraint, bool)
typename FB::t_LinearTransform t_LinearTransform
void log_message() const override
proximal::L1< Scalar > const & l1_proximal() const
typename FB::t_Vector t_Vector
proximal::L1< Scalar > & l1_proximal()
L1 proximal used during calculation.
SOPT_MACRO(tolerance, Real)
ForwardBackward< SCALAR > FB
SOPT_MACRO(weights, Vector< t_real >)
t_Proximal proximal_operator() const override
SOPT_MACRO(real_constraint, bool)
t_LinearTransform const & Psi() const override
Analysis operator Ψ
SOPT_MACRO(itermax, t_uint)
auto tight_frame(T &&... args) const -> decltype(this->L1TightFrame< Scalar >::operator()(std::forward< T >(args)...))
Special case if Ψ ia a tight frame.
LinearTransform< Vector< Scalar > > const & Psi() const
Linear transform applied to input prior to L1 norm.
sopt::LinearTransform< t_Vector > t_LinearTransform
#define SOPT_HIGH_LOG(...)
High priority message.
size_t t_uint
Root of the type hierarchy for unsigned integers.
Eigen::Matrix< T, Eigen::Dynamic, 1 > Vector
A vector of a given type.
real_type< typename T0::Scalar >::type l1_norm(Eigen::ArrayBase< T0 > const &input, Eigen::ArrayBase< T1 > const &weights)
Computes weighted L1 norm.