![]() |
SOPT
Sparse OPTimisation
|
Wraps an std::function to return an expression. More...
#include <wrapper.h>
Public Types | |
using | t_Function = OperatorFunction< VECTOR > |
Type of function wrapped here. More... | |
Public Member Functions | |
WrapFunction (t_Function const &func, std::array< t_int, 3 > sizes={{1, 1, 0}}) | |
WrapFunction (WrapFunction const &c) | |
WrapFunction (WrapFunction const &&c) | |
void | operator= (WrapFunction const &c) |
void | operator= (WrapFunction &&c) |
template<typename T0 > | |
AppliedFunction< t_Function const &, Eigen::ArrayBase< T0 > > | operator() (Eigen::ArrayBase< T0 > const &x) const |
Function application form. More... | |
template<typename T0 > | |
AppliedFunction< t_Function const &, Eigen::ArrayBase< T0 > > | operator* (Eigen::ArrayBase< T0 > const &x) const |
Multiplication application form. More... | |
template<typename T0 > | |
AppliedFunction< t_Function const &, Eigen::MatrixBase< T0 > > | operator() (Eigen::MatrixBase< T0 > const &x) const |
Function application form. More... | |
template<typename T0 > | |
AppliedFunction< t_Function const &, Eigen::MatrixBase< T0 > > | operator* (Eigen::MatrixBase< T0 > const &x) const |
Multiplication application form. More... | |
std::array< t_int, 3 > const & | sizes () const |
Defines relation-ship between input and output sizes. More... | |
template<typename T > | |
std::enable_if< std::is_integral< T >::value, T >::type | rows (T xsize) const |
Output vector size for a input with xsize elements. More... | |
Wraps an std::function to return an expression.
This makes writing the application of a function more beautiful on the eye. A function call func(output, input)
can be made to look like output = func(input)
or output = func * input
.
using sopt::details::WrapFunction< VECTOR >::t_Function = OperatorFunction<VECTOR> |
|
inline |
Initializes the wrapper
[in] | func | function to wrap |
[in] | sizes | three integer vector (a, b, c) if N is the size of the input, then (N * a) / b + c is the output b cannot be zero. |
Definition at line 56 of file wrapper.h.
|
inline |
|
inline |
|
inline |
Function application form.
Definition at line 74 of file wrapper.h.
References sopt::details::WrapFunction< VECTOR >::rows().
|
inline |
Function application form.
Definition at line 88 of file wrapper.h.
References sopt::details::WrapFunction< VECTOR >::rows().
|
inline |
Multiplication application form.
Definition at line 81 of file wrapper.h.
References sopt::details::WrapFunction< VECTOR >::rows().
|
inline |
Multiplication application form.
Definition at line 95 of file wrapper.h.
References sopt::details::WrapFunction< VECTOR >::rows().
|
inline |
|
inline |
Definition at line 63 of file wrapper.h.
Referenced by sopt::LinearTransform< VECTOR >::operator=().
|
inline |
Output vector size for a input with xsize
elements.
Definition at line 110 of file wrapper.h.
Referenced by sopt::details::WrapFunction< VECTOR >::operator()(), and sopt::details::WrapFunction< VECTOR >::operator*().
|
inline |
Defines relation-ship between input and output sizes.
An integer tuple (a, b, c) where, if N is the size of the input, then \((N * a) / b + c\) is the output. \(b\) cannot be zero. In the simplest case where this objects wraps a square matrix, then the sizes are (1, 1, 0). If this objects wraps a rectangular matrix which halves the number of elements, then the sizes would be (1, 2, 0).