22 #include <gtsam/dllexport.h> 23 #include <boost/concept/assert.hpp> 24 #include <boost/range/concepts.hpp> 25 #include <gtsam/config.h> 31 #include <tbb/task_scheduler_init.h> 32 #include <tbb/tbb_exception.h> 33 #include <tbb/scalable_allocator.h> 36 #ifdef GTSAM_USE_EIGEN_MKL_OPENMP 41 # define CLANG_DIAGNOSTIC_PUSH_IGNORE(diag) \ 42 _Pragma("clang diagnostic push") \ 43 _Pragma("clang diagnostic ignored \"" diag "\"") 45 # define CLANG_DIAGNOSTIC_PUSH_IGNORE(diag) 49 # define CLANG_DIAGNOSTIC_POP() _Pragma("clang diagnostic pop") 51 # define CLANG_DIAGNOSTIC_POP() 57 typedef std::uint64_t
Key;
70 template<
typename TEST_TYPE,
typename BASIC_TYPE,
typename AS_NON_CONST,
76 template<
typename BASIC_TYPE,
typename AS_NON_CONST,
typename AS_CONST>
78 typedef AS_NON_CONST type;
82 template<
typename BASIC_TYPE,
typename AS_NON_CONST,
typename AS_CONST>
83 struct const_selector<const BASIC_TYPE, BASIC_TYPE, AS_NON_CONST, AS_CONST> {
84 typedef AS_CONST type;
93 template<
typename T, T defaultValue>
110 operator T()
const {
return value; }
120 typedef T value_type;
121 typedef const T* const_iterator;
124 const T* begin()
const {
return &element_; }
125 const T* end()
const {
return &element_ + 1; }
126 T* begin() {
return &element_; }
127 T* end() {
return &element_ + 1; }
128 size_t size()
const {
return 1; }
141 # pragma clang diagnostic push 142 # pragma clang diagnostic ignored "-Wunused-private-field" // Clang complains that previousOpenMPThreads is unused in the #else case below 150 int previousOpenMPThreads;
153 #if defined GTSAM_USE_TBB && defined GTSAM_USE_EIGEN_MKL_OPENMP 155 previousOpenMPThreads(omp_get_num_threads())
157 omp_set_num_threads(omp_get_num_procs() / 4);
162 omp_set_num_threads(previousOpenMPThreads);
171 # pragma clang diagnostic pop 180 #define assert_throw(CONDITION, EXCEPTION) ((void)0) 182 #define assert_throw(CONDITION, EXCEPTION) \ 183 if (!(CONDITION)) { \ 192 #if (_MSC_VER < 1800) 194 #include <boost/math/special_functions/fpclassify.hpp> 196 template<
typename T>
inline int isfinite(T a) {
197 return (
int)boost::math::isfinite(a); }
198 template<
typename T>
inline int isnan(T a) {
199 return (
int)boost::math::isnan(a); }
200 template<
typename T>
inline int isinf(T a) {
201 return (
int)boost::math::isinf(a); }
206 #include <boost/math/constants/constants.hpp> 208 #define M_PI (boost::math::constants::pi<double>()) 211 #define M_PI_2 (boost::math::constants::pi<double>() / 2.0) 214 #define M_PI_4 (boost::math::constants::pi<double>() / 4.0) ptrdiff_t DenseIndex
The index type for Eigen objects.
Definition: types.h:63
ListOfOneContainer< T > ListOfOne(const T &element)
Factory function for ListOfOneContainer to enable ListOfOne(e) syntax.
Definition: types.h:135
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:57
Helper struct that encapsulates a value with a default, this is just used as a member object so you d...
Definition: types.h:94
ValueWithDefault(const T &_value)
Initialize to the given value.
Definition: types.h:101
std::uint64_t FactorIndex
Integer nonlinear factor index type.
Definition: types.h:60
Helper class that uses templates to select between two types based on whether TEST_TYPE is const or n...
Definition: types.h:72
T & operator *()
Operator to access the value.
Definition: types.h:104
An object whose scope defines a block where TBB and OpenMP parallelism are mixed.
Definition: types.h:148
A helper class that behaves as a container with one element, and works with boost::range.
Definition: types.h:117
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
ValueWithDefault()
Default constructor, initialize to default value supplied in template argument.
Definition: types.h:98