sigma  1.0.0
Loading...
Searching...
No Matches
eigen_compat.hpp
Go to the documentation of this file.
1#pragma once
2
6
7#ifdef ENABLE_EIGEN_SUPPORT
8#include <Eigen/Dense>
9
10// Foward Declarations
11namespace sigma {
12template<typename T>
13class Interval;
14template<typename T>
15class GeneralInterval;
16} // namespace sigma
17
22#define EIGEN_NUMTRAITS(interval_type, float_type) \
23 \
24 template<> \
25 struct NumTraits<sigma::interval_type<float_type>> \
26 : NumTraits<float_type> { \
27 \
28 using Interval = sigma::interval_type<float_type>; \
29 \
30 using Real = Interval; \
31 \
32 using NonInteger = Interval; \
33 \
34 using Literal = Interval; \
35 \
36 using Nested = Interval; \
37 enum { \
38 IsComplex = 0, \
39 IsInteger = 0, \
40 IsSigned = 1, \
41 RequireInitialization = 1, \
42 ReadCost = 1, \
43 AddCost = 3, \
44 MulCost = 3 \
45 }; \
46 }
47
54namespace Eigen {
55
58EIGEN_NUMTRAITS(GeneralInterval, float);
59EIGEN_NUMTRAITS(GeneralInterval, double);
60
61} // namespace Eigen
62
63#undef EIGEN_NUMTRAITS
64#endif // ENABLE_EIGEN_SUPPORT
#define EIGEN_NUMTRAITS(float_type)
Factorization for Eigen::NumTraits Specialization for Affine.
Definition eigen_compat.hpp:23
Models an interval whose bounds may be open.
Definition general_interval.hpp:36
Models a closed numeric interval.
Definition interval.hpp:29
The namespace of the Eigen library.
The primary namespace for the sigma library.
Definition affine.hpp:12
sigma::Interval< double > Interval
Definition eigen_compat.hpp:57
sigma::Interval< float > Interval
Definition eigen_compat.hpp:56