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
59#define DO_PRAGMA(x) _Pragma (#x)
61# define CLANG_DIAGNOSTIC_PUSH_IGNORE(diag) \
62 _Pragma("clang diagnostic push") \
63 DO_PRAGMA(clang diagnostic ignored diag)
65# define CLANG_DIAGNOSTIC_PUSH_IGNORE(diag)
69# define GCC_DIAGNOSTIC_PUSH_IGNORE(diag) \
70 _Pragma("GCC diagnostic push") \
71 DO_PRAGMA(GCC diagnostic ignored diag)
73# define GCC_DIAGNOSTIC_PUSH_IGNORE(diag)
77# define MSVC_DIAGNOSTIC_PUSH_IGNORE(code) \
78 _Pragma("warning ( push )") \
79 DO_PRAGMA(warning ( disable : code ))
81# define MSVC_DIAGNOSTIC_PUSH_IGNORE(code)
85# define DIAGNOSTIC_POP() _Pragma("clang diagnostic pop")
86#elif defined(__GNUC__)
87# define DIAGNOSTIC_POP() _Pragma("GCC diagnostic pop")
88#elif defined(_MSC_VER)
89# define DIAGNOSTIC_POP() _Pragma("warning ( pop )")
91# define DIAGNOSTIC_POP()
97 std::string GTSAM_EXPORT
demangle(
const char* name);
100 typedef std::uint64_t
Key;
113 template<
typename TEST_TYPE,
typename BASIC_TYPE,
typename AS_NON_CONST,
119 template<
typename BASIC_TYPE,
typename AS_NON_CONST,
typename AS_CONST>
121 typedef AS_NON_CONST type;
125 template<
typename BASIC_TYPE,
typename AS_NON_CONST,
typename AS_CONST>
127 typedef AS_CONST type;
136 template<
typename T, T defaultValue>
153 operator T()
const {
return value; }
163 typedef T value_type;
164 typedef const T* const_iterator;
167 const T* begin()
const {
return &element_; }
168 const T* end()
const {
return &element_ + 1; }
169 T* begin() {
return &element_; }
170 T* end() {
return &element_ + 1; }
171 size_t size()
const {
return 1; }
184# pragma clang diagnostic push
185# pragma clang diagnostic ignored "-Wunused-private-field"
193 int previousOpenMPThreads;
196#if defined GTSAM_USE_TBB && defined GTSAM_USE_EIGEN_MKL_OPENMP
198 previousOpenMPThreads(omp_get_num_threads())
200 omp_set_num_threads(omp_get_num_procs() / 4);
205 omp_set_num_threads(previousOpenMPThreads);
214# pragma clang diagnostic pop
223#define assert_throw(CONDITION, EXCEPTION) ((void)0)
225#define assert_throw(CONDITION, EXCEPTION) \
226 if (!(CONDITION)) { \
237#include <boost/math/special_functions/fpclassify.hpp>
239 template<
typename T>
inline int isfinite(T a) {
240 return (
int)boost::math::isfinite(a); }
241 template<
typename T>
inline int isnan(T a) {
242 return (
int)boost::math::isnan(a); }
243 template<
typename T>
inline int isinf(T a) {
244 return (
int)boost::math::isinf(a); }
249#include <boost/math/constants/constants.hpp>
251#define M_PI (boost::math::constants::pi<double>())
254#define M_PI_2 (boost::math::constants::pi<double>() / 2.0)
257#define M_PI_4 (boost::math::constants::pi<double>() / 4.0)
277 template<
typename ...>
using void_t = void;
294 template<
typename,
typename =
void_t<>>
308#define GTSAM_MAKE_ALIGNED_OPERATOR_NEW \
309 EIGEN_MAKE_ALIGNED_OPERATOR_NEW \
310 using _eigen_aligned_allocator_trait = void;
317#define GTSAM_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign) \
318 EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign) \
319 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:178
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:103
ptrdiff_t DenseIndex
The index type for Eigen objects.
Definition types.h:106
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:277
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:100
Helper class that uses templates to select between two types based on whether TEST_TYPE is const or n...
Definition types.h:115
Helper struct that encapsulates a value with a default, this is just used as a member object so you d...
Definition types.h:137
T & operator*()
Operator to access the value.
Definition types.h:147
const T & operator*() const
Operator to access the value.
Definition types.h:150
ValueWithDefault()
Default constructor, initialize to default value supplied in template argument.
Definition types.h:141
ValueWithDefault(const T &_value)
Initialize to the given value.
Definition types.h:144
A helper class that behaves as a container with one element, and works with boost::range.
Definition types.h:160
An object whose scope defines a block where TBB and OpenMP parallelism are mixed.
Definition types.h:192
A SFINAE trait to mark classes that need special alignment.
Definition types.h:295