22 #include <gtsam/dllexport.h> 23 #ifdef GTSAM_USE_BOOST_FEATURES 24 #include <boost/concept/assert.hpp> 25 #include <boost/range/concepts.hpp> 27 #include <gtsam/config.h> 36 #include <tbb/scalable_allocator.h> 39 #if defined(__GNUC__) || defined(__clang__) 40 #define GTSAM_DEPRECATED __attribute__((deprecated)) 41 #elif defined(_MSC_VER) 42 #define GTSAM_DEPRECATED __declspec(deprecated) 44 #define GTSAM_DEPRECATED 47 #ifdef GTSAM_USE_EIGEN_MKL_OPENMP 61 #define DO_PRAGMA(x) _Pragma (#x) 63 # define CLANG_DIAGNOSTIC_PUSH_IGNORE(diag) \ 64 _Pragma("clang diagnostic push") \ 65 DO_PRAGMA(clang diagnostic ignored diag) 67 # define CLANG_DIAGNOSTIC_PUSH_IGNORE(diag) 71 # define GCC_DIAGNOSTIC_PUSH_IGNORE(diag) \ 72 _Pragma("GCC diagnostic push") \ 73 DO_PRAGMA(GCC diagnostic ignored diag) 75 # define GCC_DIAGNOSTIC_PUSH_IGNORE(diag) 79 # define MSVC_DIAGNOSTIC_PUSH_IGNORE(code) \ 80 _Pragma("warning ( push )") \ 81 DO_PRAGMA(warning ( disable : code )) 83 # define MSVC_DIAGNOSTIC_PUSH_IGNORE(code) 86 #if defined(__clang__) 87 # define DIAGNOSTIC_POP() _Pragma("clang diagnostic pop") 88 #elif defined(__GNUC__) 89 # define DIAGNOSTIC_POP() _Pragma("GCC diagnostic pop") 90 #elif defined(_MSC_VER) 91 # define DIAGNOSTIC_POP() _Pragma("warning ( pop )") 93 # define DIAGNOSTIC_POP() 99 std::string GTSAM_EXPORT
demangle(
const char* name);
102 typedef std::uint64_t
Key;
115 template<
typename TEST_TYPE,
typename BASIC_TYPE,
typename AS_NON_CONST,
121 template<
typename BASIC_TYPE,
typename AS_NON_CONST,
typename AS_CONST>
123 typedef AS_NON_CONST type;
127 template<
typename BASIC_TYPE,
typename AS_NON_CONST,
typename AS_CONST>
129 typedef AS_CONST type;
138 template<
typename T, T defaultValue>
155 operator T()
const {
return value; }
160 # pragma clang diagnostic push 161 # pragma clang diagnostic ignored "-Wunused-private-field" // Clang complains that previousOpenMPThreads is unused in the #else case below 169 int previousOpenMPThreads;
172 #if defined GTSAM_USE_TBB && defined GTSAM_USE_EIGEN_MKL_OPENMP 174 previousOpenMPThreads(omp_get_num_threads())
176 omp_set_num_threads(omp_get_num_procs() / 4);
181 omp_set_num_threads(previousOpenMPThreads);
190 # pragma clang diagnostic pop 199 #define assert_throw(CONDITION, EXCEPTION) ((void)0) 201 #define assert_throw(CONDITION, EXCEPTION) \ 202 if (!(CONDITION)) { \ 211 #if (_MSC_VER < 1800) 215 template<
typename T>
inline int isfinite(T a) {
216 return (
int)std::isfinite(a); }
217 template<
typename T>
inline int isnan(T a) {
218 return (
int)std::isnan(a); }
219 template<
typename T>
inline int isinf(T a) {
220 return (
int)std::isinf(a); }
227 #define M_PI (3.14159265358979323846) 230 #define M_PI_2 (M_PI / 2.0) 233 #define M_PI_4 (M_PI / 4.0) 253 template<
typename ...>
using void_t = void;
270 template<
typename,
typename =
void_t<>>
284 #define GTSAM_MAKE_ALIGNED_OPERATOR_NEW \ 285 EIGEN_MAKE_ALIGNED_OPERATOR_NEW \ 286 using _eigen_aligned_allocator_trait = void; 293 #define GTSAM_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign) \ 294 EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign) \ 295 using _eigen_aligned_allocator_trait = void;
ptrdiff_t DenseIndex
The index type for Eigen objects.
Definition: types.h:108
std::string GTSAM_EXPORT demangle(const char *name)
Function to demangle type name of variable, e.g. demangle(typeid(x).name())
T & operator*()
Definition: types.h:149
Definition: chartTesting.h:28
ValueWithDefault(const T &_value)
Definition: types.h:146
const T & operator*() const
Definition: types.h:152
ValueWithDefault()
Definition: types.h:143
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:253
std::uint64_t FactorIndex
Integer nonlinear factor index type.
Definition: types.h:105
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102