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 Affine;
14
15template<typename T>
17
18} // namespace sigma
19
23#define EIGEN_NUMTRAITS(float_type) \
24 \
25 template<> \
26 struct NumTraits<sigma::Affine<float_type>> : NumTraits<float_type> { \
27 \
28 using Affine = sigma::Affine<float_type>; \
29 \
30 using Real = Affine; \
31 \
32 using NonInteger = Affine; \
33 \
34 using Literal = Affine; \
35 \
36 using Nested = Affine; \
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 \
48 template<> \
49 struct NumTraits<sigma::ThresholdedAffine<float_type>> \
50 : NumTraits<float_type> { \
51 \
52 using Affine = sigma::ThresholdedAffine<float_type>; \
53 \
54 using Real = Affine; \
55 \
56 using NonInteger = Affine; \
57 \
58 using Literal = Affine; \
59 \
60 using Nested = Affine; \
61 enum { \
62 IsComplex = 0, \
63 IsInteger = 0, \
64 IsSigned = 1, \
65 RequireInitialization = 1, \
66 ReadCost = 1, \
67 AddCost = 3, \
68 MulCost = 3 \
69 }; \
70 }
71
77namespace Eigen {
78
81
82} // namespace Eigen
83
84#undef EIGEN_NUMTRAITS
85#endif // ENABLE_EIGEN_SUPPORT
#define EIGEN_NUMTRAITS(float_type)
Factorization for Eigen::NumTraits Specialization for Affine.
Definition eigen_compat.hpp:23
Implements affine arithmetic.
Definition affine.hpp:48
Implements affine arithmetic that drops negligible error terms.
Definition thresholded_affine.hpp:29
The namespace of the Eigen library.
The primary namespace for the sigma library.
Definition affine.hpp:12