1 #ifndef SOPT_PROXIMAL_EXPRESSION_H
2 #define SOPT_PROXIMAL_EXPRESSION_H
4 #include "sopt/config.h"
18 template <
typename FUNCTION,
typename DERIVED>
20 :
public Eigen::ReturnByValue<DelayedProximalFunction<FUNCTION, DERIVED>> {
23 using Index =
typename DERIVED::Index;
27 : func(func), gamma(gamma), x(x) {}
29 : func(c.func), gamma(c.gamma), x(c.x) {}
31 : func(std::move(c.func)), gamma(c.gamma), x(c.x) {}
33 template <
typename DESTINATION>
34 void evalTo(DESTINATION &destination)
const {
35 destination.resizeLike(x);
36 func(destination, gamma, x);
52 template <
typename FUNCTION,
typename DERIVED>
54 :
public Eigen::ReturnByValue<DelayedProximalEnveloppeFunction<FUNCTION, DERIVED>> {
57 using Index =
typename DERIVED::Index;
62 : func(c.func), x(c.x) {}
64 : func(std::move(c.func)), x(c.x) {}
66 template <
typename DESTINATION>
67 void evalTo(DESTINATION &destination)
const {
68 destination.resizeLike(x);
83 template <
typename FUNC,
typename T0>
86 template <
typename FUNC,
typename T0>
91 template <
typename FUNCTION,
typename VECTOR>
92 struct traits<
sopt::proximal::details::DelayedProximalFunction<FUNCTION, VECTOR>> {
95 template <
typename FUNCTION,
typename VECTOR>
96 struct traits<
sopt::proximal::details::DelayedProximalEnveloppeFunction<FUNCTION, VECTOR>> {
Computes inner-most element type.
Expression referencing a lazy function call to envelope proximal.
DelayedProximalEnveloppeFunction(FUNCTION const &func, DERIVED const &x)
typename DERIVED::PlainObject PlainObject
typename real_type< typename DERIVED::Scalar >::type Real
DelayedProximalEnveloppeFunction(DelayedProximalEnveloppeFunction &&c)
typename DERIVED::Index Index
DelayedProximalEnveloppeFunction(DelayedProximalEnveloppeFunction const &c)
void evalTo(DESTINATION &destination) const
Expression referencing a lazy proximal function call.
void evalTo(DESTINATION &destination) const
typename DERIVED::PlainObject PlainObject
DelayedProximalFunction(DelayedProximalFunction const &c)
typename DERIVED::Index Index
DelayedProximalFunction(DelayedProximalFunction &&c)
typename real_type< typename DERIVED::Scalar >::type Real
DelayedProximalFunction(FUNCTION const &func, Real const &gamma, DERIVED const &x)
Holds some standard proximals.
typename VECTOR::PlainObject ReturnType
typename VECTOR::PlainObject ReturnType