37#define USING_ALPAQA_CONFIG_NO_TYPENAME(Conf) \
38 using real_t [[maybe_unused]] = Conf::real_t; \
39 using cplx_t [[maybe_unused]] = Conf::cplx_t; \
40 using vec [[maybe_unused]] = Conf::vec; \
41 using mvec [[maybe_unused]] = Conf::mvec; \
42 using cmvec [[maybe_unused]] = Conf::cmvec; \
43 using rvec [[maybe_unused]] = Conf::rvec; \
44 using crvec [[maybe_unused]] = Conf::crvec; \
45 using mat [[maybe_unused]] = Conf::mat; \
46 using mmat [[maybe_unused]] = Conf::mmat; \
47 using cmmat [[maybe_unused]] = Conf::cmmat; \
48 using rmat [[maybe_unused]] = Conf::rmat; \
49 using crmat [[maybe_unused]] = Conf::crmat; \
50 using cmat [[maybe_unused]] = Conf::cmat; \
51 using mcmat [[maybe_unused]] = Conf::mcmat; \
52 using cmcmat [[maybe_unused]] = Conf::cmcmat; \
53 using rcmat [[maybe_unused]] = Conf::rcmat; \
54 using crcmat [[maybe_unused]] = Conf::crcmat; \
55 using length_t [[maybe_unused]] = Conf::length_t; \
56 using index_t [[maybe_unused]] = Conf::index_t; \
57 using indexvec [[maybe_unused]] = Conf::indexvec; \
58 using rindexvec [[maybe_unused]] = Conf::rindexvec; \
59 using crindexvec [[maybe_unused]] = Conf::crindexvec; \
60 using mindexvec [[maybe_unused]] = Conf::mindexvec; \
61 using cmindexvec [[maybe_unused]] = Conf::cmindexvec
63#define USING_ALPAQA_CONFIG(Conf) \
64 using config_t [[maybe_unused]] = Conf; \
65 USING_ALPAQA_CONFIG_NO_TYPENAME(typename Conf)
67#define USING_ALPAQA_CONFIG_TEMPLATE(Conf) \
68 using config_t [[maybe_unused]] = typename Conf; \
69 USING_ALPAQA_CONFIG_NO_TYPENAME(typename Conf)
72template <Config Conf = DefaultConfig>
using real_t =
typename Conf::real_t;
73template <Config Conf = DefaultConfig>
using cplx_t =
typename Conf::cplx_t;
74template <Config Conf = DefaultConfig>
using vec =
typename Conf::vec;
75template <Config Conf = DefaultConfig>
using mvec =
typename Conf::mvec;
76template <Config Conf = DefaultConfig>
using cmvec =
typename Conf::cmvec;
77template <Config Conf = DefaultConfig>
using rvec =
typename Conf::rvec;
78template <Config Conf = DefaultConfig>
using crvec =
typename Conf::crvec;
79template <Config Conf = DefaultConfig>
using mat =
typename Conf::mat;
80template <Config Conf = DefaultConfig>
using mmat =
typename Conf::mmat;
81template <Config Conf = DefaultConfig>
using cmmat =
typename Conf::cmmat;
82template <Config Conf = DefaultConfig>
using rmat =
typename Conf::rmat;
83template <Config Conf = DefaultConfig>
using crmat =
typename Conf::crmat;
84template <Config Conf = DefaultConfig>
using cmat =
typename Conf::cmat;
85template <Config Conf = DefaultConfig>
using mcmat =
typename Conf::mcmat;
86template <Config Conf = DefaultConfig>
using cmcmat =
typename Conf::cmcmat;
87template <Config Conf = DefaultConfig>
using rcmat =
typename Conf::rcmat;
88template <Config Conf = DefaultConfig>
using crcmat =
typename Conf::crcmat;
89template <Config Conf = DefaultConfig>
using length_t =
typename Conf::length_t;
90template <Config Conf = DefaultConfig>
using index_t =
typename Conf::index_t;
91template <Config Conf = DefaultConfig>
using indexvec =
typename Conf::indexvec;
92template <Config Conf = DefaultConfig>
using rindexvec =
typename Conf::rindexvec;
93template <Config Conf = DefaultConfig>
using crindexvec =
typename Conf::crindexvec;
94template <Config Conf = DefaultConfig>
using mindexvec =
typename Conf::mindexvec;
95template <Config Conf = DefaultConfig>
using cmindexvec =
typename Conf::cmindexvec;
98constexpr const auto inf = std::numeric_limits<real_t<Conf>>
::infinity();
103template <
class RealT>
110 using vec = Eigen::VectorX<real_t>;
114 using cmvec = Eigen::Map<const vec>;
118 using crvec = Eigen::Ref<const vec>;
120 using mat = Eigen::MatrixX<real_t>;
124 using cmmat = Eigen::Map<const mat>;
128 using crmat = Eigen::Ref<const mat>;
130 using cmat = Eigen::MatrixX<cplx_t>;
157 static constexpr const char *
get_name() {
return "EigenConfigf"; }
161 static constexpr const char *
get_name() {
return "EigenConfigd"; }
166 static constexpr const char *
get_name() {
return "EigenConfigl"; }
168#ifdef ALPAQA_WITH_QUAD_PRECISION
171 static constexpr const char *get_name() {
return "EigenConfigq"; }
176template <Config Conf>
179template <Config Conf>
186template <
class Derived>
187 requires(Derived::ColsAtCompileTime == 1)
194template <
class Derived>
195 requires(Derived::ColsAtCompileTime == 1)
196auto norm_1(
const Eigen::MatrixBase<Derived> &
v) {
204#ifdef ALPAQA_WITH_QUAD_PRECISION
205#define ALPAQA_IF_QUADF(...) __VA_ARGS__
207#define ALPAQA_IF_QUADF(...)
210#ifdef ALPAQA_WITH_SINGLE_PRECISION
211#define ALPAQA_IF_FLOAT(...) __VA_ARGS__
213#define ALPAQA_IF_FLOAT(...)
216#ifdef ALPAQA_WITH_LONG_DOUBLE
217#define ALPAQA_IF_LONGD(...) __VA_ARGS__
219#define ALPAQA_IF_LONGD(...)
auto norm_inf(const Eigen::MatrixBase< Derived > &v)
Get the maximum or infinity-norm of the given vector.
auto norm_1(const Eigen::MatrixBase< Derived > &v)
Get the 1-norm of the given vector.
Eigen::MatrixX< cplx_t > cmat
Dynamic complex matrix type.
Eigen::Ref< const vec > crvec
Reference to immutable vector.
typename Conf::crcmat crcmat
Eigen::Map< mat > mmat
Map of matrix type.
typename Conf::crmat crmat
Eigen::Ref< const mat > crmat
Reference to immutable matrix.
Eigen::Map< vec > mvec
Map of vector type.
typename Conf::mindexvec mindexvec
typename Conf::indexvec indexvec
Eigen::Ref< const indexvec > crindexvec
Reference to immutable index vector.
const rindexvec< Conf > null_indexvec
Global empty index vector for convenience.
typename Conf::cmcmat cmcmat
constexpr bool is_config_v
Eigen::MatrixX< real_t > mat
Dynamic matrix type.
typename Conf::cmmat cmmat
Eigen::Ref< const cmat > crcmat
Reference to immutable complex matrix.
Eigen::VectorX< index_t > indexvec
Dynamic vector of indices.
typename Conf::real_t real_t
const rvec< Conf > null_vec
Global empty vector for convenience.
typename Conf::rindexvec rindexvec
typename Conf::cmindexvec cmindexvec
typename Conf::index_t index_t
Eigen::Index index_t
Type for vector and matrix indices.
typename Conf::rcmat rcmat
typename Conf::length_t length_t
Eigen::VectorX< real_t > vec
Dynamic vector type.
typename Conf::cmvec cmvec
Eigen::Ref< mat > rmat
Reference to mutable matrix.
Eigen::Index length_t
Type for lengths and sizes.
Eigen::Map< indexvec > mindexvec
Map of index vector type.
typename Conf::crvec crvec
typename Conf::cplx_t cplx_t
typename Conf::mcmat mcmat
RealT real_t
Real scalar element type.
Eigen::Map< const indexvec > cmindexvec
Immutable map of index vector type.
Eigen::Ref< cmat > rcmat
Reference to mutable complex matrix.
Eigen::Map< const vec > cmvec
Immutable map of vector type.
Eigen::Map< cmat > mcmat
Map of complex matrix type.
Eigen::Map< const cmat > cmcmat
Immutable map of complex matrix type.
std::complex< real_t > cplx_t
Complex scalar element type.
Eigen::Map< const mat > cmmat
Immutable map of matrix type.
Eigen::Ref< indexvec > rindexvec
Reference to mutable index vector.
Eigen::Ref< vec > rvec
Reference to mutable vector.
typename Conf::crindexvec crindexvec
Double-precision double configuration.
static constexpr const char * get_name()
Single-precision float configuration.
static constexpr const char * get_name()
long double configuration.
static constexpr const char * get_name()