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;
67 template<
typename TEST_TYPE,
typename BASIC_TYPE,
typename AS_NON_CONST,
73 template<
typename BASIC_TYPE,
typename AS_NON_CONST,
typename AS_CONST>
75 typedef AS_NON_CONST type;
79 template<
typename BASIC_TYPE,
typename AS_NON_CONST,
typename AS_CONST>
80 struct const_selector<const BASIC_TYPE, BASIC_TYPE, AS_NON_CONST, AS_CONST> {
81 typedef AS_CONST type;
90 template<
typename T, T defaultValue>
107 operator T()
const {
return value; }
117 typedef T value_type;
118 typedef const T* const_iterator;
121 const T* begin()
const {
return &element_; }
122 const T* end()
const {
return &element_ + 1; }
123 T* begin() {
return &element_; }
124 T* end() {
return &element_ + 1; }
125 size_t size()
const {
return 1; }
138 # pragma clang diagnostic push 139 # pragma clang diagnostic ignored "-Wunused-private-field" // Clang complains that previousOpenMPThreads is unused in the #else case below 147 int previousOpenMPThreads;
150 #if defined GTSAM_USE_TBB && defined GTSAM_USE_EIGEN_MKL_OPENMP 152 previousOpenMPThreads(omp_get_num_threads())
154 omp_set_num_threads(omp_get_num_procs() / 4);
159 omp_set_num_threads(previousOpenMPThreads);
168 # pragma clang diagnostic pop 177 #define assert_throw(CONDITION, EXCEPTION) ((void)0) 179 #define assert_throw(CONDITION, EXCEPTION) \ 180 if (!(CONDITION)) { \ 189 #if (_MSC_VER < 1800) 191 #include <boost/math/special_functions/fpclassify.hpp> 193 template<
typename T>
inline int isfinite(T a) {
194 return (
int)boost::math::isfinite(a); }
195 template<
typename T>
inline int isnan(T a) {
196 return (
int)boost::math::isnan(a); }
197 template<
typename T>
inline int isinf(T a) {
198 return (
int)boost::math::isinf(a); }
203 #include <boost/math/constants/constants.hpp> 205 #define M_PI (boost::math::constants::pi<double>()) 208 #define M_PI_2 (boost::math::constants::pi<double>() / 2.0) 211 #define M_PI_4 (boost::math::constants::pi<double>() / 4.0) A helper class that behaves as a container with one element, and works with boost::range.
Definition: types.h:114
const T & operator*() const
Operator to access the value.
Definition: types.h:104
ValueWithDefault(const T &_value)
Initialize to the given value.
Definition: types.h:98
ptrdiff_t DenseIndex
The index type for Eigen objects.
Definition: types.h:60
ListOfOneContainer< T > ListOfOne(const T &element)
Factory function for ListOfOneContainer to enable ListOfOne(e) syntax.
Definition: types.h:132
Helper struct that encapsulates a value with a default, this is just used as a member object so you d...
Definition: types.h:91
ValueWithDefault()
Default constructor, initialize to default value supplied in template argument.
Definition: types.h:95
T & operator*()
Operator to access the value.
Definition: types.h:101
Helper class that uses templates to select between two types based on whether TEST_TYPE is const or n...
Definition: types.h:69
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:57
An object whose scope defines a block where TBB and OpenMP parallelism are mixed. ...
Definition: types.h:145
Global functions in a separate testing namespace.
Definition: chartTesting.h:28