11 #ifndef EIGEN_MACROS_H 12 #define EIGEN_MACROS_H 14 #define EIGEN_WORLD_VERSION 3 15 #define EIGEN_MAJOR_VERSION 3 16 #define EIGEN_MINOR_VERSION 7 18 #define EIGEN_VERSION_AT_LEAST(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \ 19 (EIGEN_MAJOR_VERSION>y || (EIGEN_MAJOR_VERSION>=y && \ 20 EIGEN_MINOR_VERSION>=z)))) 26 #define EIGEN_COMP_GNUC 1 28 #define EIGEN_COMP_GNUC 0 32 #if defined(__clang__) 33 #define EIGEN_COMP_CLANG (__clang_major__*100+__clang_minor__) 35 #define EIGEN_COMP_CLANG 0 41 #define EIGEN_COMP_LLVM 1 43 #define EIGEN_COMP_LLVM 0 47 #if defined(__INTEL_COMPILER) 48 #define EIGEN_COMP_ICC __INTEL_COMPILER 50 #define EIGEN_COMP_ICC 0 54 #if defined(__MINGW32__) 55 #define EIGEN_COMP_MINGW 1 57 #define EIGEN_COMP_MINGW 0 61 #if defined(__SUNPRO_CC) 62 #define EIGEN_COMP_SUNCC 1 64 #define EIGEN_COMP_SUNCC 0 69 #define EIGEN_COMP_MSVC _MSC_VER 71 #define EIGEN_COMP_MSVC 0 84 #if EIGEN_COMP_MSVC && !(EIGEN_COMP_ICC || EIGEN_COMP_LLVM || EIGEN_COMP_CLANG) 85 #define EIGEN_COMP_MSVC_STRICT _MSC_VER 87 #define EIGEN_COMP_MSVC_STRICT 0 91 #if defined(__IBMCPP__) || defined(__xlc__) 92 #define EIGEN_COMP_IBM 1 94 #define EIGEN_COMP_IBM 0 99 #define EIGEN_COMP_PGI 1 101 #define EIGEN_COMP_PGI 0 105 #if defined(__CC_ARM) || defined(__ARMCC_VERSION) 106 #define EIGEN_COMP_ARM 1 108 #define EIGEN_COMP_ARM 0 112 #if defined(__EMSCRIPTEN__) 113 #define EIGEN_COMP_EMSCRIPTEN 1 115 #define EIGEN_COMP_EMSCRIPTEN 0 120 #if EIGEN_COMP_GNUC && !(EIGEN_COMP_CLANG || EIGEN_COMP_ICC || EIGEN_COMP_MINGW || EIGEN_COMP_PGI || EIGEN_COMP_IBM || EIGEN_COMP_ARM || EIGEN_COMP_EMSCRIPTEN) 121 #define EIGEN_COMP_GNUC_STRICT 1 123 #define EIGEN_COMP_GNUC_STRICT 0 128 #define EIGEN_GNUC_AT_LEAST(x,y) ((__GNUC__==x && __GNUC_MINOR__>=y) || __GNUC__>x) 129 #define EIGEN_GNUC_AT_MOST(x,y) ((__GNUC__==x && __GNUC_MINOR__<=y) || __GNUC__<x) 130 #define EIGEN_GNUC_AT(x,y) ( __GNUC__==x && __GNUC_MINOR__==y ) 132 #define EIGEN_GNUC_AT_LEAST(x,y) 0 133 #define EIGEN_GNUC_AT_MOST(x,y) 0 134 #define EIGEN_GNUC_AT(x,y) 0 138 #if EIGEN_COMP_GNUC && (__GNUC__ <= 3) 139 #define EIGEN_GCC3_OR_OLDER 1 141 #define EIGEN_GCC3_OR_OLDER 0 147 #if defined(__x86_64__) || defined(_M_X64) || defined(__amd64) 148 #define EIGEN_ARCH_x86_64 1 150 #define EIGEN_ARCH_x86_64 0 153 #if defined(__i386__) || defined(_M_IX86) || defined(_X86_) || defined(__i386) 154 #define EIGEN_ARCH_i386 1 156 #define EIGEN_ARCH_i386 0 159 #if EIGEN_ARCH_x86_64 || EIGEN_ARCH_i386 160 #define EIGEN_ARCH_i386_OR_x86_64 1 162 #define EIGEN_ARCH_i386_OR_x86_64 0 167 #define EIGEN_ARCH_ARM 1 169 #define EIGEN_ARCH_ARM 0 173 #if defined(__aarch64__) 174 #define EIGEN_ARCH_ARM64 1 176 #define EIGEN_ARCH_ARM64 0 179 #if EIGEN_ARCH_ARM || EIGEN_ARCH_ARM64 180 #define EIGEN_ARCH_ARM_OR_ARM64 1 182 #define EIGEN_ARCH_ARM_OR_ARM64 0 186 #if defined(__mips__) || defined(__mips) 187 #define EIGEN_ARCH_MIPS 1 189 #define EIGEN_ARCH_MIPS 0 193 #if defined(__sparc__) || defined(__sparc) 194 #define EIGEN_ARCH_SPARC 1 196 #define EIGEN_ARCH_SPARC 0 200 #if defined(__ia64__) 201 #define EIGEN_ARCH_IA64 1 203 #define EIGEN_ARCH_IA64 0 207 #if defined(__powerpc__) || defined(__ppc__) || defined(_M_PPC) 208 #define EIGEN_ARCH_PPC 1 210 #define EIGEN_ARCH_PPC 0 218 #if defined(__unix__) || defined(__unix) 219 #define EIGEN_OS_UNIX 1 221 #define EIGEN_OS_UNIX 0 225 #if defined(__linux__) 226 #define EIGEN_OS_LINUX 1 228 #define EIGEN_OS_LINUX 0 233 #if defined(__ANDROID__) || defined(ANDROID) 234 #define EIGEN_OS_ANDROID 1 236 #define EIGEN_OS_ANDROID 0 240 #if defined(__gnu_linux__) && !(EIGEN_OS_ANDROID) 241 #define EIGEN_OS_GNULINUX 1 243 #define EIGEN_OS_GNULINUX 0 247 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) 248 #define EIGEN_OS_BSD 1 250 #define EIGEN_OS_BSD 0 254 #if defined(__APPLE__) 255 #define EIGEN_OS_MAC 1 257 #define EIGEN_OS_MAC 0 262 #define EIGEN_OS_QNX 1 264 #define EIGEN_OS_QNX 0 269 #define EIGEN_OS_WIN 1 271 #define EIGEN_OS_WIN 0 276 #define EIGEN_OS_WIN64 1 278 #define EIGEN_OS_WIN64 0 282 #if defined(_WIN32_WCE) 283 #define EIGEN_OS_WINCE 1 285 #define EIGEN_OS_WINCE 0 289 #if defined(__CYGWIN__) 290 #define EIGEN_OS_CYGWIN 1 292 #define EIGEN_OS_CYGWIN 0 296 #if EIGEN_OS_WIN && !( EIGEN_OS_WINCE || EIGEN_OS_CYGWIN ) 297 #define EIGEN_OS_WIN_STRICT 1 299 #define EIGEN_OS_WIN_STRICT 0 303 #if (defined(sun) || defined(__sun)) && !(defined(__SVR4) || defined(__svr4__)) 304 #define EIGEN_OS_SUN 1 306 #define EIGEN_OS_SUN 0 310 #if (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__)) 311 #define EIGEN_OS_SOLARIS 1 313 #define EIGEN_OS_SOLARIS 0 318 #if EIGEN_GNUC_AT_MOST(4,3) && !EIGEN_COMP_CLANG 320 #define EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO 0 322 #define EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO 1 327 #define EIGEN_NOT_A_MACRO 329 #ifdef EIGEN_DEFAULT_TO_ROW_MAJOR 330 #define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION Eigen::RowMajor 332 #define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION Eigen::ColMajor 335 #ifndef EIGEN_DEFAULT_DENSE_INDEX_TYPE 336 #define EIGEN_DEFAULT_DENSE_INDEX_TYPE std::ptrdiff_t 341 # define EIGEN_HAS_BUILTIN(x) __has_builtin(x) 343 # define EIGEN_HAS_BUILTIN(x) 0 348 #ifndef __has_feature 349 # define __has_feature(x) 0 355 #ifndef EIGEN_MAX_CPP_VER 356 #define EIGEN_MAX_CPP_VER 99 359 #if EIGEN_MAX_CPP_VER>=11 && (defined(__cplusplus) && (__cplusplus >= 201103L) || EIGEN_COMP_MSVC >= 1900) 360 #define EIGEN_HAS_CXX11 1 362 #define EIGEN_HAS_CXX11 0 367 #ifndef EIGEN_HAS_RVALUE_REFERENCES 368 #if EIGEN_MAX_CPP_VER>=11 && \ 369 (__has_feature(cxx_rvalue_references) || \ 370 (defined(__cplusplus) && __cplusplus >= 201103L) || \ 371 (EIGEN_COMP_MSVC >= 1600)) 372 #define EIGEN_HAS_RVALUE_REFERENCES 1 374 #define EIGEN_HAS_RVALUE_REFERENCES 0 379 #ifndef EIGEN_HAS_C99_MATH 380 #if EIGEN_MAX_CPP_VER>=11 && \ 381 ((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) \ 382 || (defined(__GNUC__) && defined(_GLIBCXX_USE_C99)) \ 383 || (defined(_LIBCPP_VERSION) && !defined(_MSC_VER))) 384 #define EIGEN_HAS_C99_MATH 1 386 #define EIGEN_HAS_C99_MATH 0 391 #ifndef EIGEN_HAS_STD_RESULT_OF 392 #if EIGEN_MAX_CPP_VER>=11 && ((__has_feature(cxx_lambdas) || (defined(__cplusplus) && __cplusplus >= 201103L))) 393 #define EIGEN_HAS_STD_RESULT_OF 1 395 #define EIGEN_HAS_STD_RESULT_OF 0 400 #ifndef EIGEN_HAS_VARIADIC_TEMPLATES 401 #if EIGEN_MAX_CPP_VER>=11 && (__cplusplus > 199711L || EIGEN_COMP_MSVC >= 1900) \ 402 && (!defined(__NVCC__) || !EIGEN_ARCH_ARM_OR_ARM64 || (EIGEN_CUDACC_VER >= 80000) ) 405 #define EIGEN_HAS_VARIADIC_TEMPLATES 1 407 #define EIGEN_HAS_VARIADIC_TEMPLATES 0 412 #ifndef EIGEN_HAS_CONSTEXPR 416 #if EIGEN_MAX_CPP_VER>=14 && (__cplusplus > 199711L && (EIGEN_COMP_CLANG || EIGEN_CUDACC_VER >= 70500)) 417 #define EIGEN_HAS_CONSTEXPR 1 419 #elif EIGEN_MAX_CPP_VER>=14 && (__has_feature(cxx_relaxed_constexpr) || (defined(__cplusplus) && __cplusplus >= 201402L) || \ 420 (EIGEN_GNUC_AT_LEAST(4,8) && (__cplusplus > 199711L))) 421 #define EIGEN_HAS_CONSTEXPR 1 424 #ifndef EIGEN_HAS_CONSTEXPR 425 #define EIGEN_HAS_CONSTEXPR 0 432 #ifndef EIGEN_HAS_CXX11_MATH 433 #if EIGEN_MAX_CPP_VER>=11 && ((__cplusplus > 201103L) || (__cplusplus >= 201103L) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC || EIGEN_COMP_ICC) \ 434 && (EIGEN_ARCH_i386_OR_x86_64) && (EIGEN_OS_GNULINUX || EIGEN_OS_WIN_STRICT || EIGEN_OS_MAC)) 435 #define EIGEN_HAS_CXX11_MATH 1 437 #define EIGEN_HAS_CXX11_MATH 0 442 #ifndef EIGEN_HAS_CXX11_CONTAINERS 443 #if EIGEN_MAX_CPP_VER>=11 && \ 444 ((__cplusplus > 201103L) \ 445 || ((__cplusplus >= 201103L) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_ICC>=1400)) \ 446 || EIGEN_COMP_MSVC >= 1900) 447 #define EIGEN_HAS_CXX11_CONTAINERS 1 449 #define EIGEN_HAS_CXX11_CONTAINERS 0 454 #ifndef EIGEN_HAS_CXX11_NOEXCEPT 455 #if EIGEN_MAX_CPP_VER>=11 && \ 456 (__has_feature(cxx_noexcept) \ 457 || (__cplusplus > 201103L) \ 458 || ((__cplusplus >= 201103L) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_ICC>=1400)) \ 459 || EIGEN_COMP_MSVC >= 1900) 460 #define EIGEN_HAS_CXX11_NOEXCEPT 1 462 #define EIGEN_HAS_CXX11_NOEXCEPT 0 471 #ifndef EIGEN_FAST_MATH 472 #define EIGEN_FAST_MATH 1 475 #define EIGEN_DEBUG_VAR(x) std::cerr << #x << " = " << x << std::endl; 478 #define EIGEN_CAT2(a,b) a ## b 479 #define EIGEN_CAT(a,b) EIGEN_CAT2(a,b) 481 #define EIGEN_COMMA , 484 #define EIGEN_MAKESTRING2(a) #a 485 #define EIGEN_MAKESTRING(a) EIGEN_MAKESTRING2(a) 490 #ifndef EIGEN_STRONG_INLINE 491 #if EIGEN_COMP_MSVC || EIGEN_COMP_ICC 492 #define EIGEN_STRONG_INLINE __forceinline 494 #define EIGEN_STRONG_INLINE inline 506 #if EIGEN_GNUC_AT_LEAST(4,2) 507 #define EIGEN_ALWAYS_INLINE __attribute__((always_inline)) inline 509 #define EIGEN_ALWAYS_INLINE EIGEN_STRONG_INLINE 513 #define EIGEN_DONT_INLINE __attribute__((noinline)) 514 #elif EIGEN_COMP_MSVC 515 #define EIGEN_DONT_INLINE __declspec(noinline) 517 #define EIGEN_DONT_INLINE 521 #define EIGEN_PERMISSIVE_EXPR __extension__ 523 #define EIGEN_PERMISSIVE_EXPR 530 #define EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS 531 #define EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS inline 534 # ifndef EIGEN_NO_DEBUG 535 # define EIGEN_NO_DEBUG 540 #ifdef EIGEN_NO_DEBUG 541 #define eigen_plain_assert(x) 543 #if EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO 549 #define eigen_plain_assert(x) assert(x) 562 inline void assert_fail(
const char *condition,
const char *
function,
const char *
file,
int line)
564 std::cerr <<
"assertion failed: " << condition <<
" in function " <<
function <<
" at " << file <<
":" << line << std::endl;
569 #define eigen_plain_assert(x) \ 571 if(!Eigen::internal::copy_bool(x)) \ 572 Eigen::internal::assert_fail(EIGEN_MAKESTRING(x), __PRETTY_FUNCTION__, __FILE__, __LINE__); \ 579 #define eigen_assert(x) eigen_plain_assert(x) 582 #ifdef EIGEN_INTERNAL_DEBUGGING 583 #define eigen_internal_assert(x) eigen_assert(x) 585 #define eigen_internal_assert(x) 588 #ifdef EIGEN_NO_DEBUG 589 #define EIGEN_ONLY_USED_FOR_DEBUG(x) EIGEN_UNUSED_VARIABLE(x) 591 #define EIGEN_ONLY_USED_FOR_DEBUG(x) 594 #ifndef EIGEN_NO_DEPRECATED_WARNING 596 #define EIGEN_DEPRECATED __attribute__((deprecated)) 597 #elif EIGEN_COMP_MSVC 598 #define EIGEN_DEPRECATED __declspec(deprecated) 600 #define EIGEN_DEPRECATED 603 #define EIGEN_DEPRECATED 607 #define EIGEN_UNUSED __attribute__((unused)) 618 #define EIGEN_UNUSED_VARIABLE(var) Eigen::internal::ignore_unused_variable(var); 620 #if !defined(EIGEN_ASM_COMMENT) 621 #if EIGEN_COMP_GNUC && (EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM_OR_ARM64) 622 #define EIGEN_ASM_COMMENT(X) __asm__("#" X) 624 #define EIGEN_ASM_COMMENT(X) 649 #if (defined __CUDACC__) 650 #define EIGEN_ALIGN_TO_BOUNDARY(n) __align__(n) 651 #elif EIGEN_COMP_GNUC || EIGEN_COMP_PGI || EIGEN_COMP_IBM || EIGEN_COMP_ARM 652 #define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n))) 653 #elif EIGEN_COMP_MSVC 654 #define EIGEN_ALIGN_TO_BOUNDARY(n) __declspec(align(n)) 655 #elif EIGEN_COMP_SUNCC 657 #define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n))) 659 #error Please tell me what is the equivalent of __attribute__((aligned(n))) for your compiler 663 #if defined(EIGEN_DONT_VECTORIZE) 664 #define EIGEN_IDEAL_MAX_ALIGN_BYTES 0 665 #elif defined(EIGEN_VECTORIZE_AVX512) 667 #define EIGEN_IDEAL_MAX_ALIGN_BYTES 64 668 #elif defined(__AVX__) 670 #define EIGEN_IDEAL_MAX_ALIGN_BYTES 32 672 #define EIGEN_IDEAL_MAX_ALIGN_BYTES 16 677 #define EIGEN_MIN_ALIGN_BYTES 16 683 #if (defined(EIGEN_DONT_ALIGN_STATICALLY) || defined(EIGEN_DONT_ALIGN)) && defined(EIGEN_MAX_STATIC_ALIGN_BYTES) && EIGEN_MAX_STATIC_ALIGN_BYTES>0 684 #error EIGEN_MAX_STATIC_ALIGN_BYTES and EIGEN_DONT_ALIGN[_STATICALLY] are both defined with EIGEN_MAX_STATIC_ALIGN_BYTES!=0. Use EIGEN_MAX_STATIC_ALIGN_BYTES=0 as a synonym of EIGEN_DONT_ALIGN_STATICALLY. 689 #if defined(EIGEN_DONT_ALIGN_STATICALLY) || defined(EIGEN_DONT_ALIGN) 690 #ifdef EIGEN_MAX_STATIC_ALIGN_BYTES 691 #undef EIGEN_MAX_STATIC_ALIGN_BYTES 693 #define EIGEN_MAX_STATIC_ALIGN_BYTES 0 696 #ifndef EIGEN_MAX_STATIC_ALIGN_BYTES 706 #if EIGEN_COMP_GNUC && !(EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM_OR_ARM64 || EIGEN_ARCH_PPC || EIGEN_ARCH_IA64) 707 #define EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT 1 708 #elif EIGEN_ARCH_ARM_OR_ARM64 && EIGEN_COMP_GNUC_STRICT && EIGEN_GNUC_AT_MOST(4, 6) 712 #define EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT 1 714 #define EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT 0 718 #if !EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT \ 719 && !EIGEN_GCC3_OR_OLDER \ 720 && !EIGEN_COMP_SUNCC \ 722 #define EIGEN_ARCH_WANTS_STACK_ALIGNMENT 1 724 #define EIGEN_ARCH_WANTS_STACK_ALIGNMENT 0 727 #if EIGEN_ARCH_WANTS_STACK_ALIGNMENT 728 #define EIGEN_MAX_STATIC_ALIGN_BYTES EIGEN_IDEAL_MAX_ALIGN_BYTES 730 #define EIGEN_MAX_STATIC_ALIGN_BYTES 0 736 #if defined(EIGEN_MAX_ALIGN_BYTES) && EIGEN_MAX_ALIGN_BYTES<EIGEN_MAX_STATIC_ALIGN_BYTES 737 #undef EIGEN_MAX_STATIC_ALIGN_BYTES 738 #define EIGEN_MAX_STATIC_ALIGN_BYTES EIGEN_MAX_ALIGN_BYTES 741 #if EIGEN_MAX_STATIC_ALIGN_BYTES==0 && !defined(EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT) 742 #define EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT 752 #define EIGEN_ALIGN8 EIGEN_ALIGN_TO_BOUNDARY(8) 753 #define EIGEN_ALIGN16 EIGEN_ALIGN_TO_BOUNDARY(16) 754 #define EIGEN_ALIGN32 EIGEN_ALIGN_TO_BOUNDARY(32) 755 #define EIGEN_ALIGN64 EIGEN_ALIGN_TO_BOUNDARY(64) 756 #if EIGEN_MAX_STATIC_ALIGN_BYTES>0 757 #define EIGEN_ALIGN_MAX EIGEN_ALIGN_TO_BOUNDARY(EIGEN_MAX_STATIC_ALIGN_BYTES) 759 #define EIGEN_ALIGN_MAX 765 #if defined(EIGEN_DONT_ALIGN) && defined(EIGEN_MAX_ALIGN_BYTES) && EIGEN_MAX_ALIGN_BYTES>0 766 #error EIGEN_MAX_ALIGN_BYTES and EIGEN_DONT_ALIGN are both defined with EIGEN_MAX_ALIGN_BYTES!=0. Use EIGEN_MAX_ALIGN_BYTES=0 as a synonym of EIGEN_DONT_ALIGN. 769 #ifdef EIGEN_DONT_ALIGN 770 #ifdef EIGEN_MAX_ALIGN_BYTES 771 #undef EIGEN_MAX_ALIGN_BYTES 773 #define EIGEN_MAX_ALIGN_BYTES 0 774 #elif !defined(EIGEN_MAX_ALIGN_BYTES) 775 #define EIGEN_MAX_ALIGN_BYTES EIGEN_IDEAL_MAX_ALIGN_BYTES 778 #if EIGEN_IDEAL_MAX_ALIGN_BYTES > EIGEN_MAX_ALIGN_BYTES 779 #define EIGEN_DEFAULT_ALIGN_BYTES EIGEN_IDEAL_MAX_ALIGN_BYTES 781 #define EIGEN_DEFAULT_ALIGN_BYTES EIGEN_MAX_ALIGN_BYTES 785 #ifndef EIGEN_UNALIGNED_VECTORIZE 786 #define EIGEN_UNALIGNED_VECTORIZE 1 792 #ifdef EIGEN_DONT_USE_RESTRICT_KEYWORD 793 #define EIGEN_RESTRICT 795 #ifndef EIGEN_RESTRICT 796 #define EIGEN_RESTRICT __restrict 799 #ifndef EIGEN_STACK_ALLOCATION_LIMIT 801 #define EIGEN_STACK_ALLOCATION_LIMIT 131072 804 #ifndef EIGEN_DEFAULT_IO_FORMAT 805 #ifdef EIGEN_MAKING_DOCS 808 #define EIGEN_DEFAULT_IO_FORMAT Eigen::IOFormat(3, 0, " ", "\n", "", "") 810 #define EIGEN_DEFAULT_IO_FORMAT Eigen::IOFormat() 817 #if EIGEN_COMP_MSVC_STRICT && (EIGEN_COMP_MSVC < 1900 || EIGEN_CUDACC_VER>0) 819 #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \ 820 using Base::operator =; 821 #elif EIGEN_COMP_CLANG // workaround clang bug (see http://forum.kde.org/viewtopic.php?f=74&t=102653) 822 #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \ 823 using Base::operator =; \ 824 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) { Base::operator=(other); return *this; } \ 825 template <typename OtherDerived> \ 826 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const DenseBase<OtherDerived>& other) { Base::operator=(other.derived()); return *this; } 828 #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \ 829 using Base::operator =; \ 830 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) \ 832 Base::operator=(other); \ 842 #define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived) EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) 852 #define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) \ 853 typedef typename Eigen::internal::traits<Derived>::Scalar Scalar; \ 854 typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; \ 855 typedef typename Base::CoeffReturnType CoeffReturnType; \ 856 typedef typename Eigen::internal::ref_selector<Derived>::type Nested; \ 857 typedef typename Eigen::internal::traits<Derived>::StorageKind StorageKind; \ 858 typedef typename Eigen::internal::traits<Derived>::StorageIndex StorageIndex; \ 859 enum { RowsAtCompileTime = Eigen::internal::traits<Derived>::RowsAtCompileTime, \ 860 ColsAtCompileTime = Eigen::internal::traits<Derived>::ColsAtCompileTime, \ 861 Flags = Eigen::internal::traits<Derived>::Flags, \ 862 SizeAtCompileTime = Base::SizeAtCompileTime, \ 863 MaxSizeAtCompileTime = Base::MaxSizeAtCompileTime, \ 864 IsVectorAtCompileTime = Base::IsVectorAtCompileTime }; \ 865 using Base::derived; \ 866 using Base::const_cast_derived; 870 #define EIGEN_DENSE_PUBLIC_INTERFACE(Derived) \ 871 EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) \ 872 typedef typename Base::PacketScalar PacketScalar; 875 #define EIGEN_PLAIN_ENUM_MIN(a,b) (((int)a <= (int)b) ? (int)a : (int)b) 876 #define EIGEN_PLAIN_ENUM_MAX(a,b) (((int)a >= (int)b) ? (int)a : (int)b) 881 #define EIGEN_SIZE_MIN_PREFER_DYNAMIC(a,b) (((int)a == 0 || (int)b == 0) ? 0 \ 882 : ((int)a == 1 || (int)b == 1) ? 1 \ 883 : ((int)a == Dynamic || (int)b == Dynamic) ? Dynamic \ 884 : ((int)a <= (int)b) ? (int)a : (int)b) 889 #define EIGEN_SIZE_MIN_PREFER_FIXED(a,b) (((int)a == 0 || (int)b == 0) ? 0 \ 890 : ((int)a == 1 || (int)b == 1) ? 1 \ 891 : ((int)a == Dynamic && (int)b == Dynamic) ? Dynamic \ 892 : ((int)a == Dynamic) ? (int)b \ 893 : ((int)b == Dynamic) ? (int)a \ 894 : ((int)a <= (int)b) ? (int)a : (int)b) 897 #define EIGEN_SIZE_MAX(a,b) (((int)a == Dynamic || (int)b == Dynamic) ? Dynamic \ 898 : ((int)a >= (int)b) ? (int)a : (int)b) 900 #define EIGEN_LOGICAL_XOR(a,b) (((a) || (b)) && !((a) && (b))) 902 #define EIGEN_IMPLIES(a,b) (!(a) || (b)) 905 #define EIGEN_CWISE_BINARY_RETURN_TYPE(LHS,RHS,OPNAME) \ 907 EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)< \ 908 typename internal::traits<LHS>::Scalar, \ 909 typename internal::traits<RHS>::Scalar \ 915 #define EIGEN_MAKE_CWISE_BINARY_OP(METHOD,OPNAME) \ 916 template<typename OtherDerived> \ 917 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE(Derived,OtherDerived,OPNAME) \ 918 (METHOD)(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const \ 920 return EIGEN_CWISE_BINARY_RETURN_TYPE(Derived,OtherDerived,OPNAME)(derived(), other.derived()); \ 923 #define EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,TYPEA,TYPEB) \ 924 (Eigen::internal::has_ReturnType<Eigen::ScalarBinaryOpTraits<TYPEA,TYPEB,EIGEN_CAT(EIGEN_CAT(Eigen::internal::scalar_,OPNAME),_op)<TYPEA,TYPEB> > >::value) 926 #define EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(EXPR,SCALAR,OPNAME) \ 927 CwiseBinaryOp<EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)<typename internal::traits<EXPR>::Scalar,SCALAR>, const EXPR, \ 928 const typename internal::plain_constant_type<EXPR,SCALAR>::type> 930 #define EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(SCALAR,EXPR,OPNAME) \ 931 CwiseBinaryOp<EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)<SCALAR,typename internal::traits<EXPR>::Scalar>, \ 932 const typename internal::plain_constant_type<EXPR,SCALAR>::type, const EXPR> 935 #if EIGEN_COMP_MSVC_STRICT<=1600 936 #define EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(X) typename internal::enable_if<true,X>::type 938 #define EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(X) X 941 #define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(METHOD,OPNAME) \ 942 template <typename T> EIGEN_DEVICE_FUNC inline \ 943 EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Derived,typename internal::promote_scalar_arg<Scalar EIGEN_COMMA T EIGEN_COMMA EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,Scalar,T)>::type,OPNAME))\ 944 (METHOD)(const T& scalar) const { \ 945 typedef typename internal::promote_scalar_arg<Scalar,T,EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,Scalar,T)>::type PromotedT; \ 946 return EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Derived,PromotedT,OPNAME)(derived(), \ 947 typename internal::plain_constant_type<Derived,PromotedT>::type(derived().rows(), derived().cols(), internal::scalar_constant_op<PromotedT>(scalar))); \ 950 #define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHELEFT(METHOD,OPNAME) \ 951 template <typename T> EIGEN_DEVICE_FUNC inline friend \ 952 EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(const EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(typename internal::promote_scalar_arg<Scalar EIGEN_COMMA T EIGEN_COMMA EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,T,Scalar)>::type,Derived,OPNAME)) \ 953 (METHOD)(const T& scalar, const StorageBaseType& matrix) { \ 954 typedef typename internal::promote_scalar_arg<Scalar,T,EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,T,Scalar)>::type PromotedT; \ 955 return EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(PromotedT,Derived,OPNAME)( \ 956 typename internal::plain_constant_type<Derived,PromotedT>::type(matrix.derived().rows(), matrix.derived().cols(), internal::scalar_constant_op<PromotedT>(scalar)), matrix.derived()); \ 959 #define EIGEN_MAKE_SCALAR_BINARY_OP(METHOD,OPNAME) \ 960 EIGEN_MAKE_SCALAR_BINARY_OP_ONTHELEFT(METHOD,OPNAME) \ 961 EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(METHOD,OPNAME) 964 #ifdef EIGEN_EXCEPTIONS 965 # define EIGEN_THROW_X(X) throw X 966 # define EIGEN_THROW throw 967 # define EIGEN_TRY try 968 # define EIGEN_CATCH(X) catch (X) 970 # ifdef __CUDA_ARCH__ 971 # define EIGEN_THROW_X(X) asm("trap;") 972 # define EIGEN_THROW asm("trap;") 974 # define EIGEN_THROW_X(X) std::abort() 975 # define EIGEN_THROW std::abort() 977 # define EIGEN_TRY if (true) 978 # define EIGEN_CATCH(X) else 982 #if EIGEN_HAS_CXX11_NOEXCEPT 983 # define EIGEN_INCLUDE_TYPE_TRAITS 984 # define EIGEN_NOEXCEPT noexcept 985 # define EIGEN_NOEXCEPT_IF(x) noexcept(x) 986 # define EIGEN_NO_THROW noexcept(true) 987 # define EIGEN_EXCEPTION_SPEC(X) noexcept(false) 989 # define EIGEN_NOEXCEPT 990 # define EIGEN_NOEXCEPT_IF(x) 991 # define EIGEN_NO_THROW throw() 995 # define EIGEN_EXCEPTION_SPEC(X) throw() 997 # define EIGEN_EXCEPTION_SPEC(X) throw(X) 1001 #endif // EIGEN_MACROS_H
Namespace containing all symbols from the Eigen library.
#define EIGEN_DONT_INLINE
EIGEN_DEVICE_FUNC void ignore_unused_variable(const T &)
A small structure to hold a non zero as a triplet (i,j,value).