SOPT
Sparse OPTimisation
types.h
Go to the documentation of this file.
1 #ifndef BICO_TRAITS_H
2 #define BICO_TRAITS_H
3 
4 #include "sopt/config.h"
5 #include <complex>
6 #include <functional>
7 #include <Eigen/Core>
8 #include "sopt/real_type.h"
9 
10 namespace sopt {
11 
13 using t_int = int;
15 using t_uint = size_t;
17 using t_real = double;
19 using t_complex = std::complex<t_real>;
20 
23 template <typename T = t_real>
24 using Vector = Eigen::Matrix<T, Eigen::Dynamic, 1>;
25 
28 template <typename T = t_real>
29 using Matrix = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>;
30 
33 template <typename T = t_real>
34 using Array = Eigen::Array<T, Eigen::Dynamic, 1>;
35 
38 template <typename T = t_real>
39 using Image = Eigen::Array<T, Eigen::Dynamic, Eigen::Dynamic>;
40 
42 template <typename VECTOR = Vector<>>
43 using OperatorFunction = std::function<void(VECTOR &, VECTOR const &)>;
44 
46 template <typename SCALAR = t_real>
48  std::function<void(Vector<SCALAR> &output, typename real_type<SCALAR>::type const weight, Vector<SCALAR> const &input)>;
49 
51 template <typename SCALAR = t_real>
52 using ConvergenceFunction = std::function<bool(Vector<SCALAR> const &)>;
53 } // namespace sopt
54 #endif
Computes inner-most element type.
Definition: real_type.h:42
int t_int
Root of the type hierarchy for signed integers.
Definition: types.h:13
double t_real
Root of the type hierarchy for real numbers.
Definition: types.h:17
size_t t_uint
Root of the type hierarchy for unsigned integers.
Definition: types.h:15
Eigen::Array< T, Eigen::Dynamic, Eigen::Dynamic > Image
A 2-dimensional list of elements of given type.
Definition: types.h:39
Eigen::Array< T, Eigen::Dynamic, 1 > Array
A 1-dimensional list of elements of given type.
Definition: types.h:34
std::function< void(VECTOR &, VECTOR const &)> OperatorFunction
Typical function out = A*x.
Definition: types.h:43
Eigen::Matrix< T, Eigen::Dynamic, 1 > Vector
A vector of a given type.
Definition: types.h:24
std::function< void(Vector< SCALAR > &output, typename real_type< SCALAR >::type const weight, Vector< SCALAR > const &input)> ProximalFunction
Typical function signature for calls to proximal.
Definition: types.h:48
std::function< bool(Vector< SCALAR > const &)> ConvergenceFunction
Typical function signature for convergence.
Definition: types.h:52
std::complex< t_real > t_complex
Root of the type hierarchy for (real) complex numbers.
Definition: types.h:19
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > Matrix
A matrix of a given type.
Definition: types.h:29