Functions and operators#

group grp_Functions

(Proximable) functions and operators.

Variables

struct alpaqa::prox_fn prox#

Compute the proximal mapping.

outproxγfunc(in).

Param func:

The proximable function h:IRnIRn to apply the proximal mapping of.

Param in:

[in] Input vector or matrix x, e.g. current iterate.

Param out:

[out] Proximal mapping of (γh) at x. x^proxγh(x)

Param γ:

[in] Proximal step size γ.

Return:

The value of the function evaluated in the output, h(x^).

struct alpaqa::prox_step_fn prox_step#

Compute a generalized forward-backward step.

outproxγfunc(in+γfwdfwd_step)fb_stepoutin.
This function can be used to implement the TypeErasedProblem::eval_prox_grad_step function:

struct Problem {
    alpaqa::functions::NuclearNorm<config_t> h{λ, rows, cols};
    real_t eval_prox_grad_step(real_t γ, crvec x, crvec grad_ψ, rvec x̂, rvec p) const {
        return alpaqa::prox_step(h, x, grad_ψ, x̂, p, γ, -γ);
    }
};
Note the negative sign for the forward step size.

Param func:

The proximable function h:IRnIRn to apply the proximal mapping of.

Param in:

[in] Input vector or matrix x, e.g. current iterate.

Param fwd_step:

[in] Step d to add to x before computing the proximal mapping. Scaled by γfwd.

Param out:

[out] Proximal mapping of (γh) at x+γfwdd. x^proxγh(x+γfwdd)

Param fb_step:

[out] Forward-backward step p. p=x^x^

Param γ:

[in] Proximal step size γ.

Param γ_fwd:

[in] Forward step size γfwd.

Return:

The value of the function evaluated in the output, h(x^).

template<Config Conf, class Weight = typename Conf::real_t>
struct L1Norm
#include <alpaqa/functions/l1-norm.hpp>

ℓ₁-norm.

Template Parameters:

Weight – Type of weighting factors. Either scalar or vector.

Public Types

using weight_t = Weight

Public Functions

inline L1Norm(weight_t λ)
inline L1Norm()
L1Norm() = default
inline real_t prox(crmat in, rmat out, real_t γ = 1)

Public Members

weight_t λ

Public Static Attributes

static constexpr bool scalar_weight = std::is_same_v<weight_t, real_t>

Friends

inline friend real_t alpaqa_tag_invoke(tag_t<alpaqa::prox>, L1Norm &self, crmat in, rmat out, real_t γ)
template<Config Conf, class Weight = typename Conf::real_t>
struct L1NormComplex
#include <alpaqa/functions/l1-norm.hpp>

ℓ₁-norm of complex numbers.

Template Parameters:

Weight – Type of weighting factors. Either scalar or vector.

Public Types

using weight_t = Weight

Public Functions

inline L1NormComplex(weight_t λ)
inline L1NormComplex()
L1NormComplex() = default
inline real_t prox(crcmat in, rcmat out, real_t γ = 1)
inline real_t prox(crmat in, rmat out, real_t γ = 1)

Note: a complex vector in ℂⁿ is represented by a real vector in ℝ²ⁿ.

Public Members

weight_t λ

Public Static Attributes

static constexpr bool scalar_weight = std::is_same_v<weight_t, real_t>

Friends

inline friend real_t alpaqa_tag_invoke(tag_t<alpaqa::prox>, L1NormComplex &self, crmat in, rmat out, real_t γ)
template<Config Conf, class SVD = DefaultSVD<Conf>>
struct NuclearNorm
#include <alpaqa/functions/nuclear-norm.hpp>

Nuclear norm (ℓ₁-norm of singular values).

Public Functions

inline NuclearNorm(real_t λ = 1)

Construct without pre-allocation.

inline NuclearNorm(real_t λ, length_t rows, length_t cols)

Construct with pre-allocation.

inline real_t prox(crmat in, rmat out, real_t γ = 1)

Public Members

real_t λ
length_t rows = 0
length_t cols = 0
SVD svd
vec singular_values

Friends

inline friend real_t alpaqa_tag_invoke(tag_t<alpaqa::prox>, NuclearNorm &self, crmat in, rmat out, real_t γ)