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 4 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 || (defined __CUDACC_VER__ && __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 && defined(__CUDACC_VER__) && (EIGEN_COMP_CLANG || __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 #if EIGEN_COMP_MSVC || EIGEN_COMP_ICC 491 #define EIGEN_STRONG_INLINE __forceinline 493 #define EIGEN_STRONG_INLINE inline 504 #if EIGEN_GNUC_AT_LEAST(4,2) 505 #define EIGEN_ALWAYS_INLINE __attribute__((always_inline)) inline 507 #define EIGEN_ALWAYS_INLINE EIGEN_STRONG_INLINE 511 #define EIGEN_DONT_INLINE __attribute__((noinline)) 512 #elif EIGEN_COMP_MSVC 513 #define EIGEN_DONT_INLINE __declspec(noinline) 515 #define EIGEN_DONT_INLINE 519 #define EIGEN_PERMISSIVE_EXPR __extension__ 521 #define EIGEN_PERMISSIVE_EXPR 528 #define EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS 529 #define EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS inline 532 # ifndef EIGEN_NO_DEBUG 533 # define EIGEN_NO_DEBUG 538 #ifdef EIGEN_NO_DEBUG 539 #define eigen_plain_assert(x) 541 #if EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO 547 #define eigen_plain_assert(x) assert(x) 560 inline void assert_fail(
const char *condition,
const char *
function,
const char *file,
int line)
562 std::cerr <<
"assertion failed: " << condition <<
" in function " <<
function <<
" at " << file <<
":" << line << std::endl;
567 #define eigen_plain_assert(x) \ 569 if(!Eigen::internal::copy_bool(x)) \ 570 Eigen::internal::assert_fail(EIGEN_MAKESTRING(x), __PRETTY_FUNCTION__, __FILE__, __LINE__); \ 577 #define eigen_assert(x) eigen_plain_assert(x) 580 #ifdef EIGEN_INTERNAL_DEBUGGING 581 #define eigen_internal_assert(x) eigen_assert(x) 583 #define eigen_internal_assert(x) 586 #ifdef EIGEN_NO_DEBUG 587 #define EIGEN_ONLY_USED_FOR_DEBUG(x) EIGEN_UNUSED_VARIABLE(x) 589 #define EIGEN_ONLY_USED_FOR_DEBUG(x) 592 #ifndef EIGEN_NO_DEPRECATED_WARNING 594 #define EIGEN_DEPRECATED __attribute__((deprecated)) 595 #elif EIGEN_COMP_MSVC 596 #define EIGEN_DEPRECATED __declspec(deprecated) 598 #define EIGEN_DEPRECATED 601 #define EIGEN_DEPRECATED 605 #define EIGEN_UNUSED __attribute__((unused)) 616 #define EIGEN_UNUSED_VARIABLE(var) Eigen::internal::ignore_unused_variable(var); 618 #if !defined(EIGEN_ASM_COMMENT) 619 #if EIGEN_COMP_GNUC && (EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM_OR_ARM64) 620 #define EIGEN_ASM_COMMENT(X) __asm__("#" X) 622 #define EIGEN_ASM_COMMENT(X) 647 #if (defined __CUDACC__) 648 #define EIGEN_ALIGN_TO_BOUNDARY(n) __align__(n) 649 #elif EIGEN_COMP_GNUC || EIGEN_COMP_PGI || EIGEN_COMP_IBM || EIGEN_COMP_ARM 650 #define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n))) 651 #elif EIGEN_COMP_MSVC 652 #define EIGEN_ALIGN_TO_BOUNDARY(n) __declspec(align(n)) 653 #elif EIGEN_COMP_SUNCC 655 #define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n))) 657 #error Please tell me what is the equivalent of __attribute__((aligned(n))) for your compiler 661 #if defined(EIGEN_DONT_VECTORIZE) 662 #define EIGEN_IDEAL_MAX_ALIGN_BYTES 0 663 #elif defined(EIGEN_VECTORIZE_AVX512) 665 #define EIGEN_IDEAL_MAX_ALIGN_BYTES 64 666 #elif defined(__AVX__) 668 #define EIGEN_IDEAL_MAX_ALIGN_BYTES 32 670 #define EIGEN_IDEAL_MAX_ALIGN_BYTES 16 675 #define EIGEN_MIN_ALIGN_BYTES 16 681 #if (defined(EIGEN_DONT_ALIGN_STATICALLY) || defined(EIGEN_DONT_ALIGN)) && defined(EIGEN_MAX_STATIC_ALIGN_BYTES) && EIGEN_MAX_STATIC_ALIGN_BYTES>0 682 #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. 687 #if defined(EIGEN_DONT_ALIGN_STATICALLY) || defined(EIGEN_DONT_ALIGN) 688 #ifdef EIGEN_MAX_STATIC_ALIGN_BYTES 689 #undef EIGEN_MAX_STATIC_ALIGN_BYTES 691 #define EIGEN_MAX_STATIC_ALIGN_BYTES 0 694 #ifndef EIGEN_MAX_STATIC_ALIGN_BYTES 704 #if EIGEN_COMP_GNUC && !(EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM_OR_ARM64 || EIGEN_ARCH_PPC || EIGEN_ARCH_IA64) 705 #define EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT 1 706 #elif EIGEN_ARCH_ARM_OR_ARM64 && EIGEN_COMP_GNUC_STRICT && EIGEN_GNUC_AT_MOST(4, 6) 710 #define EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT 1 712 #define EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT 0 716 #if !EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT \ 717 && !EIGEN_GCC3_OR_OLDER \ 718 && !EIGEN_COMP_SUNCC \ 720 #define EIGEN_ARCH_WANTS_STACK_ALIGNMENT 1 722 #define EIGEN_ARCH_WANTS_STACK_ALIGNMENT 0 725 #if EIGEN_ARCH_WANTS_STACK_ALIGNMENT 726 #define EIGEN_MAX_STATIC_ALIGN_BYTES EIGEN_IDEAL_MAX_ALIGN_BYTES 728 #define EIGEN_MAX_STATIC_ALIGN_BYTES 0 734 #if defined(EIGEN_MAX_ALIGN_BYTES) && EIGEN_MAX_ALIGN_BYTES<EIGEN_MAX_STATIC_ALIGN_BYTES 735 #undef EIGEN_MAX_STATIC_ALIGN_BYTES 736 #define EIGEN_MAX_STATIC_ALIGN_BYTES EIGEN_MAX_ALIGN_BYTES 739 #if EIGEN_MAX_STATIC_ALIGN_BYTES==0 && !defined(EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT) 740 #define EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT 750 #define EIGEN_ALIGN8 EIGEN_ALIGN_TO_BOUNDARY(8) 751 #define EIGEN_ALIGN16 EIGEN_ALIGN_TO_BOUNDARY(16) 752 #define EIGEN_ALIGN32 EIGEN_ALIGN_TO_BOUNDARY(32) 753 #define EIGEN_ALIGN64 EIGEN_ALIGN_TO_BOUNDARY(64) 754 #if EIGEN_MAX_STATIC_ALIGN_BYTES>0 755 #define EIGEN_ALIGN_MAX EIGEN_ALIGN_TO_BOUNDARY(EIGEN_MAX_STATIC_ALIGN_BYTES) 757 #define EIGEN_ALIGN_MAX 763 #if defined(EIGEN_DONT_ALIGN) && defined(EIGEN_MAX_ALIGN_BYTES) && EIGEN_MAX_ALIGN_BYTES>0 764 #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. 767 #ifdef EIGEN_DONT_ALIGN 768 #ifdef EIGEN_MAX_ALIGN_BYTES 769 #undef EIGEN_MAX_ALIGN_BYTES 771 #define EIGEN_MAX_ALIGN_BYTES 0 772 #elif !defined(EIGEN_MAX_ALIGN_BYTES) 773 #define EIGEN_MAX_ALIGN_BYTES EIGEN_IDEAL_MAX_ALIGN_BYTES 776 #if EIGEN_IDEAL_MAX_ALIGN_BYTES > EIGEN_MAX_ALIGN_BYTES 777 #define EIGEN_DEFAULT_ALIGN_BYTES EIGEN_IDEAL_MAX_ALIGN_BYTES 779 #define EIGEN_DEFAULT_ALIGN_BYTES EIGEN_MAX_ALIGN_BYTES 783 #ifndef EIGEN_UNALIGNED_VECTORIZE 784 #define EIGEN_UNALIGNED_VECTORIZE 1 790 #ifdef EIGEN_DONT_USE_RESTRICT_KEYWORD 791 #define EIGEN_RESTRICT 793 #ifndef EIGEN_RESTRICT 794 #define EIGEN_RESTRICT __restrict 797 #ifndef EIGEN_STACK_ALLOCATION_LIMIT 799 #define EIGEN_STACK_ALLOCATION_LIMIT 131072 802 #ifndef EIGEN_DEFAULT_IO_FORMAT 803 #ifdef EIGEN_MAKING_DOCS 806 #define EIGEN_DEFAULT_IO_FORMAT Eigen::IOFormat(3, 0, " ", "\n", "", "") 808 #define EIGEN_DEFAULT_IO_FORMAT Eigen::IOFormat() 815 #if EIGEN_COMP_MSVC_STRICT && (EIGEN_COMP_MSVC < 1900 || defined(__CUDACC_VER__)) // for older MSVC versions, as well as 1900 && CUDA 8, using the base operator is sufficient (cf Bugs 1000, 1324) 816 #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \ 817 using Base::operator =; 818 #elif EIGEN_COMP_CLANG // workaround clang bug (see http://forum.kde.org/viewtopic.php?f=74&t=102653) 819 #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \ 820 using Base::operator =; \ 821 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) { Base::operator=(other); return *this; } \ 822 template <typename OtherDerived> \ 823 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const DenseBase<OtherDerived>& other) { Base::operator=(other.derived()); return *this; } 825 #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \ 826 using Base::operator =; \ 827 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) \ 829 Base::operator=(other); \ 839 #define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived) EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) 849 #define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) \ 850 typedef typename Eigen::internal::traits<Derived>::Scalar Scalar; \ 851 typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; \ 852 typedef typename Base::CoeffReturnType CoeffReturnType; \ 853 typedef typename Eigen::internal::ref_selector<Derived>::type Nested; \ 854 typedef typename Eigen::internal::traits<Derived>::StorageKind StorageKind; \ 855 typedef typename Eigen::internal::traits<Derived>::StorageIndex StorageIndex; \ 856 enum { RowsAtCompileTime = Eigen::internal::traits<Derived>::RowsAtCompileTime, \ 857 ColsAtCompileTime = Eigen::internal::traits<Derived>::ColsAtCompileTime, \ 858 Flags = Eigen::internal::traits<Derived>::Flags, \ 859 SizeAtCompileTime = Base::SizeAtCompileTime, \ 860 MaxSizeAtCompileTime = Base::MaxSizeAtCompileTime, \ 861 IsVectorAtCompileTime = Base::IsVectorAtCompileTime }; \ 862 using Base::derived; \ 863 using Base::const_cast_derived; 867 #define EIGEN_DENSE_PUBLIC_INTERFACE(Derived) \ 868 EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) \ 869 typedef typename Base::PacketScalar PacketScalar; 872 #define EIGEN_PLAIN_ENUM_MIN(a,b) (((int)a <= (int)b) ? (int)a : (int)b) 873 #define EIGEN_PLAIN_ENUM_MAX(a,b) (((int)a >= (int)b) ? (int)a : (int)b) 878 #define EIGEN_SIZE_MIN_PREFER_DYNAMIC(a,b) (((int)a == 0 || (int)b == 0) ? 0 \ 879 : ((int)a == 1 || (int)b == 1) ? 1 \ 880 : ((int)a == Dynamic || (int)b == Dynamic) ? Dynamic \ 881 : ((int)a <= (int)b) ? (int)a : (int)b) 886 #define EIGEN_SIZE_MIN_PREFER_FIXED(a,b) (((int)a == 0 || (int)b == 0) ? 0 \ 887 : ((int)a == 1 || (int)b == 1) ? 1 \ 888 : ((int)a == Dynamic && (int)b == Dynamic) ? Dynamic \ 889 : ((int)a == Dynamic) ? (int)b \ 890 : ((int)b == Dynamic) ? (int)a \ 891 : ((int)a <= (int)b) ? (int)a : (int)b) 894 #define EIGEN_SIZE_MAX(a,b) (((int)a == Dynamic || (int)b == Dynamic) ? Dynamic \ 895 : ((int)a >= (int)b) ? (int)a : (int)b) 897 #define EIGEN_LOGICAL_XOR(a,b) (((a) || (b)) && !((a) && (b))) 899 #define EIGEN_IMPLIES(a,b) (!(a) || (b)) 902 #define EIGEN_CWISE_BINARY_RETURN_TYPE(LHS,RHS,OPNAME) \ 904 EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)< \ 905 typename internal::traits<LHS>::Scalar, \ 906 typename internal::traits<RHS>::Scalar \ 912 #define EIGEN_MAKE_CWISE_BINARY_OP(METHOD,OPNAME) \ 913 template<typename OtherDerived> \ 914 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE(Derived,OtherDerived,OPNAME) \ 915 (METHOD)(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const \ 917 return EIGEN_CWISE_BINARY_RETURN_TYPE(Derived,OtherDerived,OPNAME)(derived(), other.derived()); \ 920 #define EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,TYPEA,TYPEB) \ 921 (Eigen::internal::has_ReturnType<Eigen::ScalarBinaryOpTraits<TYPEA,TYPEB,EIGEN_CAT(EIGEN_CAT(Eigen::internal::scalar_,OPNAME),_op)<TYPEA,TYPEB> > >::value) 923 #define EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(EXPR,SCALAR,OPNAME) \ 924 CwiseBinaryOp<EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)<typename internal::traits<EXPR>::Scalar,SCALAR>, const EXPR, \ 925 const typename internal::plain_constant_type<EXPR,SCALAR>::type> 927 #define EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(SCALAR,EXPR,OPNAME) \ 928 CwiseBinaryOp<EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)<SCALAR,typename internal::traits<EXPR>::Scalar>, \ 929 const typename internal::plain_constant_type<EXPR,SCALAR>::type, const EXPR> 932 #if EIGEN_COMP_MSVC_STRICT<=1600 933 #define EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(X) typename internal::enable_if<true,X>::type 935 #define EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(X) X 938 #define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(METHOD,OPNAME) \ 939 template <typename T> EIGEN_DEVICE_FUNC inline \ 940 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))\ 941 (METHOD)(const T& scalar) const { \ 942 typedef typename internal::promote_scalar_arg<Scalar,T,EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,Scalar,T)>::type PromotedT; \ 943 return EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Derived,PromotedT,OPNAME)(derived(), \ 944 typename internal::plain_constant_type<Derived,PromotedT>::type(derived().rows(), derived().cols(), internal::scalar_constant_op<PromotedT>(scalar))); \ 947 #define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHELEFT(METHOD,OPNAME) \ 948 template <typename T> EIGEN_DEVICE_FUNC inline friend \ 949 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)) \ 950 (METHOD)(const T& scalar, const StorageBaseType& matrix) { \ 951 typedef typename internal::promote_scalar_arg<Scalar,T,EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,T,Scalar)>::type PromotedT; \ 952 return EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(PromotedT,Derived,OPNAME)( \ 953 typename internal::plain_constant_type<Derived,PromotedT>::type(matrix.derived().rows(), matrix.derived().cols(), internal::scalar_constant_op<PromotedT>(scalar)), matrix.derived()); \ 956 #define EIGEN_MAKE_SCALAR_BINARY_OP(METHOD,OPNAME) \ 957 EIGEN_MAKE_SCALAR_BINARY_OP_ONTHELEFT(METHOD,OPNAME) \ 958 EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(METHOD,OPNAME) 961 #ifdef EIGEN_EXCEPTIONS 962 # define EIGEN_THROW_X(X) throw X 963 # define EIGEN_THROW throw 964 # define EIGEN_TRY try 965 # define EIGEN_CATCH(X) catch (X) 967 # ifdef __CUDA_ARCH__ 968 # define EIGEN_THROW_X(X) asm("trap;") 969 # define EIGEN_THROW asm("trap;") 971 # define EIGEN_THROW_X(X) std::abort() 972 # define EIGEN_THROW std::abort() 974 # define EIGEN_TRY if (true) 975 # define EIGEN_CATCH(X) else 979 #if EIGEN_HAS_CXX11_NOEXCEPT 980 # define EIGEN_INCLUDE_TYPE_TRAITS 981 # define EIGEN_NOEXCEPT noexcept 982 # define EIGEN_NOEXCEPT_IF(x) noexcept(x) 983 # define EIGEN_NO_THROW noexcept(true) 984 # define EIGEN_EXCEPTION_SPEC(X) noexcept(false) 986 # define EIGEN_NOEXCEPT 987 # define EIGEN_NOEXCEPT_IF(x) 988 # define EIGEN_NO_THROW throw() 989 # define EIGEN_EXCEPTION_SPEC(X) throw(X) 992 #endif // EIGEN_MACROS_H
#define EIGEN_DONT_INLINE
EIGEN_DEVICE_FUNC void ignore_unused_variable(const T &)
EIGEN_DEVICE_FUNC const Scalar & b