sigma  0.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 Declaration
11namespace sigma {
12template<typename T>
13class Uncertain;
14} // namespace sigma
15
19#define EIGEN_NUMTRAITS(float_type) \
20 \
21 template<> \
22 struct NumTraits<sigma::Uncertain<float_type>> : NumTraits<float_type> { \
23 \
24 using Uncertain = sigma::Uncertain<float_type>; \
25 \
26 using Real = Uncertain; \
27 \
28 using NonInteger = Uncertain; \
29 \
30 using Literal = Uncertain; \
31 \
32 using Nested = Uncertain; \
33 enum { \
34 IsComplex = 0, \
35 IsInteger = 0, \
36 IsSigned = 1, \
37 RequireInitialization = 1, \
38 ReadCost = 1, \
39 AddCost = 3, \
40 MulCost = 3 \
41 }; \
42 }
43
49namespace Eigen {
50
53
54} // namespace Eigen
55
56#undef EIGEN_NUMTRAITS
57#endif // ENABLE_EIGEN_SUPPORT
Models an unceratin variable.
Definition uncertain.hpp:33
#define EIGEN_NUMTRAITS(float_type)
Factorization for Eigen::NumTraits Specialization.
Definition eigen_compat.hpp:19
The namespace of the Eigen library.
The primary namespace for the sigma library.
Definition operation_common.hpp:10