11 #ifndef EIGEN_MACROS_H
12 #define EIGEN_MACROS_H
13 #include "../InternalHeaderCheck.h"
19 #define EIGEN_WORLD_VERSION 3
20 #define EIGEN_MAJOR_VERSION 4
21 #define EIGEN_MINOR_VERSION 90
23 #define EIGEN_VERSION_AT_LEAST(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \
24 (EIGEN_MAJOR_VERSION>y || (EIGEN_MAJOR_VERSION>=y && \
25 EIGEN_MINOR_VERSION>=z))))
27 #ifdef EIGEN_DEFAULT_TO_ROW_MAJOR
28 #define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION Eigen::RowMajor
30 #define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION Eigen::ColMajor
33 #ifndef EIGEN_DEFAULT_DENSE_INDEX_TYPE
34 #define EIGEN_DEFAULT_DENSE_INDEX_TYPE std::ptrdiff_t
40 #ifndef EIGEN_MAX_CPP_VER
41 #define EIGEN_MAX_CPP_VER 99
49 #ifndef EIGEN_FAST_MATH
50 #define EIGEN_FAST_MATH 1
53 #ifndef EIGEN_STACK_ALLOCATION_LIMIT
55 #define EIGEN_STACK_ALLOCATION_LIMIT 131072
64 #define EIGEN_COMP_GNUC (__GNUC__*100+__GNUC_MINOR__*10+__GNUC_PATCHLEVEL__)
66 #define EIGEN_COMP_GNUC 0
70 #if defined(__clang__)
71 #define EIGEN_COMP_CLANG (__clang_major__*100+__clang_minor__*10+__clang_patchlevel__)
73 #define EIGEN_COMP_CLANG 0
77 #if defined(__clang__) && defined(__apple_build_version__)
78 #define EIGEN_COMP_CLANGAPPLE __apple_build_version__
80 #define EIGEN_COMP_CLANGAPPLE 0
84 #if defined(__castxml__)
85 #define EIGEN_COMP_CASTXML 1
87 #define EIGEN_COMP_CASTXML 0
92 #define EIGEN_COMP_LLVM 1
94 #define EIGEN_COMP_LLVM 0
98 #if defined(__INTEL_COMPILER)
99 #define EIGEN_COMP_ICC __INTEL_COMPILER
101 #define EIGEN_COMP_ICC 0
105 #if defined(__INTEL_CLANG_COMPILER)
106 #define EIGEN_COMP_CLANGICC __INTEL_CLANG_COMPILER
108 #define EIGEN_COMP_CLANGICC 0
112 #if defined(__MINGW32__)
113 #define EIGEN_COMP_MINGW 1
115 #define EIGEN_COMP_MINGW 0
119 #if defined(__SUNPRO_CC)
120 #define EIGEN_COMP_SUNCC 1
122 #define EIGEN_COMP_SUNCC 0
126 #if defined(_MSC_VER)
127 #define EIGEN_COMP_MSVC _MSC_VER
129 #define EIGEN_COMP_MSVC 0
132 #if defined(__NVCC__)
133 #if defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 9)
134 #define EIGEN_COMP_NVCC ((__CUDACC_VER_MAJOR__ * 10000) + (__CUDACC_VER_MINOR__ * 100))
135 #elif defined(__CUDACC_VER__)
136 #define EIGEN_COMP_NVCC __CUDACC_VER__
138 #error "NVCC did not define compiler version."
141 #define EIGEN_COMP_NVCC 0
158 #if defined(_MSVC_LANG)
159 #define EIGEN_COMP_MSVC_LANG _MSVC_LANG
161 #define EIGEN_COMP_MSVC_LANG 0
171 #if EIGEN_COMP_MSVC && !(EIGEN_COMP_ICC || EIGEN_COMP_LLVM || EIGEN_COMP_CLANG)
172 #define EIGEN_COMP_MSVC_STRICT _MSC_VER
174 #define EIGEN_COMP_MSVC_STRICT 0
183 #if defined(__IBMCPP__) || defined(__xlc__) || defined(__ibmxl__)
184 #define EIGEN_COMP_IBM __xlC__
186 #define EIGEN_COMP_IBM 0
191 #define EIGEN_COMP_PGI (__PGIC__*100+__PGIC_MINOR__)
193 #define EIGEN_COMP_PGI 0
197 #if defined(__CC_ARM) || defined(__ARMCC_VERSION)
198 #define EIGEN_COMP_ARM 1
200 #define EIGEN_COMP_ARM 0
204 #if defined(__EMSCRIPTEN__)
205 #define EIGEN_COMP_EMSCRIPTEN 1
207 #define EIGEN_COMP_EMSCRIPTEN 0
213 #if defined(__FUJITSU)
214 #define EIGEN_COMP_FCC (__FCC_major__*100+__FCC_minor__*10+__FCC_patchlevel__)
216 #define EIGEN_COMP_FCC 0
222 #if defined(__CLANG_FUJITSU)
223 #define EIGEN_COMP_CLANGFCC (__FCC_major__*100+__FCC_minor__*10+__FCC_patchlevel__)
225 #define EIGEN_COMP_CLANGFCC 0
231 #if defined(_CRAYC) && !defined(__clang__)
232 #define EIGEN_COMP_CPE (_RELEASE_MAJOR*100+_RELEASE_MINOR*10+_RELEASE_PATCHLEVEL)
234 #define EIGEN_COMP_CPE 0
240 #if defined(_CRAYC) && defined(__clang__)
241 #define EIGEN_COMP_CLANGCPE (_RELEASE_MAJOR*100+_RELEASE_MINOR*10+_RELEASE_PATCHLEVEL)
243 #define EIGEN_COMP_CLANGCPE 0
247 #if defined(__LCC__) && defined(__MCST__)
248 #define EIGEN_COMP_LCC (__LCC__*100+__LCC_MINOR__)
250 #define EIGEN_COMP_LCC 0
255 #if EIGEN_COMP_GNUC && !(EIGEN_COMP_CLANG || EIGEN_COMP_ICC || EIGEN_COMP_CLANGICC || EIGEN_COMP_MINGW || EIGEN_COMP_PGI || EIGEN_COMP_IBM || EIGEN_COMP_ARM || EIGEN_COMP_EMSCRIPTEN || EIGEN_COMP_FCC || EIGEN_COMP_CLANGFCC || EIGEN_COMP_CPE || EIGEN_COMP_CLANGCPE || EIGEN_COMP_LCC)
256 #define EIGEN_COMP_GNUC_STRICT 1
258 #define EIGEN_COMP_GNUC_STRICT 0
262 #if EIGEN_COMP_GNUC_STRICT
263 #define EIGEN_GNUC_STRICT_AT_LEAST(x,y,z) ((__GNUC__ > x) || \
264 (__GNUC__ == x && __GNUC_MINOR__ > y) || \
265 (__GNUC__ == x && __GNUC_MINOR__ == y && __GNUC_PATCHLEVEL__ >= z))
266 #define EIGEN_GNUC_STRICT_LESS_THAN(x,y,z) ((__GNUC__ < x) || \
267 (__GNUC__ == x && __GNUC_MINOR__ < y) || \
268 (__GNUC__ == x && __GNUC_MINOR__ == y && __GNUC_PATCHLEVEL__ < z))
270 #define EIGEN_GNUC_STRICT_AT_LEAST(x,y,z) 0
271 #define EIGEN_GNUC_STRICT_LESS_THAN(x,y,z) 0
277 #if EIGEN_COMP_CLANG && !(EIGEN_COMP_CLANGAPPLE || EIGEN_COMP_CLANGICC || EIGEN_COMP_CLANGFCC || EIGEN_COMP_CLANGCPE)
278 #define EIGEN_COMP_CLANG_STRICT 1
280 #define EIGEN_COMP_CLANG_STRICT 0
284 #if EIGEN_COMP_CLANG_STRICT
285 #define EIGEN_CLANG_STRICT_AT_LEAST(x,y,z) ((__clang_major__ > x) || \
286 (__clang_major__ == x && __clang_minor__ > y) || \
287 (__clang_major__ == x && __clang_minor__ == y && __clang_patchlevel__ >= z))
288 #define EIGEN_CLANG_STRICT_LESS_THAN(x,y,z) ((__clang_major__ < x) || \
289 (__clang_major__ == x && __clang_minor__ < y) || \
290 (__clang_major__ == x && __clang_minor__ == y && __clang_patchlevel__ < z))
292 #define EIGEN_CLANG_STRICT_AT_LEAST(x,y,z) 0
293 #define EIGEN_CLANG_STRICT_LESS_THAN(x,y,z) 0
301 #if defined(__x86_64__) || (defined(_M_X64) && !defined(_M_ARM64EC)) || defined(__amd64)
302 #define EIGEN_ARCH_x86_64 1
304 #define EIGEN_ARCH_x86_64 0
307 #if defined(__i386__) || defined(_M_IX86) || defined(_X86_) || defined(__i386)
308 #define EIGEN_ARCH_i386 1
310 #define EIGEN_ARCH_i386 0
313 #if EIGEN_ARCH_x86_64 || EIGEN_ARCH_i386
314 #define EIGEN_ARCH_i386_OR_x86_64 1
316 #define EIGEN_ARCH_i386_OR_x86_64 0
321 #define EIGEN_ARCH_ARM 1
323 #define EIGEN_ARCH_ARM 0
327 #if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
328 #define EIGEN_ARCH_ARM64 1
330 #define EIGEN_ARCH_ARM64 0
334 #if EIGEN_ARCH_ARM || EIGEN_ARCH_ARM64
335 #define EIGEN_ARCH_ARM_OR_ARM64 1
337 #define EIGEN_ARCH_ARM_OR_ARM64 0
341 #if EIGEN_ARCH_ARM_OR_ARM64 && defined(__ARM_ARCH) && __ARM_ARCH >= 8
342 #define EIGEN_ARCH_ARMV8 1
344 #define EIGEN_ARCH_ARMV8 0
350 #if EIGEN_ARCH_ARM_OR_ARM64
351 #ifndef EIGEN_HAS_ARM64_FP16
352 #if defined(__ARM_FP16_FORMAT_IEEE)
353 #define EIGEN_HAS_ARM64_FP16 1
355 #define EIGEN_HAS_ARM64_FP16 0
361 #if defined(__mips__) || defined(__mips)
362 #define EIGEN_ARCH_MIPS 1
364 #define EIGEN_ARCH_MIPS 0
368 #if defined(__sparc__) || defined(__sparc)
369 #define EIGEN_ARCH_SPARC 1
371 #define EIGEN_ARCH_SPARC 0
375 #if defined(__ia64__)
376 #define EIGEN_ARCH_IA64 1
378 #define EIGEN_ARCH_IA64 0
382 #if defined(__powerpc__) || defined(__ppc__) || defined(_M_PPC) || defined(__POWERPC__)
383 #define EIGEN_ARCH_PPC 1
385 #define EIGEN_ARCH_PPC 0
395 #if defined(__unix__) || defined(__unix)
396 #define EIGEN_OS_UNIX 1
398 #define EIGEN_OS_UNIX 0
402 #if defined(__linux__)
403 #define EIGEN_OS_LINUX 1
405 #define EIGEN_OS_LINUX 0
410 #if defined(__ANDROID__) || defined(ANDROID)
411 #define EIGEN_OS_ANDROID 1
413 #define EIGEN_OS_ANDROID 0
417 #if defined(__gnu_linux__) && !(EIGEN_OS_ANDROID)
418 #define EIGEN_OS_GNULINUX 1
420 #define EIGEN_OS_GNULINUX 0
424 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__)
425 #define EIGEN_OS_BSD 1
427 #define EIGEN_OS_BSD 0
431 #if defined(__APPLE__)
432 #define EIGEN_OS_MAC 1
434 #define EIGEN_OS_MAC 0
439 #define EIGEN_OS_QNX 1
441 #define EIGEN_OS_QNX 0
446 #define EIGEN_OS_WIN 1
448 #define EIGEN_OS_WIN 0
453 #define EIGEN_OS_WIN64 1
455 #define EIGEN_OS_WIN64 0
459 #if defined(_WIN32_WCE)
460 #define EIGEN_OS_WINCE 1
462 #define EIGEN_OS_WINCE 0
466 #if defined(__CYGWIN__)
467 #define EIGEN_OS_CYGWIN 1
469 #define EIGEN_OS_CYGWIN 0
473 #if EIGEN_OS_WIN && !( EIGEN_OS_WINCE || EIGEN_OS_CYGWIN )
474 #define EIGEN_OS_WIN_STRICT 1
476 #define EIGEN_OS_WIN_STRICT 0
488 #if (defined(sun) || defined(__sun)) && !(defined(__SVR4) || defined(__svr4__))
489 #define EIGEN_OS_SUN __SUNPRO_C
491 #define EIGEN_OS_SUN 0
495 #if (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))
496 #define EIGEN_OS_SOLARIS 1
498 #define EIGEN_OS_SOLARIS 0
508 #if defined(__NVCC__) && defined(__HIPCC__)
509 #error "NVCC as the target platform for HIPCC is currently not supported."
512 #if defined(__CUDACC__) && !defined(EIGEN_NO_CUDA) && !defined(__SYCL_DEVICE_ONLY__)
514 #define EIGEN_CUDACC __CUDACC__
517 #if defined(__CUDA_ARCH__) && !defined(EIGEN_NO_CUDA) && !defined(__SYCL_DEVICE_ONLY__)
519 #define EIGEN_CUDA_ARCH __CUDA_ARCH__
522 #if defined(EIGEN_CUDACC)
524 #define EIGEN_CUDA_SDK_VER (CUDA_VERSION * 10)
526 #define EIGEN_CUDA_SDK_VER 0
529 #if defined(__HIPCC__) && !defined(EIGEN_NO_HIP) && !defined(__SYCL_DEVICE_ONLY__)
531 #define EIGEN_HIPCC __HIPCC__
536 #include <hip/hip_runtime.h>
538 #if defined(__HIP_DEVICE_COMPILE__) && !defined(__SYCL_DEVICE_ONLY__)
540 #define EIGEN_HIP_DEVICE_COMPILE __HIP_DEVICE_COMPILE__
555 #define EIGEN_HIP_LAUNCH_BOUNDS_1024 __launch_bounds__(1024)
559 #if !defined(EIGEN_HIP_LAUNCH_BOUNDS_1024)
560 #define EIGEN_HIP_LAUNCH_BOUNDS_1024
565 #if defined(EIGEN_CUDACC) || defined(EIGEN_HIPCC)
588 #if defined(EIGEN_CUDA_ARCH) || defined(EIGEN_HIP_DEVICE_COMPILE)
592 #define EIGEN_GPU_COMPILE_PHASE
620 #if EIGEN_ARCH_ARM_OR_ARM64
621 #ifndef EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC
624 #if EIGEN_ARCH_ARM64 && defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(EIGEN_GPU_COMPILE_PHASE)
625 #define EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC 1
627 #define EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC 0
634 #if EIGEN_ARCH_ARM_OR_ARM64
635 #ifndef EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC
638 #if EIGEN_ARCH_ARM64 && defined(__ARM_FEATURE_FP16_SCALAR_ARITHMETIC) && !defined(EIGEN_GPU_COMPILE_PHASE)
639 #define EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC 1
644 #if defined(EIGEN_USE_SYCL) && defined(__SYCL_DEVICE_ONLY__)
647 #define SYCL_DEVICE_ONLY
656 # define EIGEN_HAS_BUILTIN(x) __has_builtin(x)
658 # define EIGEN_HAS_BUILTIN(x) 0
663 #ifndef __has_feature
664 # define __has_feature(x) 0
674 #if EIGEN_COMP_MSVC_LANG > 0
675 #define EIGEN_CPLUSPLUS EIGEN_COMP_MSVC_LANG
676 #elif EIGEN_COMP_MSVC >= 1900
677 #define EIGEN_CPLUSPLUS 201103L
678 #elif defined(__cplusplus)
679 #define EIGEN_CPLUSPLUS __cplusplus
681 #define EIGEN_CPLUSPLUS 0
687 #if EIGEN_CPLUSPLUS >= 202002L
688 #define EIGEN_COMP_CXXVER 20
689 #elif EIGEN_CPLUSPLUS >= 201703L
690 #define EIGEN_COMP_CXXVER 17
691 #elif EIGEN_CPLUSPLUS >= 201402L
692 #define EIGEN_COMP_CXXVER 14
693 #elif EIGEN_CPLUSPLUS >= 201103L
694 #define EIGEN_COMP_CXXVER 11
696 #define EIGEN_COMP_CXXVER 03
704 #if EIGEN_MAX_CPP_VER < 14 || EIGEN_COMP_CXXVER < 14 || \
705 (EIGEN_COMP_MSVC && EIGEN_COMP_MSVC < 1900) || \
706 (EIGEN_COMP_ICC && EIGEN_COMP_ICC < 1500) || \
707 (EIGEN_COMP_NVCC && EIGEN_COMP_NVCC < 80000) || \
708 (EIGEN_COMP_CLANG_STRICT && EIGEN_COMP_CLANG < 390) || \
709 (EIGEN_COMP_CLANGAPPLE && EIGEN_COMP_CLANGAPPLE < 9000000) || \
710 (EIGEN_COMP_GNUC_STRICT && EIGEN_COMP_GNUC < 510)
711 #error This compiler appears to be too old to be supported by Eigen
717 #ifndef EIGEN_HAS_C99_MATH
718 #if ((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) \
719 || (defined(__GNUC__) && defined(_GLIBCXX_USE_C99)) \
720 || (defined(_LIBCPP_VERSION) && !defined(_MSC_VER)) \
721 || (EIGEN_COMP_MSVC) || defined(SYCL_DEVICE_ONLY))
722 #define EIGEN_HAS_C99_MATH 1
724 #define EIGEN_HAS_C99_MATH 0
729 #ifndef EIGEN_HAS_STD_HASH
732 #if !defined(EIGEN_GPU_COMPILE_PHASE)
733 #define EIGEN_HAS_STD_HASH 1
735 #define EIGEN_HAS_STD_HASH 0
739 #ifndef EIGEN_HAS_STD_INVOKE_RESULT
740 #if EIGEN_MAX_CPP_VER >= 17 && EIGEN_COMP_CXXVER >= 17
741 #define EIGEN_HAS_STD_INVOKE_RESULT 1
743 #define EIGEN_HAS_STD_INVOKE_RESULT 0
747 #define EIGEN_CONSTEXPR constexpr
756 #ifndef EIGEN_HAS_CXX17_OVERALIGN
757 #if EIGEN_MAX_CPP_VER>=17 && EIGEN_COMP_CXXVER>=17 && ( \
758 (EIGEN_COMP_MSVC >= 1912) \
759 || (EIGEN_GNUC_STRICT_AT_LEAST(7,0,0)) \
760 || (EIGEN_CLANG_STRICT_AT_LEAST(5,0,0)) \
761 || (EIGEN_COMP_CLANGAPPLE && EIGEN_COMP_CLANGAPPLE >= 10000000) \
763 #define EIGEN_HAS_CXX17_OVERALIGN 1
765 #define EIGEN_HAS_CXX17_OVERALIGN 0
769 #if defined(EIGEN_CUDACC)
771 #if defined(__NVCC__)
773 #ifdef __CUDACC_RELAXED_CONSTEXPR__
774 #define EIGEN_CONSTEXPR_ARE_DEVICE_FUNC
776 #elif defined(__clang__) && defined(__CUDA__) && __has_feature(cxx_relaxed_constexpr)
778 #define EIGEN_CONSTEXPR_ARE_DEVICE_FUNC
790 #ifndef EIGEN_HAS_BUILTIN_INT128
791 #if defined(__SIZEOF_INT128__) && !(EIGEN_OS_WIN && EIGEN_COMP_CLANG)
792 #define EIGEN_HAS_BUILTIN_INT128 1
794 #define EIGEN_HAS_BUILTIN_INT128 0
804 #define EIGEN_NOT_A_MACRO
806 #define EIGEN_DEBUG_VAR(x) std::cerr << #x << " = " << x << std::endl;
809 #define EIGEN_CAT2(a,b) a ## b
810 #define EIGEN_CAT(a,b) EIGEN_CAT2(a,b)
812 #define EIGEN_COMMA ,
815 #define EIGEN_MAKESTRING2(a) #a
816 #define EIGEN_MAKESTRING(a) EIGEN_MAKESTRING2(a)
821 #ifndef EIGEN_STRONG_INLINE
822 #if (EIGEN_COMP_MSVC || EIGEN_COMP_ICC) && !defined(EIGEN_GPUCC)
823 #define EIGEN_STRONG_INLINE __forceinline
825 #define EIGEN_STRONG_INLINE inline
833 #if EIGEN_COMP_GNUC && !defined(SYCL_DEVICE_ONLY)
834 #define EIGEN_ALWAYS_INLINE __attribute__((always_inline)) inline
836 #define EIGEN_ALWAYS_INLINE EIGEN_STRONG_INLINE
840 #define EIGEN_DONT_INLINE __attribute__((noinline))
841 #elif EIGEN_COMP_MSVC
842 #define EIGEN_DONT_INLINE __declspec(noinline)
844 #define EIGEN_DONT_INLINE
848 #define EIGEN_PERMISSIVE_EXPR __extension__
850 #define EIGEN_PERMISSIVE_EXPR
856 #if defined(SYCL_DEVICE_ONLY) || defined(EIGEN_HIP_DEVICE_COMPILE)
858 #ifndef EIGEN_NO_DEBUG
859 #define EIGEN_NO_DEBUG
862 #ifdef EIGEN_INTERNAL_DEBUGGING
863 #undef EIGEN_INTERNAL_DEBUGGING
868 #if defined(SYCL_DEVICE_ONLY) || defined(EIGEN_GPU_COMPILE_PHASE)
869 #ifdef EIGEN_EXCEPTIONS
870 #undef EIGEN_EXCEPTIONS
874 #if defined(SYCL_DEVICE_ONLY)
875 #ifndef EIGEN_DONT_VECTORIZE
876 #define EIGEN_DONT_VECTORIZE
878 #define EIGEN_DEVICE_FUNC __attribute__((flatten)) __attribute__((always_inline))
880 #elif defined(EIGEN_GPUCC)
881 #define EIGEN_DEVICE_FUNC __host__ __device__
883 #define EIGEN_DEVICE_FUNC
891 #define EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_DEVICE_FUNC
892 #define EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_DEVICE_FUNC inline
895 # ifndef EIGEN_NO_DEBUG
896 # define EIGEN_NO_DEBUG
902 #define eigen_assert(x) eigen_plain_assert(x)
905 #ifdef EIGEN_INTERNAL_DEBUGGING
906 #define eigen_internal_assert(x) eigen_assert(x)
908 #define eigen_internal_assert(x) ((void)0)
911 #if defined(EIGEN_NO_DEBUG) || (defined(EIGEN_GPU_COMPILE_PHASE) && defined(EIGEN_NO_DEBUG_GPU))
912 #define EIGEN_ONLY_USED_FOR_DEBUG(x) EIGEN_UNUSED_VARIABLE(x)
914 #define EIGEN_ONLY_USED_FOR_DEBUG(x)
917 #ifndef EIGEN_NO_DEPRECATED_WARNING
919 #define EIGEN_DEPRECATED __attribute__((deprecated))
920 #elif EIGEN_COMP_MSVC
921 #define EIGEN_DEPRECATED __declspec(deprecated)
923 #define EIGEN_DEPRECATED
926 #define EIGEN_DEPRECATED
930 #define EIGEN_UNUSED __attribute__((unused))
936 #define EIGEN_PRAGMA(tokens) _Pragma(#tokens)
937 #define EIGEN_DIAGNOSTICS(tokens) EIGEN_PRAGMA(GCC diagnostic tokens)
938 #define EIGEN_DIAGNOSTICS_OFF(msc, gcc) EIGEN_DIAGNOSTICS(gcc)
939 #elif EIGEN_COMP_MSVC
940 #define EIGEN_PRAGMA(tokens) __pragma(tokens)
941 #define EIGEN_DIAGNOSTICS(tokens) EIGEN_PRAGMA(warning(tokens))
942 #define EIGEN_DIAGNOSTICS_OFF(msc, gcc) EIGEN_DIAGNOSTICS(msc)
944 #define EIGEN_PRAGMA(tokens)
945 #define EIGEN_DIAGNOSTICS(tokens)
946 #define EIGEN_DIAGNOSTICS_OFF(msc, gcc)
949 #define EIGEN_DISABLE_DEPRECATED_WARNING EIGEN_DIAGNOSTICS_OFF(disable : 4996, ignored "-Wdeprecated-declarations")
957 #define EIGEN_UNUSED_VARIABLE(var) Eigen::internal::ignore_unused_variable(var);
959 #if !defined(EIGEN_ASM_COMMENT)
960 #if EIGEN_COMP_GNUC && (EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM_OR_ARM64)
961 #define EIGEN_ASM_COMMENT(X) __asm__("#" X)
963 #define EIGEN_ASM_COMMENT(X)
973 #if !defined(EIGEN_OPTIMIZATION_BARRIER)
1007 #if EIGEN_ARCH_PPC && EIGEN_COMP_GNUC_STRICT
1013 #define EIGEN_OPTIMIZATION_BARRIER(X) __asm__ ("" : "+r,v" (X));
1016 #define EIGEN_OPTIMIZATION_BARRIER(X) __asm__ ("" : "+r,v,wa" (X));
1018 #elif EIGEN_ARCH_ARM_OR_ARM64
1024 #define EIGEN_OPTIMIZATION_BARRIER(X) __asm__ ("" : "+g,w" (X));
1028 #define EIGEN_OPTIMIZATION_BARRIER(X) __asm__ ("" : "+g" (X));
1030 #elif EIGEN_ARCH_i386_OR_x86_64
1032 #define EIGEN_OPTIMIZATION_BARRIER(X) __asm__ ("" : "+g,x" (X));
1035 #define EIGEN_OPTIMIZATION_BARRIER(X)
1039 #define EIGEN_OPTIMIZATION_BARRIER(X)
1046 # define EIGEN_CONST_CONDITIONAL(cond) (void)0, cond
1048 # define EIGEN_CONST_CONDITIONAL(cond) cond
1051 #ifdef EIGEN_DONT_USE_RESTRICT_KEYWORD
1052 #define EIGEN_RESTRICT
1054 #ifndef EIGEN_RESTRICT
1055 #define EIGEN_RESTRICT __restrict
1059 #ifndef EIGEN_DEFAULT_IO_FORMAT
1060 #ifdef EIGEN_MAKING_DOCS
1063 #define EIGEN_DEFAULT_IO_FORMAT Eigen::IOFormat(3, 0, " ", "\n", "", "")
1065 #define EIGEN_DEFAULT_IO_FORMAT Eigen::IOFormat()
1077 #if (defined(EIGEN_CUDA_ARCH) && defined(__NVCC__)) || defined(EIGEN_HIP_DEVICE_COMPILE)
1078 #define EIGEN_USING_STD(FUNC) using ::FUNC;
1080 #define EIGEN_USING_STD(FUNC) using std::FUNC;
1083 #if EIGEN_COMP_MSVC_STRICT && EIGEN_COMP_NVCC
1089 #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
1090 using Base::operator =;
1091 #elif EIGEN_COMP_CLANG
1092 #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
1093 using Base::operator =; \
1094 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) { Base::operator=(other); return *this; } \
1095 template <typename OtherDerived> \
1096 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const DenseBase<OtherDerived>& other) { Base::operator=(other.derived()); return *this; }
1098 #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
1099 using Base::operator =; \
1100 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) \
1102 Base::operator=(other); \
1113 #define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS) EIGEN_DEVICE_FUNC CLASS(const CLASS&) = default;
1122 #define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived) \
1123 EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
1124 EIGEN_DEFAULT_COPY_CONSTRUCTOR(Derived)
1133 #define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived) \
1134 EIGEN_DEVICE_FUNC Derived() = default; \
1135 EIGEN_DEVICE_FUNC ~Derived() = default;
1149 #define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) \
1150 typedef typename Eigen::internal::traits<Derived>::Scalar Scalar; \
1151 typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; \
1152 typedef typename Base::CoeffReturnType CoeffReturnType; \
1153 typedef typename Eigen::internal::ref_selector<Derived>::type Nested; \
1154 typedef typename Eigen::internal::traits<Derived>::StorageKind StorageKind; \
1155 typedef typename Eigen::internal::traits<Derived>::StorageIndex StorageIndex; \
1156 enum CompileTimeTraits \
1157 { RowsAtCompileTime = Eigen::internal::traits<Derived>::RowsAtCompileTime, \
1158 ColsAtCompileTime = Eigen::internal::traits<Derived>::ColsAtCompileTime, \
1159 Flags = Eigen::internal::traits<Derived>::Flags, \
1160 SizeAtCompileTime = Base::SizeAtCompileTime, \
1161 MaxSizeAtCompileTime = Base::MaxSizeAtCompileTime, \
1162 IsVectorAtCompileTime = Base::IsVectorAtCompileTime }; \
1163 using Base::derived; \
1164 using Base::const_cast_derived;
1168 #define EIGEN_DENSE_PUBLIC_INTERFACE(Derived) \
1169 EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) \
1170 typedef typename Base::PacketScalar PacketScalar;
1173 #if EIGEN_HAS_BUILTIN(__builtin_expect) || EIGEN_COMP_GNUC
1174 #define EIGEN_PREDICT_FALSE(x) (__builtin_expect(x, false))
1175 #define EIGEN_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
1177 #define EIGEN_PREDICT_FALSE(x) (x)
1178 #define EIGEN_PREDICT_TRUE(x) (x)
1182 #define EIGEN_CWISE_BINARY_RETURN_TYPE(LHS,RHS,OPNAME) \
1184 EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)< \
1185 typename internal::traits<LHS>::Scalar, \
1186 typename internal::traits<RHS>::Scalar \
1192 #define EIGEN_MAKE_CWISE_BINARY_OP(METHOD,OPNAME) \
1193 template<typename OtherDerived> \
1194 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE(Derived,OtherDerived,OPNAME) \
1195 (METHOD)(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const \
1197 return EIGEN_CWISE_BINARY_RETURN_TYPE(Derived,OtherDerived,OPNAME)(derived(), other.derived()); \
1200 #define EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,TYPEA,TYPEB) \
1201 (Eigen::internal::has_ReturnType<Eigen::ScalarBinaryOpTraits<TYPEA,TYPEB,EIGEN_CAT(EIGEN_CAT(Eigen::internal::scalar_,OPNAME),_op)<TYPEA,TYPEB> > >::value)
1203 #define EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(EXPR,SCALAR,OPNAME) \
1204 CwiseBinaryOp<EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)<typename internal::traits<EXPR>::Scalar,SCALAR>, const EXPR, \
1205 const typename internal::plain_constant_type<EXPR,SCALAR>::type>
1207 #define EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(SCALAR,EXPR,OPNAME) \
1208 CwiseBinaryOp<EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)<SCALAR,typename internal::traits<EXPR>::Scalar>, \
1209 const typename internal::plain_constant_type<EXPR,SCALAR>::type, const EXPR>
1211 #define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(METHOD,OPNAME) \
1212 template <typename T> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE \
1213 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)\
1214 (METHOD)(const T& scalar) const { \
1215 typedef typename internal::promote_scalar_arg<Scalar,T,EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,Scalar,T)>::type PromotedT; \
1216 return EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Derived,PromotedT,OPNAME)(derived(), \
1217 typename internal::plain_constant_type<Derived,PromotedT>::type(derived().rows(), derived().cols(), internal::scalar_constant_op<PromotedT>(scalar))); \
1220 #define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHELEFT(METHOD,OPNAME) \
1221 template <typename T> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE friend \
1222 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) \
1223 (METHOD)(const T& scalar, const StorageBaseType& matrix) { \
1224 typedef typename internal::promote_scalar_arg<Scalar,T,EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,T,Scalar)>::type PromotedT; \
1225 return EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(PromotedT,Derived,OPNAME)( \
1226 typename internal::plain_constant_type<Derived,PromotedT>::type(matrix.derived().rows(), matrix.derived().cols(), internal::scalar_constant_op<PromotedT>(scalar)), matrix.derived()); \
1229 #define EIGEN_MAKE_SCALAR_BINARY_OP(METHOD,OPNAME) \
1230 EIGEN_MAKE_SCALAR_BINARY_OP_ONTHELEFT(METHOD,OPNAME) \
1231 EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(METHOD,OPNAME)
1234 #if (defined(_CPPUNWIND) || defined(__EXCEPTIONS)) && !defined(EIGEN_CUDA_ARCH) && !defined(EIGEN_EXCEPTIONS) && !defined(EIGEN_USE_SYCL) && !defined(EIGEN_HIP_DEVICE_COMPILE)
1235 #define EIGEN_EXCEPTIONS
1239 #ifdef EIGEN_EXCEPTIONS
1240 # define EIGEN_THROW_X(X) throw X
1241 # define EIGEN_THROW throw
1242 # define EIGEN_TRY try
1243 # define EIGEN_CATCH(X) catch (X)
1245 # if defined(EIGEN_CUDA_ARCH)
1246 # define EIGEN_THROW_X(X) asm("trap;")
1247 # define EIGEN_THROW asm("trap;")
1248 # elif defined(EIGEN_HIP_DEVICE_COMPILE)
1249 # define EIGEN_THROW_X(X) asm("s_trap 0")
1250 # define EIGEN_THROW asm("s_trap 0")
1252 # define EIGEN_THROW_X(X) std::abort()
1253 # define EIGEN_THROW std::abort()
1255 # define EIGEN_TRY if (true)
1256 # define EIGEN_CATCH(X) else
1260 #define EIGEN_NOEXCEPT noexcept
1261 #define EIGEN_NOEXCEPT_IF(x) noexcept(x)
1262 #define EIGEN_NO_THROW noexcept(true)
1263 #define EIGEN_EXCEPTION_SPEC(X) noexcept(false)
1272 template<
typename T,
typename ...Ts>
1279 #define EIGEN_OVERRIDE override
1280 #define EIGEN_FINAL final
1283 #if defined(SYCL_DEVICE_ONLY)
1284 #if defined(_MSC_VER)
1285 #define EIGEN_UNROLL_LOOP __pragma(unroll)
1287 #define EIGEN_UNROLL_LOOP _Pragma("unroll")
1290 #define EIGEN_UNROLL_LOOP
1295 #if defined(EIGEN_HAS_CXX17_IFCONSTEXPR)
1296 #define EIGEN_IF_CONSTEXPR(X) if constexpr (X)
1298 #define EIGEN_IF_CONSTEXPR(X) if (X)
#define EIGEN_DEVICE_FUNC
Eigen::Triplet< double > T
constexpr void ignore_unused_variable(const T &)