26#if defined(_MSC_VER) && defined(_M_ARM64)
27#ifndef EIGEN_HAS_SINGLE_INSTRUCTION_MADD
28#define EIGEN_HAS_SINGLE_INSTRUCTION_MADD
35#if defined(__APPLE__) && defined(__clang__)
36#ifndef EIGEN_ASSUME_ALIGNED
37#define EIGEN_ASSUME_ALIGNED(PTR, ALIGN_BYTES)
49 concept IsVectorOrRow = (C == 1 || R == 1);
51 template<
typename Scalar>
52 concept IsIntervalDomain = std::is_same_v<Scalar,codac2::Interval>;
55#define EIGEN_MATRIXBASE_PLUGIN "codac2_MatrixBase_addons_include.h"
56#define EIGEN_MATRIX_PLUGIN "codac2_Matrix_addons_include.h"
75 template<>
struct NumTraits<
codac2::Interval>
82 typedef double RealScalar;
88 RequireInitialization = 1,
95 template<
typename BinOp>
96 struct ScalarBinaryOpTraits<codac2::Interval,double,BinOp>
97 {
typedef codac2::Interval ReturnType; };
99 template<
typename BinOp>
100 struct ScalarBinaryOpTraits<double,codac2::Interval,BinOp>
101 {
typedef codac2::Interval ReturnType; };
106 using Eigen::Dynamic;
114 template<
typename Scalar,
int R,
int C>
115 using Mat = Eigen::Matrix<Scalar,R,C>;
117 template<
int R,
int C>
118 struct is_interval_based<Eigen::
Matrix<double,R,C>> : std::false_type {};
120 template<
int R,
int C>
121 struct is_interval_based<Eigen::
Matrix<Interval,R,C>> : std::true_type {};
123 template<
typename T,
int R,
int C>
124 struct is_ctc<Eigen::
Matrix<T,R,C>> : std::false_type {};
126 template<
typename T,
int R,
int C>
127 struct is_sep<Eigen::
Matrix<T,R,C>> : std::false_type {};
130 concept is_matrix_base_double =
132 typename Eigen::internal::traits<std::decay_t<T>>::Scalar;
133 requires std::same_as<
134 typename Eigen::internal::traits<std::decay_t<T>>::Scalar,
154 template<
typename OtherDerived>
155 inline auto abs(
const Eigen::MatrixBase<OtherDerived>& x)
157 using M = Eigen::MatrixBase<OtherDerived>;
158 Eigen::Matrix<typename M::Scalar,M::RowsAtCompileTime,M::ColsAtCompileTime> a(x.rows(),x.cols());
160 for(Index i = 0 ; i < x.rows() ; i++)
161 for(Index j = 0 ; j < x.cols() ; j++)
163 if constexpr(std::is_same_v<typename M::Scalar,double>)
164 a(i,j) = fabs(x(i,j));
166 a(i,j) =
abs(x(i,j));
183 template<
typename OtherDerived>
184 requires (!Eigen::IsIntervalDomain<typename OtherDerived::Scalar>)
185 inline auto floor(
const Eigen::MatrixBase<OtherDerived>& x)
187 return x.array().floor().matrix();
201 template<
typename OtherDerived>
202 requires (!Eigen::IsIntervalDomain<typename OtherDerived::Scalar>)
203 inline auto ceil(
const Eigen::MatrixBase<OtherDerived>& x)
205 return x.array().ceil().matrix();
219 template<
typename OtherDerived>
220 requires (!Eigen::IsIntervalDomain<typename OtherDerived::Scalar>)
221 inline auto round(
const Eigen::MatrixBase<OtherDerived>& x)
223 return x.array().round().matrix();
236 return Eigen::IOFormat(Eigen::StreamPrecision, Eigen::DontAlignCols,
" ",
"",
"",
"",
"[ ",
" ]");
249 return Eigen::IOFormat(Eigen::StreamPrecision, Eigen::DontAlignCols,
"",
" ; ",
"",
"",
"[ ",
" ]");
263 return Eigen::IOFormat(Eigen::StreamPrecision, 0,
" , ",
"\n",
"[ ",
" ]",
"[",
"]");
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:50
Definition codac2_matrices.h:47
Definition codac2_OctaSym.h:21
Interval ceil(const Interval &x)
Returns ceil of .
Definition codac2_Interval_operations_impl.h:294
Eigen::IOFormat codac_vector_fmt()
Provides an Eigen IOFormat for formatting column vectors.
Definition codac2_matrices.h:247
Eigen::IOFormat codac_row_fmt()
Provides an Eigen IOFormat for formatting row vectors.
Definition codac2_matrices.h:234
Interval floor(const Interval &x)
Returns floor of .
Definition codac2_Interval_operations_impl.h:289
auto round(const Eigen::MatrixBase< OtherDerived > &x)
Compute the element-wise rounding of a matrix.
Definition codac2_matrices.h:221
Eigen::Matrix< double,-1,-1 > Matrix
Alias for a dynamic-size matrix of doubles.
Definition codac2_Matrix.h:26
Interval sqr(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:21
Eigen::IOFormat codac_matrix_fmt()
Provides an Eigen IOFormat for formatting matrices.
Definition codac2_matrices.h:261
Interval abs(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:264