00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef EIGEN_MACROS_H
00027 #define EIGEN_MACROS_H
00028
00029 #undef minor
00030
00031 #define EIGEN_WORLD_VERSION 2
00032 #define EIGEN_MAJOR_VERSION 0
00033 #define EIGEN_MINOR_VERSION 16
00034
00035 #define EIGEN_VERSION_AT_LEAST(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \
00036 (EIGEN_MAJOR_VERSION>y || (EIGEN_MAJOR_VERSION>=y && \
00037 EIGEN_MINOR_VERSION>=z))))
00038
00039
00040
00041
00042 #if defined(__GNUC__) && !(defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__ppc__) || defined(__ia64__))
00043 #define EIGEN_GCC_AND_ARCH_DOESNT_WANT_ALIGNMENT 1
00044 #else
00045 #define EIGEN_GCC_AND_ARCH_DOESNT_WANT_ALIGNMENT 0
00046 #endif
00047
00048 #if defined(__GNUC__) && (__GNUC__ <= 3)
00049 #define EIGEN_GCC3_OR_OLDER 1
00050 #else
00051 #define EIGEN_GCC3_OR_OLDER 0
00052 #endif
00053
00054
00055 #if !EIGEN_GCC_AND_ARCH_DOESNT_WANT_ALIGNMENT && !EIGEN_GCC3_OR_OLDER && !defined(__SUNPRO_CC) && !defined(__QNXNTO__)
00056 #define EIGEN_ARCH_WANTS_ALIGNMENT 1
00057 #else
00058 #define EIGEN_ARCH_WANTS_ALIGNMENT 0
00059 #endif
00060
00061
00062
00063 #if EIGEN_ARCH_WANTS_ALIGNMENT && !defined(EIGEN_DONT_ALIGN)
00064 #define EIGEN_ALIGN 1
00065 #else
00066 #define EIGEN_ALIGN 0
00067 #ifdef EIGEN_VECTORIZE
00068 #error "Vectorization enabled, but our platform checks say that we don't do 16 byte alignment on this platform. If you added vectorization for another architecture, you also need to edit this platform check."
00069 #endif
00070 #ifndef EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT
00071 #define EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT
00072 #endif
00073 #endif
00074
00075 #ifdef EIGEN_DEFAULT_TO_ROW_MAJOR
00076 #define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION RowMajor
00077 #else
00078 #define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION ColMajor
00079 #endif
00080
00085 #ifndef EIGEN_UNROLLING_LIMIT
00086 #define EIGEN_UNROLLING_LIMIT 100
00087 #endif
00088
00094 #ifndef EIGEN_TUNE_FOR_CPU_CACHE_SIZE
00095 #define EIGEN_TUNE_FOR_CPU_CACHE_SIZE (sizeof(float)*256*256)
00096 #endif
00097
00098
00099 #ifdef EIGEN_TUNE_FOR_L2_CACHE_SIZE
00100 #error EIGEN_TUNE_FOR_L2_CACHE_SIZE is now called EIGEN_TUNE_FOR_CPU_CACHE_SIZE.
00101 #endif
00102
00103 #define USING_PART_OF_NAMESPACE_EIGEN \
00104 EIGEN_USING_MATRIX_TYPEDEFS \
00105 using Eigen::Matrix; \
00106 using Eigen::MatrixBase; \
00107 using Eigen::ei_random; \
00108 using Eigen::ei_real; \
00109 using Eigen::ei_imag; \
00110 using Eigen::ei_conj; \
00111 using Eigen::ei_abs; \
00112 using Eigen::ei_abs2; \
00113 using Eigen::ei_sqrt; \
00114 using Eigen::ei_exp; \
00115 using Eigen::ei_log; \
00116 using Eigen::ei_sin; \
00117 using Eigen::ei_cos;
00118
00119 #ifdef NDEBUG
00120 # ifndef EIGEN_NO_DEBUG
00121 # define EIGEN_NO_DEBUG
00122 # endif
00123 #endif
00124
00125 #ifndef ei_assert
00126 #ifdef EIGEN_NO_DEBUG
00127 #define ei_assert(x)
00128 #else
00129 #define ei_assert(x) assert(x)
00130 #endif
00131 #endif
00132
00133 #ifdef EIGEN_INTERNAL_DEBUGGING
00134 #define ei_internal_assert(x) ei_assert(x)
00135 #else
00136 #define ei_internal_assert(x)
00137 #endif
00138
00139 #ifdef EIGEN_NO_DEBUG
00140 #define EIGEN_ONLY_USED_FOR_DEBUG(x) (void)x
00141 #else
00142 #define EIGEN_ONLY_USED_FOR_DEBUG(x)
00143 #endif
00144
00145
00146
00147
00148
00149
00150
00151 #if EIGEN_GNUC_AT_LEAST(4,0)
00152 #define EIGEN_ALWAYS_INLINE_ATTRIB __attribute__((always_inline))
00153 #else
00154 #define EIGEN_ALWAYS_INLINE_ATTRIB
00155 #endif
00156
00157
00158 #if (defined _MSC_VER)
00159 #define EIGEN_STRONG_INLINE __forceinline
00160 #else
00161 #define EIGEN_STRONG_INLINE inline
00162 #endif
00163
00164 #if (defined __GNUC__)
00165 #define EIGEN_DONT_INLINE __attribute__((noinline))
00166 #elif (defined _MSC_VER)
00167 #define EIGEN_DONT_INLINE __declspec(noinline)
00168 #else
00169 #define EIGEN_DONT_INLINE
00170 #endif
00171
00172 #if (defined __GNUC__)
00173 #define EIGEN_DEPRECATED __attribute__((deprecated))
00174 #elif (defined _MSC_VER)
00175 #define EIGEN_DEPRECATED __declspec(deprecated)
00176 #else
00177 #define EIGEN_DEPRECATED
00178 #endif
00179
00180
00181
00182
00183
00184
00185
00186 #if !EIGEN_ALIGN
00187 #define EIGEN_ALIGN_128
00188 #elif (defined __GNUC__)
00189 #define EIGEN_ALIGN_128 __attribute__((aligned(16)))
00190 #elif (defined _MSC_VER)
00191 #define EIGEN_ALIGN_128 __declspec(align(16))
00192 #else
00193 #error Please tell me what is the equivalent of __attribute__((aligned(16))) for your compiler
00194 #endif
00195
00196 #ifdef EIGEN_DONT_USE_RESTRICT_KEYWORD
00197 #define EIGEN_RESTRICT
00198 #endif
00199 #ifndef EIGEN_RESTRICT
00200 #define EIGEN_RESTRICT __restrict
00201 #endif
00202
00203 #ifndef EIGEN_STACK_ALLOCATION_LIMIT
00204 #define EIGEN_STACK_ALLOCATION_LIMIT 1000000
00205 #endif
00206
00207 #ifndef EIGEN_DEFAULT_IO_FORMAT
00208 #define EIGEN_DEFAULT_IO_FORMAT Eigen::IOFormat()
00209 #endif
00210
00211
00212
00213 #define EIGEN_DOCS_IO_FORMAT IOFormat(3, AlignCols, " ", "\n", "", "")
00214
00215 #define EIGEN_INHERIT_ASSIGNMENT_OPERATOR(Derived, Op) \
00216 template<typename OtherDerived> \
00217 EIGEN_STRONG_INLINE Derived& operator Op(const Eigen::MatrixBase<OtherDerived>& other) \
00218 { \
00219 return Base::operator Op(other.derived()); \
00220 } \
00221 EIGEN_STRONG_INLINE Derived& operator Op(const Derived& other) \
00222 { \
00223 return Base::operator Op(other); \
00224 }
00225
00226 #define EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, Op) \
00227 template<typename Other> \
00228 EIGEN_STRONG_INLINE Derived& operator Op(const Other& scalar) \
00229 { \
00230 return Base::operator Op(scalar); \
00231 }
00232
00233 #define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived) \
00234 EIGEN_INHERIT_ASSIGNMENT_OPERATOR(Derived, =) \
00235 EIGEN_INHERIT_ASSIGNMENT_OPERATOR(Derived, +=) \
00236 EIGEN_INHERIT_ASSIGNMENT_OPERATOR(Derived, -=) \
00237 EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, *=) \
00238 EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, /=)
00239
00240 #define _EIGEN_GENERIC_PUBLIC_INTERFACE(Derived, BaseClass) \
00241 typedef BaseClass Base; \
00242 typedef typename Eigen::ei_traits<Derived>::Scalar Scalar; \
00243 typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; \
00244 typedef typename Base::PacketScalar PacketScalar; \
00245 typedef typename Eigen::ei_nested<Derived>::type Nested; \
00246 enum { RowsAtCompileTime = Eigen::ei_traits<Derived>::RowsAtCompileTime, \
00247 ColsAtCompileTime = Eigen::ei_traits<Derived>::ColsAtCompileTime, \
00248 MaxRowsAtCompileTime = Eigen::ei_traits<Derived>::MaxRowsAtCompileTime, \
00249 MaxColsAtCompileTime = Eigen::ei_traits<Derived>::MaxColsAtCompileTime, \
00250 Flags = Eigen::ei_traits<Derived>::Flags, \
00251 CoeffReadCost = Eigen::ei_traits<Derived>::CoeffReadCost, \
00252 SizeAtCompileTime = Base::SizeAtCompileTime, \
00253 MaxSizeAtCompileTime = Base::MaxSizeAtCompileTime, \
00254 IsVectorAtCompileTime = Base::IsVectorAtCompileTime };
00255
00256 #define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) \
00257 _EIGEN_GENERIC_PUBLIC_INTERFACE(Derived, Eigen::MatrixBase<Derived>)
00258
00259 #define EIGEN_ENUM_MIN(a,b) (((int)a <= (int)b) ? (int)a : (int)b)
00260 #define EIGEN_SIZE_MIN(a,b) (((int)a == 1 || (int)b == 1) ? 1 \
00261 : ((int)a == Dynamic || (int)b == Dynamic) ? Dynamic \
00262 : ((int)a <= (int)b) ? (int)a : (int)b)
00263 #define EIGEN_ENUM_MAX(a,b) (((int)a >= (int)b) ? (int)a : (int)b)
00264
00265
00266 #define EIGEN_EMPTY
00267
00268
00269 #define EIGEN_CAT2(a,b) a ## b
00270 #define EIGEN_CAT(a,b) EIGEN_CAT2(a,b)
00271
00272
00273 #define EIGEN_MAKESTRING2(a) #a
00274 #define EIGEN_MAKESTRING(a) EIGEN_MAKESTRING2(a)
00275
00276 #endif // EIGEN_MACROS_H