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;
16template<typename IntervalType>
17class Triplex;
18} // namespace sigma
19
23#define EIGEN_NUMTRAITS(interval_type, float_type) \
24 \
25 template<> \
26 struct NumTraits<sigma::Triplex<sigma::interval_type<float_type>>> \
27 : NumTraits<float_type> { \
28 \
29 using Triplex = sigma::Triplex<sigma::interval_type<float_type>>; \
30 \
31 using Real = Triplex; \
32 \
33 using NonInteger = Triplex; \
34 \
35 using Literal = Triplex; \
36 \
37 using Nested = Triplex; \
38 enum { \
39 IsComplex = 0, \
40 IsInteger = 0, \
41 IsSigned = 1, \
42 RequireInitialization = 1, \
43 ReadCost = 1, \
44 AddCost = 6, \
45 MulCost = 6 \
46 }; \
47 }
48
54namespace Eigen {
55
56EIGEN_NUMTRAITS(Interval, float);
57EIGEN_NUMTRAITS(Interval, double);
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
Models an interval together with a best estimate inside it.
Definition triplex.hpp:42
The namespace of the Eigen library.
The primary namespace for the sigma library.
Definition affine.hpp:12