Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
Eigen  3.3.9
Macros.h
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2008-2015 Gael Guennebaud <gael.guennebaud@inria.fr>
5 // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
6 //
7 // This Source Code Form is subject to the terms of the Mozilla
8 // Public License v. 2.0. If a copy of the MPL was not distributed
9 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11 #ifndef EIGEN_MACROS_H
12 #define EIGEN_MACROS_H
13 
14 #define EIGEN_WORLD_VERSION 3
15 #define EIGEN_MAJOR_VERSION 3
16 #define EIGEN_MINOR_VERSION 9
17 
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))))
21 
22 // Compiler identification, EIGEN_COMP_*
23 
25 #ifdef __GNUC__
26  #define EIGEN_COMP_GNUC 1
27 #else
28  #define EIGEN_COMP_GNUC 0
29 #endif
30 
32 #if defined(__clang__)
33  #define EIGEN_COMP_CLANG (__clang_major__*100+__clang_minor__)
34 #else
35  #define EIGEN_COMP_CLANG 0
36 #endif
37 
39 #if defined(__castxml__)
40  #define EIGEN_COMP_CASTXML 1
41 #else
42  #define EIGEN_COMP_CASTXML 0
43 #endif
44 
46 #if defined(__llvm__)
47  #define EIGEN_COMP_LLVM 1
48 #else
49  #define EIGEN_COMP_LLVM 0
50 #endif
51 
53 #if defined(__INTEL_COMPILER)
54  #define EIGEN_COMP_ICC __INTEL_COMPILER
55 #else
56  #define EIGEN_COMP_ICC 0
57 #endif
58 
60 #if defined(__MINGW32__)
61  #define EIGEN_COMP_MINGW 1
62 #else
63  #define EIGEN_COMP_MINGW 0
64 #endif
65 
67 #if defined(__SUNPRO_CC)
68  #define EIGEN_COMP_SUNCC 1
69 #else
70  #define EIGEN_COMP_SUNCC 0
71 #endif
72 
74 #if defined(_MSC_VER)
75  #define EIGEN_COMP_MSVC _MSC_VER
76 #else
77  #define EIGEN_COMP_MSVC 0
78 #endif
79 
80 // For the record, here is a table summarizing the possible values for EIGEN_COMP_MSVC:
81 // name ver MSC_VER
82 // 2008 9 1500
83 // 2010 10 1600
84 // 2012 11 1700
85 // 2013 12 1800
86 // 2015 14 1900
87 // "15" 15 1900
88 
90 #if EIGEN_COMP_MSVC && !(EIGEN_COMP_ICC || EIGEN_COMP_LLVM || EIGEN_COMP_CLANG)
91  #define EIGEN_COMP_MSVC_STRICT _MSC_VER
92 #else
93  #define EIGEN_COMP_MSVC_STRICT 0
94 #endif
95 
97 #if defined(__IBMCPP__) || defined(__xlc__)
98  #define EIGEN_COMP_IBM 1
99 #else
100  #define EIGEN_COMP_IBM 0
101 #endif
102 
104 #if defined(__PGI)
105  #define EIGEN_COMP_PGI 1
106 #else
107  #define EIGEN_COMP_PGI 0
108 #endif
109 
111 #if defined(__CC_ARM) || defined(__ARMCC_VERSION)
112  #define EIGEN_COMP_ARM 1
113 #else
114  #define EIGEN_COMP_ARM 0
115 #endif
116 
118 #if defined(__EMSCRIPTEN__)
119  #define EIGEN_COMP_EMSCRIPTEN 1
120 #else
121  #define EIGEN_COMP_EMSCRIPTEN 0
122 #endif
123 
124 
126 #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)
127  #define EIGEN_COMP_GNUC_STRICT 1
128 #else
129  #define EIGEN_COMP_GNUC_STRICT 0
130 #endif
131 
132 
133 #if EIGEN_COMP_GNUC
134  #define EIGEN_GNUC_AT_LEAST(x,y) ((__GNUC__==x && __GNUC_MINOR__>=y) || __GNUC__>x)
135  #define EIGEN_GNUC_AT_MOST(x,y) ((__GNUC__==x && __GNUC_MINOR__<=y) || __GNUC__<x)
136  #define EIGEN_GNUC_AT(x,y) ( __GNUC__==x && __GNUC_MINOR__==y )
137 #else
138  #define EIGEN_GNUC_AT_LEAST(x,y) 0
139  #define EIGEN_GNUC_AT_MOST(x,y) 0
140  #define EIGEN_GNUC_AT(x,y) 0
141 #endif
142 
143 // FIXME: could probably be removed as we do not support gcc 3.x anymore
144 #if EIGEN_COMP_GNUC && (__GNUC__ <= 3)
145 #define EIGEN_GCC3_OR_OLDER 1
146 #else
147 #define EIGEN_GCC3_OR_OLDER 0
148 #endif
149 
150 
151 // Architecture identification, EIGEN_ARCH_*
152 
153 #if defined(__x86_64__) || defined(_M_X64) || defined(__amd64)
154  #define EIGEN_ARCH_x86_64 1
155 #else
156  #define EIGEN_ARCH_x86_64 0
157 #endif
158 
159 #if defined(__i386__) || defined(_M_IX86) || defined(_X86_) || defined(__i386)
160  #define EIGEN_ARCH_i386 1
161 #else
162  #define EIGEN_ARCH_i386 0
163 #endif
164 
165 #if EIGEN_ARCH_x86_64 || EIGEN_ARCH_i386
166  #define EIGEN_ARCH_i386_OR_x86_64 1
167 #else
168  #define EIGEN_ARCH_i386_OR_x86_64 0
169 #endif
170 
172 #if defined(__arm__)
173  #define EIGEN_ARCH_ARM 1
174 #else
175  #define EIGEN_ARCH_ARM 0
176 #endif
177 
179 #if defined(__aarch64__)
180  #define EIGEN_ARCH_ARM64 1
181 #else
182  #define EIGEN_ARCH_ARM64 0
183 #endif
184 
185 #if EIGEN_ARCH_ARM || EIGEN_ARCH_ARM64
186  #define EIGEN_ARCH_ARM_OR_ARM64 1
187 #else
188  #define EIGEN_ARCH_ARM_OR_ARM64 0
189 #endif
190 
192 #if defined(__mips__) || defined(__mips)
193  #define EIGEN_ARCH_MIPS 1
194 #else
195  #define EIGEN_ARCH_MIPS 0
196 #endif
197 
199 #if defined(__sparc__) || defined(__sparc)
200  #define EIGEN_ARCH_SPARC 1
201 #else
202  #define EIGEN_ARCH_SPARC 0
203 #endif
204 
206 #if defined(__ia64__)
207  #define EIGEN_ARCH_IA64 1
208 #else
209  #define EIGEN_ARCH_IA64 0
210 #endif
211 
213 #if defined(__powerpc__) || defined(__ppc__) || defined(_M_PPC)
214  #define EIGEN_ARCH_PPC 1
215 #else
216  #define EIGEN_ARCH_PPC 0
217 #endif
218 
219 
220 
221 // Operating system identification, EIGEN_OS_*
222 
224 #if defined(__unix__) || defined(__unix)
225  #define EIGEN_OS_UNIX 1
226 #else
227  #define EIGEN_OS_UNIX 0
228 #endif
229 
231 #if defined(__linux__)
232  #define EIGEN_OS_LINUX 1
233 #else
234  #define EIGEN_OS_LINUX 0
235 #endif
236 
238 // note: ANDROID is defined when using ndk_build, __ANDROID__ is defined when using a standalone toolchain.
239 #if defined(__ANDROID__) || defined(ANDROID)
240  #define EIGEN_OS_ANDROID 1
241 #else
242  #define EIGEN_OS_ANDROID 0
243 #endif
244 
246 #if defined(__gnu_linux__) && !(EIGEN_OS_ANDROID)
247  #define EIGEN_OS_GNULINUX 1
248 #else
249  #define EIGEN_OS_GNULINUX 0
250 #endif
251 
253 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__)
254  #define EIGEN_OS_BSD 1
255 #else
256  #define EIGEN_OS_BSD 0
257 #endif
258 
260 #if defined(__APPLE__)
261  #define EIGEN_OS_MAC 1
262 #else
263  #define EIGEN_OS_MAC 0
264 #endif
265 
267 #if defined(__QNX__)
268  #define EIGEN_OS_QNX 1
269 #else
270  #define EIGEN_OS_QNX 0
271 #endif
272 
274 #if defined(_WIN32)
275  #define EIGEN_OS_WIN 1
276 #else
277  #define EIGEN_OS_WIN 0
278 #endif
279 
281 #if defined(_WIN64)
282  #define EIGEN_OS_WIN64 1
283 #else
284  #define EIGEN_OS_WIN64 0
285 #endif
286 
288 #if defined(_WIN32_WCE)
289  #define EIGEN_OS_WINCE 1
290 #else
291  #define EIGEN_OS_WINCE 0
292 #endif
293 
295 #if defined(__CYGWIN__)
296  #define EIGEN_OS_CYGWIN 1
297 #else
298  #define EIGEN_OS_CYGWIN 0
299 #endif
300 
302 #if EIGEN_OS_WIN && !( EIGEN_OS_WINCE || EIGEN_OS_CYGWIN )
303  #define EIGEN_OS_WIN_STRICT 1
304 #else
305  #define EIGEN_OS_WIN_STRICT 0
306 #endif
307 
309 #if (defined(sun) || defined(__sun)) && !(defined(__SVR4) || defined(__svr4__))
310  #define EIGEN_OS_SUN 1
311 #else
312  #define EIGEN_OS_SUN 0
313 #endif
314 
316 #if (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))
317  #define EIGEN_OS_SOLARIS 1
318 #else
319  #define EIGEN_OS_SOLARIS 0
320 #endif
321 
322 
323 
324 #if EIGEN_GNUC_AT_MOST(4,3) && !EIGEN_COMP_CLANG
325  // see bug 89
326  #define EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO 0
327 #else
328  #define EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO 1
329 #endif
330 
331 // This macro can be used to prevent from macro expansion, e.g.:
332 // std::max EIGEN_NOT_A_MACRO(a,b)
333 #define EIGEN_NOT_A_MACRO
334 
335 #ifdef EIGEN_DEFAULT_TO_ROW_MAJOR
336 #define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION Eigen::RowMajor
337 #else
338 #define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION Eigen::ColMajor
339 #endif
340 
341 #ifndef EIGEN_DEFAULT_DENSE_INDEX_TYPE
342 #define EIGEN_DEFAULT_DENSE_INDEX_TYPE std::ptrdiff_t
343 #endif
344 
345 // Cross compiler wrapper around LLVM's __has_builtin
346 #ifdef __has_builtin
347 # define EIGEN_HAS_BUILTIN(x) __has_builtin(x)
348 #else
349 # define EIGEN_HAS_BUILTIN(x) 0
350 #endif
351 
352 // A Clang feature extension to determine compiler features.
353 // We use it to determine 'cxx_rvalue_references'
354 #ifndef __has_feature
355 # define __has_feature(x) 0
356 #endif
357 
358 // Upperbound on the C++ version to use.
359 // Expected values are 03, 11, 14, 17, etc.
360 // By default, let's use an arbitrarily large C++ version.
361 #ifndef EIGEN_MAX_CPP_VER
362 #define EIGEN_MAX_CPP_VER 99
363 #endif
364 
365 #if EIGEN_MAX_CPP_VER>=11 && (defined(__cplusplus) && (__cplusplus >= 201103L) || EIGEN_COMP_MSVC >= 1900)
366 #define EIGEN_HAS_CXX11 1
367 #else
368 #define EIGEN_HAS_CXX11 0
369 #endif
370 
371 
372 // Do we support r-value references?
373 #ifndef EIGEN_HAS_RVALUE_REFERENCES
374 #if EIGEN_MAX_CPP_VER>=11 && \
375  (__has_feature(cxx_rvalue_references) || \
376  (defined(__cplusplus) && __cplusplus >= 201103L) || \
377  (EIGEN_COMP_MSVC >= 1600))
378  #define EIGEN_HAS_RVALUE_REFERENCES 1
379 #else
380  #define EIGEN_HAS_RVALUE_REFERENCES 0
381 #endif
382 #endif
383 
384 // Does the compiler support C99?
385 #ifndef EIGEN_HAS_C99_MATH
386 #if EIGEN_MAX_CPP_VER>=11 && \
387  ((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) \
388  || (defined(__GNUC__) && defined(_GLIBCXX_USE_C99)) \
389  || (defined(_LIBCPP_VERSION) && !defined(_MSC_VER)) \
390  || (EIGEN_COMP_MSVC >= 1900) )
391  #define EIGEN_HAS_C99_MATH 1
392 #else
393  #define EIGEN_HAS_C99_MATH 0
394 #endif
395 #endif
396 
397 // Does the compiler support result_of?
398 #ifndef EIGEN_HAS_STD_RESULT_OF
399 #if EIGEN_MAX_CPP_VER>=11 && ((__has_feature(cxx_lambdas) || (defined(__cplusplus) && __cplusplus >= 201103L)))
400 #define EIGEN_HAS_STD_RESULT_OF 1
401 #else
402 #define EIGEN_HAS_STD_RESULT_OF 0
403 #endif
404 #endif
405 
406 // Does the compiler support type_traits?
407 // - full support of type traits was added only to GCC 5.1.0.
408 // - 20150626 corresponds to the last release of 4.x libstdc++
409 #ifndef EIGEN_HAS_TYPE_TRAITS
410 #if EIGEN_MAX_CPP_VER>=11 && (EIGEN_HAS_CXX11 || EIGEN_COMP_MSVC >= 1700) \
411  && ((!EIGEN_COMP_GNUC_STRICT) || EIGEN_GNUC_AT_LEAST(5, 1)) \
412  && ((!defined(__GLIBCXX__)) || __GLIBCXX__ > 20150626)
413 #define EIGEN_HAS_TYPE_TRAITS 1
414 #define EIGEN_INCLUDE_TYPE_TRAITS
415 #else
416 #define EIGEN_HAS_TYPE_TRAITS 0
417 #endif
418 #endif
419 
420 // Does the compiler support variadic templates?
421 #ifndef EIGEN_HAS_VARIADIC_TEMPLATES
422 #if EIGEN_MAX_CPP_VER>=11 && (__cplusplus > 199711L || EIGEN_COMP_MSVC >= 1900) \
423  && (!defined(__NVCC__) || !EIGEN_ARCH_ARM_OR_ARM64 || (EIGEN_CUDACC_VER >= 80000) )
424  // ^^ Disable the use of variadic templates when compiling with versions of nvcc older than 8.0 on ARM devices:
425  // this prevents nvcc from crashing when compiling Eigen on Tegra X1
426 #define EIGEN_HAS_VARIADIC_TEMPLATES 1
427 #else
428 #define EIGEN_HAS_VARIADIC_TEMPLATES 0
429 #endif
430 #endif
431 
432 // Does the compiler fully support const expressions? (as in c++14)
433 #ifndef EIGEN_HAS_CONSTEXPR
434 
435 #ifdef __CUDACC__
436 // Const expressions are supported provided that c++11 is enabled and we're using either clang or nvcc 7.5 or above
437 #if EIGEN_MAX_CPP_VER>=14 && (__cplusplus > 199711L && (EIGEN_COMP_CLANG || EIGEN_CUDACC_VER >= 70500))
438  #define EIGEN_HAS_CONSTEXPR 1
439 #endif
440 #elif EIGEN_MAX_CPP_VER>=14 && (__has_feature(cxx_relaxed_constexpr) || (defined(__cplusplus) && __cplusplus >= 201402L) || \
441  (EIGEN_GNUC_AT_LEAST(4,8) && (__cplusplus > 199711L)))
442 #define EIGEN_HAS_CONSTEXPR 1
443 #endif
444 
445 #ifndef EIGEN_HAS_CONSTEXPR
446 #define EIGEN_HAS_CONSTEXPR 0
447 #endif
448 
449 #endif
450 
451 // Does the compiler support C++11 math?
452 // Let's be conservative and enable the default C++11 implementation only if we are sure it exists
453 #ifndef EIGEN_HAS_CXX11_MATH
454  #if EIGEN_MAX_CPP_VER>=11 && ((__cplusplus > 201103L) || (__cplusplus >= 201103L) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC || EIGEN_COMP_ICC) \
455  && (EIGEN_ARCH_i386_OR_x86_64) && (EIGEN_OS_GNULINUX || EIGEN_OS_WIN_STRICT || EIGEN_OS_MAC))
456  #define EIGEN_HAS_CXX11_MATH 1
457  #else
458  #define EIGEN_HAS_CXX11_MATH 0
459  #endif
460 #endif
461 
462 // Does the compiler support proper C++11 containers?
463 #ifndef EIGEN_HAS_CXX11_CONTAINERS
464  #if EIGEN_MAX_CPP_VER>=11 && \
465  ((__cplusplus > 201103L) \
466  || ((__cplusplus >= 201103L) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_ICC>=1400)) \
467  || EIGEN_COMP_MSVC >= 1900)
468  #define EIGEN_HAS_CXX11_CONTAINERS 1
469  #else
470  #define EIGEN_HAS_CXX11_CONTAINERS 0
471  #endif
472 #endif
473 
474 // Does the compiler support C++11 noexcept?
475 #ifndef EIGEN_HAS_CXX11_NOEXCEPT
476  #if EIGEN_MAX_CPP_VER>=11 && \
477  (__has_feature(cxx_noexcept) \
478  || (__cplusplus > 201103L) \
479  || ((__cplusplus >= 201103L) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_ICC>=1400)) \
480  || EIGEN_COMP_MSVC >= 1900)
481  #define EIGEN_HAS_CXX11_NOEXCEPT 1
482  #else
483  #define EIGEN_HAS_CXX11_NOEXCEPT 0
484  #endif
485 #endif
486 
492 #ifndef EIGEN_FAST_MATH
493 #define EIGEN_FAST_MATH 1
494 #endif
495 
496 #define EIGEN_DEBUG_VAR(x) std::cerr << #x << " = " << x << std::endl;
497 
498 // concatenate two tokens
499 #define EIGEN_CAT2(a,b) a ## b
500 #define EIGEN_CAT(a,b) EIGEN_CAT2(a,b)
501 
502 #define EIGEN_COMMA ,
503 
504 // convert a token to a string
505 #define EIGEN_MAKESTRING2(a) #a
506 #define EIGEN_MAKESTRING(a) EIGEN_MAKESTRING2(a)
507 
508 // EIGEN_STRONG_INLINE is a stronger version of the inline, using __forceinline on MSVC,
509 // but it still doesn't use GCC's always_inline. This is useful in (common) situations where MSVC needs forceinline
510 // but GCC is still doing fine with just inline.
511 #ifndef EIGEN_STRONG_INLINE
512 #if EIGEN_COMP_MSVC || EIGEN_COMP_ICC
513 #define EIGEN_STRONG_INLINE __forceinline
514 #else
515 #define EIGEN_STRONG_INLINE inline
516 #endif
517 #endif
518 
519 // EIGEN_ALWAYS_INLINE is the stronget, it has the effect of making the function inline and adding every possible
520 // attribute to maximize inlining. This should only be used when really necessary: in particular,
521 // it uses __attribute__((always_inline)) on GCC, which most of the time is useless and can severely harm compile times.
522 // FIXME with the always_inline attribute,
523 // gcc 3.4.x and 4.1 reports the following compilation error:
524 // Eval.h:91: sorry, unimplemented: inlining failed in call to 'const Eigen::Eval<Derived> Eigen::MatrixBase<Scalar, Derived>::eval() const'
525 // : function body not available
526 // See also bug 1367
527 #if EIGEN_GNUC_AT_LEAST(4,2)
528 #define EIGEN_ALWAYS_INLINE __attribute__((always_inline)) inline
529 #else
530 #define EIGEN_ALWAYS_INLINE EIGEN_STRONG_INLINE
531 #endif
532 
533 #if EIGEN_COMP_GNUC
534 #define EIGEN_DONT_INLINE __attribute__((noinline))
535 #elif EIGEN_COMP_MSVC
536 #define EIGEN_DONT_INLINE __declspec(noinline)
537 #else
538 #define EIGEN_DONT_INLINE
539 #endif
540 
541 #if EIGEN_COMP_GNUC
542 #define EIGEN_PERMISSIVE_EXPR __extension__
543 #else
544 #define EIGEN_PERMISSIVE_EXPR
545 #endif
546 
547 // this macro allows to get rid of linking errors about multiply defined functions.
548 // - static is not very good because it prevents definitions from different object files to be merged.
549 // So static causes the resulting linked executable to be bloated with multiple copies of the same function.
550 // - inline is not perfect either as it unwantedly hints the compiler toward inlining the function.
551 #define EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
552 #define EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS inline
553 
554 #ifdef NDEBUG
555 # ifndef EIGEN_NO_DEBUG
556 # define EIGEN_NO_DEBUG
557 # endif
558 #endif
559 
560 // eigen_plain_assert is where we implement the workaround for the assert() bug in GCC <= 4.3, see bug 89
561 #ifdef EIGEN_NO_DEBUG
562  #define eigen_plain_assert(x)
563 #else
564  #if EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO
565  namespace Eigen {
566  namespace internal {
567  inline bool copy_bool(bool b) { return b; }
568  }
569  }
570  #define eigen_plain_assert(x) assert(x)
571  #else
572  // work around bug 89
573  #include <cstdlib> // for abort
574  #include <iostream> // for std::cerr
575 
576  namespace Eigen {
577  namespace internal {
578  // trivial function copying a bool. Must be EIGEN_DONT_INLINE, so we implement it after including Eigen headers.
579  // see bug 89.
580  namespace {
581  EIGEN_DONT_INLINE bool copy_bool(bool b) { return b; }
582  }
583  inline void assert_fail(const char *condition, const char *function, const char *file, int line)
584  {
585  std::cerr << "assertion failed: " << condition << " in function " << function << " at " << file << ":" << line << std::endl;
586  abort();
587  }
588  }
589  }
590  #define eigen_plain_assert(x) \
591  do { \
592  if(!Eigen::internal::copy_bool(x)) \
593  Eigen::internal::assert_fail(EIGEN_MAKESTRING(x), __PRETTY_FUNCTION__, __FILE__, __LINE__); \
594  } while(false)
595  #endif
596 #endif
597 
598 // eigen_assert can be overridden
599 #ifndef eigen_assert
600 #define eigen_assert(x) eigen_plain_assert(x)
601 #endif
602 
603 #ifdef EIGEN_INTERNAL_DEBUGGING
604 #define eigen_internal_assert(x) eigen_assert(x)
605 #else
606 #define eigen_internal_assert(x)
607 #endif
608 
609 #ifdef EIGEN_NO_DEBUG
610 #define EIGEN_ONLY_USED_FOR_DEBUG(x) EIGEN_UNUSED_VARIABLE(x)
611 #else
612 #define EIGEN_ONLY_USED_FOR_DEBUG(x)
613 #endif
614 
615 #ifndef EIGEN_NO_DEPRECATED_WARNING
616  #if EIGEN_COMP_GNUC
617  #define EIGEN_DEPRECATED __attribute__((deprecated))
618  #elif EIGEN_COMP_MSVC
619  #define EIGEN_DEPRECATED __declspec(deprecated)
620  #else
621  #define EIGEN_DEPRECATED
622  #endif
623 #else
624  #define EIGEN_DEPRECATED
625 #endif
626 
627 #if EIGEN_COMP_GNUC
628 #define EIGEN_UNUSED __attribute__((unused))
629 #else
630 #define EIGEN_UNUSED
631 #endif
632 
633 // Suppresses 'unused variable' warnings.
634 namespace Eigen {
635  namespace internal {
636  template<typename T> EIGEN_DEVICE_FUNC void ignore_unused_variable(const T&) {}
637  }
638 }
639 #define EIGEN_UNUSED_VARIABLE(var) Eigen::internal::ignore_unused_variable(var);
640 
641 #if !defined(EIGEN_ASM_COMMENT)
642  #if EIGEN_COMP_GNUC && (EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM_OR_ARM64)
643  #define EIGEN_ASM_COMMENT(X) __asm__("#" X)
644  #else
645  #define EIGEN_ASM_COMMENT(X)
646  #endif
647 #endif
648 
649 
650 //------------------------------------------------------------------------------------------
651 // Static and dynamic alignment control
652 //
653 // The main purpose of this section is to define EIGEN_MAX_ALIGN_BYTES and EIGEN_MAX_STATIC_ALIGN_BYTES
654 // as the maximal boundary in bytes on which dynamically and statically allocated data may be alignment respectively.
655 // The values of EIGEN_MAX_ALIGN_BYTES and EIGEN_MAX_STATIC_ALIGN_BYTES can be specified by the user. If not,
656 // a default value is automatically computed based on architecture, compiler, and OS.
657 //
658 // This section also defines macros EIGEN_ALIGN_TO_BOUNDARY(N) and the shortcuts EIGEN_ALIGN{8,16,32,_MAX}
659 // to be used to declare statically aligned buffers.
660 //------------------------------------------------------------------------------------------
661 
662 
663 /* EIGEN_ALIGN_TO_BOUNDARY(n) forces data to be n-byte aligned. This is used to satisfy SIMD requirements.
664  * However, we do that EVEN if vectorization (EIGEN_VECTORIZE) is disabled,
665  * so that vectorization doesn't affect binary compatibility.
666  *
667  * If we made alignment depend on whether or not EIGEN_VECTORIZE is defined, it would be impossible to link
668  * vectorized and non-vectorized code.
669  */
670 #if (defined __CUDACC__)
671  #define EIGEN_ALIGN_TO_BOUNDARY(n) __align__(n)
672 #elif EIGEN_COMP_GNUC || EIGEN_COMP_PGI || EIGEN_COMP_IBM || EIGEN_COMP_ARM
673  #define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n)))
674 #elif EIGEN_COMP_MSVC
675  #define EIGEN_ALIGN_TO_BOUNDARY(n) __declspec(align(n))
676 #elif EIGEN_COMP_SUNCC
677  // FIXME not sure about this one:
678  #define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n)))
679 #else
680  #error Please tell me what is the equivalent of __attribute__((aligned(n))) for your compiler
681 #endif
682 
683 // If the user explicitly disable vectorization, then we also disable alignment
684 #if defined(EIGEN_DONT_VECTORIZE)
685  #define EIGEN_IDEAL_MAX_ALIGN_BYTES 0
686 #elif defined(EIGEN_VECTORIZE_AVX512)
687  // 64 bytes static alignmeent is preferred only if really required
688  #define EIGEN_IDEAL_MAX_ALIGN_BYTES 64
689 #elif defined(__AVX__)
690  // 32 bytes static alignmeent is preferred only if really required
691  #define EIGEN_IDEAL_MAX_ALIGN_BYTES 32
692 #else
693  #define EIGEN_IDEAL_MAX_ALIGN_BYTES 16
694 #endif
695 
696 
697 // EIGEN_MIN_ALIGN_BYTES defines the minimal value for which the notion of explicit alignment makes sense
698 #define EIGEN_MIN_ALIGN_BYTES 16
699 
700 // Defined the boundary (in bytes) on which the data needs to be aligned. Note
701 // that unless EIGEN_ALIGN is defined and not equal to 0, the data may not be
702 // aligned at all regardless of the value of this #define.
703 
704 #if (defined(EIGEN_DONT_ALIGN_STATICALLY) || defined(EIGEN_DONT_ALIGN)) && defined(EIGEN_MAX_STATIC_ALIGN_BYTES) && EIGEN_MAX_STATIC_ALIGN_BYTES>0
705 #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.
706 #endif
707 
708 // EIGEN_DONT_ALIGN_STATICALLY and EIGEN_DONT_ALIGN are deprectated
709 // They imply EIGEN_MAX_STATIC_ALIGN_BYTES=0
710 #if defined(EIGEN_DONT_ALIGN_STATICALLY) || defined(EIGEN_DONT_ALIGN)
711  #ifdef EIGEN_MAX_STATIC_ALIGN_BYTES
712  #undef EIGEN_MAX_STATIC_ALIGN_BYTES
713  #endif
714  #define EIGEN_MAX_STATIC_ALIGN_BYTES 0
715 #endif
716 
717 #ifndef EIGEN_MAX_STATIC_ALIGN_BYTES
718 
719  // Try to automatically guess what is the best default value for EIGEN_MAX_STATIC_ALIGN_BYTES
720 
721  // 16 byte alignment is only useful for vectorization. Since it affects the ABI, we need to enable
722  // 16 byte alignment on all platforms where vectorization might be enabled. In theory we could always
723  // enable alignment, but it can be a cause of problems on some platforms, so we just disable it in
724  // certain common platform (compiler+architecture combinations) to avoid these problems.
725  // Only static alignment is really problematic (relies on nonstandard compiler extensions),
726  // try to keep heap alignment even when we have to disable static alignment.
727  #if EIGEN_COMP_GNUC && !(EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM_OR_ARM64 || EIGEN_ARCH_IA64)
728  #define EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT 1
729  #elif EIGEN_ARCH_ARM_OR_ARM64 && EIGEN_COMP_GNUC_STRICT && EIGEN_GNUC_AT_MOST(4, 6)
730  // Old versions of GCC on ARM, at least 4.4, were once seen to have buggy static alignment support.
731  // Not sure which version fixed it, hopefully it doesn't affect 4.7, which is still somewhat in use.
732  // 4.8 and newer seem definitely unaffected.
733  #define EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT 1
734  #else
735  #define EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT 0
736  #endif
737 
738  // static alignment is completely disabled with GCC 3, Sun Studio, and QCC/QNX
739  #if !EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT \
740  && !EIGEN_GCC3_OR_OLDER \
741  && !EIGEN_COMP_SUNCC \
742  && !EIGEN_OS_QNX
743  #define EIGEN_ARCH_WANTS_STACK_ALIGNMENT 1
744  #else
745  #define EIGEN_ARCH_WANTS_STACK_ALIGNMENT 0
746  #endif
747 
748  #if EIGEN_ARCH_WANTS_STACK_ALIGNMENT
749  #define EIGEN_MAX_STATIC_ALIGN_BYTES EIGEN_IDEAL_MAX_ALIGN_BYTES
750  #else
751  #define EIGEN_MAX_STATIC_ALIGN_BYTES 0
752  #endif
753 
754 #endif
755 
756 // If EIGEN_MAX_ALIGN_BYTES is defined, then it is considered as an upper bound for EIGEN_MAX_ALIGN_BYTES
757 #if defined(EIGEN_MAX_ALIGN_BYTES) && EIGEN_MAX_ALIGN_BYTES<EIGEN_MAX_STATIC_ALIGN_BYTES
758 #undef EIGEN_MAX_STATIC_ALIGN_BYTES
759 #define EIGEN_MAX_STATIC_ALIGN_BYTES EIGEN_MAX_ALIGN_BYTES
760 #endif
761 
762 #if EIGEN_MAX_STATIC_ALIGN_BYTES==0 && !defined(EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT)
763  #define EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT
764 #endif
765 
766 // At this stage, EIGEN_MAX_STATIC_ALIGN_BYTES>0 is the true test whether we want to align arrays on the stack or not.
767 // It takes into account both the user choice to explicitly enable/disable alignment (by settting EIGEN_MAX_STATIC_ALIGN_BYTES)
768 // and the architecture config (EIGEN_ARCH_WANTS_STACK_ALIGNMENT).
769 // Henceforth, only EIGEN_MAX_STATIC_ALIGN_BYTES should be used.
770 
771 
772 // Shortcuts to EIGEN_ALIGN_TO_BOUNDARY
773 #define EIGEN_ALIGN8 EIGEN_ALIGN_TO_BOUNDARY(8)
774 #define EIGEN_ALIGN16 EIGEN_ALIGN_TO_BOUNDARY(16)
775 #define EIGEN_ALIGN32 EIGEN_ALIGN_TO_BOUNDARY(32)
776 #define EIGEN_ALIGN64 EIGEN_ALIGN_TO_BOUNDARY(64)
777 #if EIGEN_MAX_STATIC_ALIGN_BYTES>0
778 #define EIGEN_ALIGN_MAX EIGEN_ALIGN_TO_BOUNDARY(EIGEN_MAX_STATIC_ALIGN_BYTES)
779 #else
780 #define EIGEN_ALIGN_MAX
781 #endif
782 
783 
784 // Dynamic alignment control
785 
786 #if defined(EIGEN_DONT_ALIGN) && defined(EIGEN_MAX_ALIGN_BYTES) && EIGEN_MAX_ALIGN_BYTES>0
787 #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.
788 #endif
789 
790 #ifdef EIGEN_DONT_ALIGN
791  #ifdef EIGEN_MAX_ALIGN_BYTES
792  #undef EIGEN_MAX_ALIGN_BYTES
793  #endif
794  #define EIGEN_MAX_ALIGN_BYTES 0
795 #elif !defined(EIGEN_MAX_ALIGN_BYTES)
796  #define EIGEN_MAX_ALIGN_BYTES EIGEN_IDEAL_MAX_ALIGN_BYTES
797 #endif
798 
799 #if EIGEN_IDEAL_MAX_ALIGN_BYTES > EIGEN_MAX_ALIGN_BYTES
800 #define EIGEN_DEFAULT_ALIGN_BYTES EIGEN_IDEAL_MAX_ALIGN_BYTES
801 #else
802 #define EIGEN_DEFAULT_ALIGN_BYTES EIGEN_MAX_ALIGN_BYTES
803 #endif
804 
805 
806 #ifndef EIGEN_UNALIGNED_VECTORIZE
807 #define EIGEN_UNALIGNED_VECTORIZE 1
808 #endif
809 
810 //----------------------------------------------------------------------
811 
812 
813 #ifdef EIGEN_DONT_USE_RESTRICT_KEYWORD
814  #define EIGEN_RESTRICT
815 #endif
816 #ifndef EIGEN_RESTRICT
817  #define EIGEN_RESTRICT __restrict
818 #endif
819 
820 #ifndef EIGEN_STACK_ALLOCATION_LIMIT
821 // 131072 == 128 KB
822 #define EIGEN_STACK_ALLOCATION_LIMIT 131072
823 #endif
824 
825 #ifndef EIGEN_DEFAULT_IO_FORMAT
826 #ifdef EIGEN_MAKING_DOCS
827 // format used in Eigen's documentation
828 // needed to define it here as escaping characters in CMake add_definition's argument seems very problematic.
829 #define EIGEN_DEFAULT_IO_FORMAT Eigen::IOFormat(3, 0, " ", "\n", "", "")
830 #else
831 #define EIGEN_DEFAULT_IO_FORMAT Eigen::IOFormat()
832 #endif
833 #endif
834 
835 // just an empty macro !
836 #define EIGEN_EMPTY
837 
838 #if EIGEN_COMP_MSVC_STRICT && (EIGEN_COMP_MSVC < 1900 || EIGEN_CUDACC_VER>0)
839  // for older MSVC versions, as well as 1900 && CUDA 8, using the base operator is sufficient (cf Bugs 1000, 1324)
840  #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
841  using Base::operator =;
842 #elif EIGEN_COMP_CLANG // workaround clang bug (see http://forum.kde.org/viewtopic.php?f=74&t=102653)
843  #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
844  using Base::operator =; \
845  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) { Base::operator=(other); return *this; } \
846  template <typename OtherDerived> \
847  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const DenseBase<OtherDerived>& other) { Base::operator=(other.derived()); return *this; }
848 #else
849  #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
850  using Base::operator =; \
851  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) \
852  { \
853  Base::operator=(other); \
854  return *this; \
855  }
856 #endif
857 
858 
864 #if EIGEN_HAS_CXX11
865 #define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS) EIGEN_DEVICE_FUNC CLASS(const CLASS&) = default;
866 #else
867 #define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS)
868 #endif
869 
870 
871 
877 #define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived) \
878  EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
879  EIGEN_DEFAULT_COPY_CONSTRUCTOR(Derived)
880 
888 #if EIGEN_HAS_CXX11
889 #define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived) \
890  EIGEN_DEVICE_FUNC Derived() = default; \
891  EIGEN_DEVICE_FUNC ~Derived() = default;
892 #else
893 #define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived) \
894  EIGEN_DEVICE_FUNC Derived() {}; \
895  /* EIGEN_DEVICE_FUNC ~Derived() {}; */
896 #endif
897 
898 
899 
900 
901 
910 #define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) \
911  typedef typename Eigen::internal::traits<Derived>::Scalar Scalar; \
912  typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; \
913  typedef typename Base::CoeffReturnType CoeffReturnType; \
914  typedef typename Eigen::internal::ref_selector<Derived>::type Nested; \
915  typedef typename Eigen::internal::traits<Derived>::StorageKind StorageKind; \
916  typedef typename Eigen::internal::traits<Derived>::StorageIndex StorageIndex; \
917  enum { RowsAtCompileTime = Eigen::internal::traits<Derived>::RowsAtCompileTime, \
918  ColsAtCompileTime = Eigen::internal::traits<Derived>::ColsAtCompileTime, \
919  Flags = Eigen::internal::traits<Derived>::Flags, \
920  SizeAtCompileTime = Base::SizeAtCompileTime, \
921  MaxSizeAtCompileTime = Base::MaxSizeAtCompileTime, \
922  IsVectorAtCompileTime = Base::IsVectorAtCompileTime }; \
923  using Base::derived; \
924  using Base::const_cast_derived;
925 
926 
927 // FIXME Maybe the EIGEN_DENSE_PUBLIC_INTERFACE could be removed as importing PacketScalar is rarely needed
928 #define EIGEN_DENSE_PUBLIC_INTERFACE(Derived) \
929  EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) \
930  typedef typename Base::PacketScalar PacketScalar;
931 
932 
933 #define EIGEN_PLAIN_ENUM_MIN(a,b) (((int)a <= (int)b) ? (int)a : (int)b)
934 #define EIGEN_PLAIN_ENUM_MAX(a,b) (((int)a >= (int)b) ? (int)a : (int)b)
935 
936 // EIGEN_SIZE_MIN_PREFER_DYNAMIC gives the min between compile-time sizes. 0 has absolute priority, followed by 1,
937 // followed by Dynamic, followed by other finite values. The reason for giving Dynamic the priority over
938 // finite values is that min(3, Dynamic) should be Dynamic, since that could be anything between 0 and 3.
939 #define EIGEN_SIZE_MIN_PREFER_DYNAMIC(a,b) (((int)a == 0 || (int)b == 0) ? 0 \
940  : ((int)a == 1 || (int)b == 1) ? 1 \
941  : ((int)a == Dynamic || (int)b == Dynamic) ? Dynamic \
942  : ((int)a <= (int)b) ? (int)a : (int)b)
943 
944 // EIGEN_SIZE_MIN_PREFER_FIXED is a variant of EIGEN_SIZE_MIN_PREFER_DYNAMIC comparing MaxSizes. The difference is that finite values
945 // now have priority over Dynamic, so that min(3, Dynamic) gives 3. Indeed, whatever the actual value is
946 // (between 0 and 3), it is not more than 3.
947 #define EIGEN_SIZE_MIN_PREFER_FIXED(a,b) (((int)a == 0 || (int)b == 0) ? 0 \
948  : ((int)a == 1 || (int)b == 1) ? 1 \
949  : ((int)a == Dynamic && (int)b == Dynamic) ? Dynamic \
950  : ((int)a == Dynamic) ? (int)b \
951  : ((int)b == Dynamic) ? (int)a \
952  : ((int)a <= (int)b) ? (int)a : (int)b)
953 
954 // see EIGEN_SIZE_MIN_PREFER_DYNAMIC. No need for a separate variant for MaxSizes here.
955 #define EIGEN_SIZE_MAX(a,b) (((int)a == Dynamic || (int)b == Dynamic) ? Dynamic \
956  : ((int)a >= (int)b) ? (int)a : (int)b)
957 
958 #define EIGEN_LOGICAL_XOR(a,b) (((a) || (b)) && !((a) && (b)))
959 
960 #define EIGEN_IMPLIES(a,b) (!(a) || (b))
961 
962 // the expression type of a standard coefficient wise binary operation
963 #define EIGEN_CWISE_BINARY_RETURN_TYPE(LHS,RHS,OPNAME) \
964  CwiseBinaryOp< \
965  EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)< \
966  typename internal::traits<LHS>::Scalar, \
967  typename internal::traits<RHS>::Scalar \
968  >, \
969  const LHS, \
970  const RHS \
971  >
972 
973 #define EIGEN_MAKE_CWISE_BINARY_OP(METHOD,OPNAME) \
974  template<typename OtherDerived> \
975  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE(Derived,OtherDerived,OPNAME) \
976  (METHOD)(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const \
977  { \
978  return EIGEN_CWISE_BINARY_RETURN_TYPE(Derived,OtherDerived,OPNAME)(derived(), other.derived()); \
979  }
980 
981 #define EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,TYPEA,TYPEB) \
982  (Eigen::internal::has_ReturnType<Eigen::ScalarBinaryOpTraits<TYPEA,TYPEB,EIGEN_CAT(EIGEN_CAT(Eigen::internal::scalar_,OPNAME),_op)<TYPEA,TYPEB> > >::value)
983 
984 #define EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(EXPR,SCALAR,OPNAME) \
985  CwiseBinaryOp<EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)<typename internal::traits<EXPR>::Scalar,SCALAR>, const EXPR, \
986  const typename internal::plain_constant_type<EXPR,SCALAR>::type>
987 
988 #define EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(SCALAR,EXPR,OPNAME) \
989  CwiseBinaryOp<EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)<SCALAR,typename internal::traits<EXPR>::Scalar>, \
990  const typename internal::plain_constant_type<EXPR,SCALAR>::type, const EXPR>
991 
992 // Workaround for MSVC 2010 (see ML thread "patch with compile for for MSVC 2010")
993 #if EIGEN_COMP_MSVC_STRICT<=1600
994 #define EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(X) typename internal::enable_if<true,X>::type
995 #else
996 #define EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(X) X
997 #endif
998 
999 #define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(METHOD,OPNAME) \
1000  template <typename T> EIGEN_DEVICE_FUNC inline \
1001  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))\
1002  (METHOD)(const T& scalar) const { \
1003  typedef typename internal::promote_scalar_arg<Scalar,T,EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,Scalar,T)>::type PromotedT; \
1004  return EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Derived,PromotedT,OPNAME)(derived(), \
1005  typename internal::plain_constant_type<Derived,PromotedT>::type(derived().rows(), derived().cols(), internal::scalar_constant_op<PromotedT>(scalar))); \
1006  }
1007 
1008 #define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHELEFT(METHOD,OPNAME) \
1009  template <typename T> EIGEN_DEVICE_FUNC inline friend \
1010  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)) \
1011  (METHOD)(const T& scalar, const StorageBaseType& matrix) { \
1012  typedef typename internal::promote_scalar_arg<Scalar,T,EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,T,Scalar)>::type PromotedT; \
1013  return EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(PromotedT,Derived,OPNAME)( \
1014  typename internal::plain_constant_type<Derived,PromotedT>::type(matrix.derived().rows(), matrix.derived().cols(), internal::scalar_constant_op<PromotedT>(scalar)), matrix.derived()); \
1015  }
1016 
1017 #define EIGEN_MAKE_SCALAR_BINARY_OP(METHOD,OPNAME) \
1018  EIGEN_MAKE_SCALAR_BINARY_OP_ONTHELEFT(METHOD,OPNAME) \
1019  EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(METHOD,OPNAME)
1020 
1021 
1022 #ifdef EIGEN_EXCEPTIONS
1023 # define EIGEN_THROW_X(X) throw X
1024 # define EIGEN_THROW throw
1025 # define EIGEN_TRY try
1026 # define EIGEN_CATCH(X) catch (X)
1027 #else
1028 # ifdef __CUDA_ARCH__
1029 # define EIGEN_THROW_X(X) asm("trap;")
1030 # define EIGEN_THROW asm("trap;")
1031 # else
1032 # define EIGEN_THROW_X(X) std::abort()
1033 # define EIGEN_THROW std::abort()
1034 # endif
1035 # define EIGEN_TRY if (true)
1036 # define EIGEN_CATCH(X) else
1037 #endif
1038 
1039 
1040 #if EIGEN_HAS_CXX11_NOEXCEPT
1041 # define EIGEN_INCLUDE_TYPE_TRAITS
1042 # define EIGEN_NOEXCEPT noexcept
1043 # define EIGEN_NOEXCEPT_IF(x) noexcept(x)
1044 # define EIGEN_NO_THROW noexcept(true)
1045 # define EIGEN_EXCEPTION_SPEC(X) noexcept(false)
1046 #else
1047 # define EIGEN_NOEXCEPT
1048 # define EIGEN_NOEXCEPT_IF(x)
1049 # define EIGEN_NO_THROW throw()
1050 # if EIGEN_COMP_MSVC
1051  // MSVC does not support exception specifications (warning C4290),
1052  // and they are deprecated in c++11 anyway.
1053 # define EIGEN_EXCEPTION_SPEC(X) throw()
1054 # else
1055 # define EIGEN_EXCEPTION_SPEC(X) throw(X)
1056 # endif
1057 #endif
1058 
1059 #endif // EIGEN_MACROS_H
Namespace containing all symbols from the Eigen library.
Definition: Core:309
Definition: Eigen_Colamd.h:50