36#define USING_ALPAQA_CONFIG_NO_TYPENAME(Conf) \
37 using real_t [[maybe_unused]] = Conf::real_t; \
38 using vec [[maybe_unused]] = Conf::vec; \
39 using mvec [[maybe_unused]] = Conf::mvec; \
40 using cmvec [[maybe_unused]] = Conf::cmvec; \
41 using rvec [[maybe_unused]] = Conf::rvec; \
42 using crvec [[maybe_unused]] = Conf::crvec; \
43 using mat [[maybe_unused]] = Conf::mat; \
44 using mmat [[maybe_unused]] = Conf::mmat; \
45 using cmmat [[maybe_unused]] = Conf::cmmat; \
46 using rmat [[maybe_unused]] = Conf::rmat; \
47 using crmat [[maybe_unused]] = Conf::crmat; \
48 using length_t [[maybe_unused]] = Conf::length_t; \
49 using index_t [[maybe_unused]] = Conf::index_t; \
50 using indexvec [[maybe_unused]] = Conf::indexvec; \
51 using rindexvec [[maybe_unused]] = Conf::rindexvec; \
52 using crindexvec [[maybe_unused]] = Conf::crindexvec
54#define USING_ALPAQA_CONFIG(Conf) \
55 using config_t [[maybe_unused]] = Conf; \
56 USING_ALPAQA_CONFIG_NO_TYPENAME(typename Conf)
58#define USING_ALPAQA_CONFIG_TEMPLATE(Conf) \
59 using config_t [[maybe_unused]] = typename Conf; \
60 USING_ALPAQA_CONFIG_NO_TYPENAME(typename Conf)
63template <Config Conf = DefaultConfig>
using real_t =
typename Conf::real_t;
64template <Config Conf = DefaultConfig>
using vec =
typename Conf::vec;
65template <Config Conf = DefaultConfig>
using mvec =
typename Conf::mvec;
66template <Config Conf = DefaultConfig>
using cmvec =
typename Conf::cmvec;
67template <Config Conf = DefaultConfig>
using rvec =
typename Conf::rvec;
68template <Config Conf = DefaultConfig>
using crvec =
typename Conf::crvec;
69template <Config Conf = DefaultConfig>
using mat =
typename Conf::mat;
70template <Config Conf = DefaultConfig>
using mmat =
typename Conf::mmat;
71template <Config Conf = DefaultConfig>
using cmmat =
typename Conf::cmmat;
72template <Config Conf = DefaultConfig>
using rmat =
typename Conf::rmat;
73template <Config Conf = DefaultConfig>
using crmat =
typename Conf::crmat;
74template <Config Conf = DefaultConfig>
using length_t =
typename Conf::length_t;
75template <Config Conf = DefaultConfig>
using index_t =
typename Conf::index_t;
76template <Config Conf = DefaultConfig>
using indexvec =
typename Conf::indexvec;
77template <Config Conf = DefaultConfig>
using rindexvec =
typename Conf::rindexvec;
78template <Config Conf = DefaultConfig>
using crindexvec =
typename Conf::crindexvec;
81constexpr const auto inf = std::numeric_limits<real_t<Conf>>::infinity();
83constexpr const auto NaN = std::numeric_limits<real_t<Conf>>::quiet_NaN();
91 using vec = Eigen::VectorX<real_t>;
93 using mvec = Eigen::Map<vec>;
95 using cmvec = Eigen::Map<const vec>;
97 using rvec = Eigen::Ref<vec>;
99 using crvec = Eigen::Ref<const vec>;
101 using mat = Eigen::MatrixX<real_t>;
105 using cmmat = Eigen::Map<const mat>;
109 using crmat = Eigen::Ref<const mat>;
124 static constexpr const char *
get_name() {
return "EigenConfigf"; }
128 static constexpr const char *
get_name() {
return "EigenConfigd"; }
133 static constexpr const char *
get_name() {
return "EigenConfigl"; }
135#ifdef ALPAQA_WITH_QUAD_PRECISION
137struct EigenConfigq : EigenConfig<__float128> {
138 static constexpr const char *get_name() {
return "EigenConfigq"; }
143template <Config Conf>
150template <
class Derived>
151 requires(Derived::ColsAtCompileTime == 1)
152auto norm_inf(
const Eigen::MatrixBase<Derived> &v) {
153 return v.template lpNorm<Eigen::Infinity>();
158template <
class Derived>
159 requires(Derived::ColsAtCompileTime == 1)
160auto norm_1(
const Eigen::MatrixBase<Derived> &v) {
161 return v.template lpNorm<1>();
168#ifdef ALPAQA_WITH_QUAD_PRECISION
169#define ALPAQA_IF_QUADF(...) __VA_ARGS__
171#define ALPAQA_IF_QUADF(...)
174#ifdef ALPAQA_WITH_SINGLE_PRECISION
175#define ALPAQA_IF_FLOAT(...) __VA_ARGS__
177#define ALPAQA_IF_FLOAT(...)
180#ifdef ALPAQA_WITH_LONG_DOUBLE
181#define ALPAQA_IF_LONGD(...) __VA_ARGS__
183#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::Ref< const vec > crvec
Reference to immutable vector.
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::indexvec indexvec
Eigen::Ref< const indexvec > crindexvec
Reference to immutable index vector.
constexpr bool is_config_v
Eigen::MatrixX< real_t > mat
Dynamic matrix type.
typename Conf::cmmat cmmat
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::index_t index_t
Eigen::Index index_t
Type for vector and matrix indices.
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.
typename Conf::crvec crvec
RealT real_t
Real scalar element type.
Eigen::Map< const vec > cmvec
Immutable map of vector 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()