22#include <gtsam/dllexport.h>
23#include <boost/concept/assert.hpp>
24#include <boost/range/concepts.hpp>
25#include <gtsam/config.h>
34#include <tbb/scalable_allocator.h>
37#if defined(__GNUC__) || defined(__clang__)
38#define GTSAM_DEPRECATED __attribute__((deprecated))
39#elif defined(_MSC_VER)
40#define GTSAM_DEPRECATED __declspec(deprecated)
42#define GTSAM_DEPRECATED
45#ifdef GTSAM_USE_EIGEN_MKL_OPENMP
50# define CLANG_DIAGNOSTIC_PUSH_IGNORE(diag) \
51 _Pragma("clang diagnostic push") \
52 _Pragma("clang diagnostic ignored \"" diag "\"")
54# define CLANG_DIAGNOSTIC_PUSH_IGNORE(diag)
58# define CLANG_DIAGNOSTIC_POP() _Pragma("clang diagnostic pop")
60# define CLANG_DIAGNOSTIC_POP()
66 std::string GTSAM_EXPORT
demangle(
const char* name);
69 typedef std::uint64_t
Key;
82 template<
typename TEST_TYPE,
typename BASIC_TYPE,
typename AS_NON_CONST,
88 template<
typename BASIC_TYPE,
typename AS_NON_CONST,
typename AS_CONST>
90 typedef AS_NON_CONST type;
94 template<
typename BASIC_TYPE,
typename AS_NON_CONST,
typename AS_CONST>
95 struct const_selector<const BASIC_TYPE, BASIC_TYPE, AS_NON_CONST, AS_CONST> {
96 typedef AS_CONST type;
105 template<
typename T, T defaultValue>
122 operator T()
const {
return value; }
132 typedef T value_type;
133 typedef const T* const_iterator;
136 const T* begin()
const {
return &element_; }
137 const T* end()
const {
return &element_ + 1; }
138 T* begin() {
return &element_; }
139 T* end() {
return &element_ + 1; }
140 size_t size()
const {
return 1; }
153# pragma clang diagnostic push
154# pragma clang diagnostic ignored "-Wunused-private-field"
162 int previousOpenMPThreads;
165#if defined GTSAM_USE_TBB && defined GTSAM_USE_EIGEN_MKL_OPENMP
167 previousOpenMPThreads(omp_get_num_threads())
169 omp_set_num_threads(omp_get_num_procs() / 4);
174 omp_set_num_threads(previousOpenMPThreads);
183# pragma clang diagnostic pop
192#define assert_throw(CONDITION, EXCEPTION) ((void)0)
194#define assert_throw(CONDITION, EXCEPTION) \
195 if (!(CONDITION)) { \
206#include <boost/math/special_functions/fpclassify.hpp>
208 template<
typename T>
inline int isfinite(T a) {
209 return (
int)boost::math::isfinite(a); }
210 template<
typename T>
inline int isnan(T a) {
211 return (
int)boost::math::isnan(a); }
212 template<
typename T>
inline int isinf(T a) {
213 return (
int)boost::math::isinf(a); }
218#include <boost/math/constants/constants.hpp>
220#define M_PI (boost::math::constants::pi<double>())
223#define M_PI_2 (boost::math::constants::pi<double>() / 2.0)
226#define M_PI_4 (boost::math::constants::pi<double>() / 4.0)
246 template<
typename ...>
using void_t = void;
263 template<
typename,
typename =
void_t<>>
277#define GTSAM_MAKE_ALIGNED_OPERATOR_NEW \
278 EIGEN_MAKE_ALIGNED_OPERATOR_NEW \
279 using _eigen_aligned_allocator_trait = void;
286#define GTSAM_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign) \
287 EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign) \
288 using _eigen_aligned_allocator_trait = void;
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
ListOfOneContainer< T > ListOfOne(const T &element)
Factory function for ListOfOneContainer to enable ListOfOne(e) syntax.
Definition: types.h:147
std::string demangle(const char *name)
Pretty print Value type name.
Definition: types.cpp:37
std::uint64_t FactorIndex
Integer nonlinear factor index type.
Definition: types.h:72
ptrdiff_t DenseIndex
The index type for Eigen objects.
Definition: types.h:75
void void_t
Convenience void_t as we assume C++11, it will not conflict the std one in C++17 as this is in gtsam:...
Definition: types.h:246
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:69
Helper class that uses templates to select between two types based on whether TEST_TYPE is const or n...
Definition: types.h:84
Helper struct that encapsulates a value with a default, this is just used as a member object so you d...
Definition: types.h:106
T & operator*()
Operator to access the value.
Definition: types.h:116
ValueWithDefault()
Default constructor, initialize to default value supplied in template argument.
Definition: types.h:110
ValueWithDefault(const T &_value)
Initialize to the given value.
Definition: types.h:113
A helper class that behaves as a container with one element, and works with boost::range.
Definition: types.h:129
An object whose scope defines a block where TBB and OpenMP parallelism are mixed.
Definition: types.h:161
A SFINAE trait to mark classes that need special alignment.
Definition: types.h:264