tomoto 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (347) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/README.md +8 -10
  4. data/ext/tomoto/extconf.rb +6 -2
  5. data/ext/tomoto/{ext.cpp → tomoto.cpp} +1 -1
  6. data/lib/tomoto/version.rb +1 -1
  7. data/lib/tomoto.rb +5 -1
  8. data/vendor/EigenRand/EigenRand/Core.h +10 -10
  9. data/vendor/EigenRand/EigenRand/Dists/Basic.h +208 -9
  10. data/vendor/EigenRand/EigenRand/Dists/Discrete.h +52 -31
  11. data/vendor/EigenRand/EigenRand/Dists/GammaPoisson.h +9 -8
  12. data/vendor/EigenRand/EigenRand/Dists/NormalExp.h +28 -21
  13. data/vendor/EigenRand/EigenRand/EigenRand +11 -6
  14. data/vendor/EigenRand/EigenRand/Macro.h +13 -7
  15. data/vendor/EigenRand/EigenRand/MorePacketMath.h +348 -740
  16. data/vendor/EigenRand/EigenRand/MvDists/Multinomial.h +5 -3
  17. data/vendor/EigenRand/EigenRand/MvDists/MvNormal.h +9 -3
  18. data/vendor/EigenRand/EigenRand/PacketFilter.h +11 -253
  19. data/vendor/EigenRand/EigenRand/PacketRandomEngine.h +21 -47
  20. data/vendor/EigenRand/EigenRand/RandUtils.h +50 -344
  21. data/vendor/EigenRand/EigenRand/arch/AVX/MorePacketMath.h +619 -0
  22. data/vendor/EigenRand/EigenRand/arch/AVX/PacketFilter.h +149 -0
  23. data/vendor/EigenRand/EigenRand/arch/AVX/RandUtils.h +228 -0
  24. data/vendor/EigenRand/EigenRand/arch/NEON/MorePacketMath.h +473 -0
  25. data/vendor/EigenRand/EigenRand/arch/NEON/PacketFilter.h +142 -0
  26. data/vendor/EigenRand/EigenRand/arch/NEON/RandUtils.h +126 -0
  27. data/vendor/EigenRand/EigenRand/arch/SSE/MorePacketMath.h +501 -0
  28. data/vendor/EigenRand/EigenRand/arch/SSE/PacketFilter.h +133 -0
  29. data/vendor/EigenRand/EigenRand/arch/SSE/RandUtils.h +120 -0
  30. data/vendor/EigenRand/EigenRand/doc.h +24 -12
  31. data/vendor/EigenRand/README.md +57 -4
  32. data/vendor/eigen/COPYING.APACHE +203 -0
  33. data/vendor/eigen/COPYING.BSD +1 -1
  34. data/vendor/eigen/COPYING.MINPACK +51 -52
  35. data/vendor/eigen/Eigen/Cholesky +0 -1
  36. data/vendor/eigen/Eigen/Core +112 -265
  37. data/vendor/eigen/Eigen/Eigenvalues +2 -3
  38. data/vendor/eigen/Eigen/Geometry +5 -8
  39. data/vendor/eigen/Eigen/Householder +0 -1
  40. data/vendor/eigen/Eigen/Jacobi +0 -1
  41. data/vendor/eigen/Eigen/KLUSupport +41 -0
  42. data/vendor/eigen/Eigen/LU +2 -5
  43. data/vendor/eigen/Eigen/OrderingMethods +0 -3
  44. data/vendor/eigen/Eigen/PaStiXSupport +1 -0
  45. data/vendor/eigen/Eigen/PardisoSupport +0 -0
  46. data/vendor/eigen/Eigen/QR +2 -3
  47. data/vendor/eigen/Eigen/QtAlignedMalloc +0 -1
  48. data/vendor/eigen/Eigen/SVD +0 -1
  49. data/vendor/eigen/Eigen/Sparse +0 -2
  50. data/vendor/eigen/Eigen/SparseCholesky +0 -8
  51. data/vendor/eigen/Eigen/SparseLU +4 -0
  52. data/vendor/eigen/Eigen/SparseQR +0 -1
  53. data/vendor/eigen/Eigen/src/Cholesky/LDLT.h +42 -27
  54. data/vendor/eigen/Eigen/src/Cholesky/LLT.h +39 -23
  55. data/vendor/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +90 -47
  56. data/vendor/eigen/Eigen/src/Core/ArithmeticSequence.h +413 -0
  57. data/vendor/eigen/Eigen/src/Core/Array.h +99 -11
  58. data/vendor/eigen/Eigen/src/Core/ArrayBase.h +3 -3
  59. data/vendor/eigen/Eigen/src/Core/ArrayWrapper.h +21 -21
  60. data/vendor/eigen/Eigen/src/Core/Assign.h +1 -1
  61. data/vendor/eigen/Eigen/src/Core/AssignEvaluator.h +125 -50
  62. data/vendor/eigen/Eigen/src/Core/Assign_MKL.h +10 -10
  63. data/vendor/eigen/Eigen/src/Core/BandMatrix.h +16 -16
  64. data/vendor/eigen/Eigen/src/Core/Block.h +56 -60
  65. data/vendor/eigen/Eigen/src/Core/BooleanRedux.h +29 -31
  66. data/vendor/eigen/Eigen/src/Core/CommaInitializer.h +7 -3
  67. data/vendor/eigen/Eigen/src/Core/CoreEvaluators.h +325 -272
  68. data/vendor/eigen/Eigen/src/Core/CoreIterators.h +5 -0
  69. data/vendor/eigen/Eigen/src/Core/CwiseBinaryOp.h +21 -22
  70. data/vendor/eigen/Eigen/src/Core/CwiseNullaryOp.h +153 -18
  71. data/vendor/eigen/Eigen/src/Core/CwiseUnaryOp.h +6 -6
  72. data/vendor/eigen/Eigen/src/Core/CwiseUnaryView.h +14 -10
  73. data/vendor/eigen/Eigen/src/Core/DenseBase.h +132 -42
  74. data/vendor/eigen/Eigen/src/Core/DenseCoeffsBase.h +25 -21
  75. data/vendor/eigen/Eigen/src/Core/DenseStorage.h +153 -71
  76. data/vendor/eigen/Eigen/src/Core/Diagonal.h +21 -23
  77. data/vendor/eigen/Eigen/src/Core/DiagonalMatrix.h +50 -2
  78. data/vendor/eigen/Eigen/src/Core/DiagonalProduct.h +1 -1
  79. data/vendor/eigen/Eigen/src/Core/Dot.h +10 -10
  80. data/vendor/eigen/Eigen/src/Core/EigenBase.h +10 -9
  81. data/vendor/eigen/Eigen/src/Core/ForceAlignedAccess.h +8 -4
  82. data/vendor/eigen/Eigen/src/Core/Fuzzy.h +3 -3
  83. data/vendor/eigen/Eigen/src/Core/GeneralProduct.h +20 -10
  84. data/vendor/eigen/Eigen/src/Core/GenericPacketMath.h +599 -152
  85. data/vendor/eigen/Eigen/src/Core/GlobalFunctions.h +40 -33
  86. data/vendor/eigen/Eigen/src/Core/IO.h +40 -7
  87. data/vendor/eigen/Eigen/src/Core/IndexedView.h +237 -0
  88. data/vendor/eigen/Eigen/src/Core/Inverse.h +9 -10
  89. data/vendor/eigen/Eigen/src/Core/Map.h +7 -7
  90. data/vendor/eigen/Eigen/src/Core/MapBase.h +10 -3
  91. data/vendor/eigen/Eigen/src/Core/MathFunctions.h +767 -125
  92. data/vendor/eigen/Eigen/src/Core/MathFunctionsImpl.h +118 -19
  93. data/vendor/eigen/Eigen/src/Core/Matrix.h +131 -25
  94. data/vendor/eigen/Eigen/src/Core/MatrixBase.h +21 -3
  95. data/vendor/eigen/Eigen/src/Core/NestByValue.h +25 -50
  96. data/vendor/eigen/Eigen/src/Core/NoAlias.h +4 -3
  97. data/vendor/eigen/Eigen/src/Core/NumTraits.h +107 -20
  98. data/vendor/eigen/Eigen/src/Core/PartialReduxEvaluator.h +232 -0
  99. data/vendor/eigen/Eigen/src/Core/PermutationMatrix.h +3 -31
  100. data/vendor/eigen/Eigen/src/Core/PlainObjectBase.h +152 -59
  101. data/vendor/eigen/Eigen/src/Core/Product.h +30 -25
  102. data/vendor/eigen/Eigen/src/Core/ProductEvaluators.h +192 -125
  103. data/vendor/eigen/Eigen/src/Core/Random.h +37 -1
  104. data/vendor/eigen/Eigen/src/Core/Redux.h +180 -170
  105. data/vendor/eigen/Eigen/src/Core/Ref.h +121 -23
  106. data/vendor/eigen/Eigen/src/Core/Replicate.h +8 -8
  107. data/vendor/eigen/Eigen/src/Core/Reshaped.h +454 -0
  108. data/vendor/eigen/Eigen/src/Core/ReturnByValue.h +7 -5
  109. data/vendor/eigen/Eigen/src/Core/Reverse.h +18 -12
  110. data/vendor/eigen/Eigen/src/Core/Select.h +8 -6
  111. data/vendor/eigen/Eigen/src/Core/SelfAdjointView.h +33 -20
  112. data/vendor/eigen/Eigen/src/Core/Solve.h +14 -14
  113. data/vendor/eigen/Eigen/src/Core/SolveTriangular.h +16 -16
  114. data/vendor/eigen/Eigen/src/Core/SolverBase.h +41 -3
  115. data/vendor/eigen/Eigen/src/Core/StableNorm.h +100 -70
  116. data/vendor/eigen/Eigen/src/Core/StlIterators.h +463 -0
  117. data/vendor/eigen/Eigen/src/Core/Stride.h +9 -4
  118. data/vendor/eigen/Eigen/src/Core/Swap.h +5 -4
  119. data/vendor/eigen/Eigen/src/Core/Transpose.h +88 -27
  120. data/vendor/eigen/Eigen/src/Core/Transpositions.h +26 -47
  121. data/vendor/eigen/Eigen/src/Core/TriangularMatrix.h +93 -75
  122. data/vendor/eigen/Eigen/src/Core/VectorBlock.h +5 -5
  123. data/vendor/eigen/Eigen/src/Core/VectorwiseOp.h +159 -70
  124. data/vendor/eigen/Eigen/src/Core/Visitor.h +137 -29
  125. data/vendor/eigen/Eigen/src/Core/arch/AVX/Complex.h +50 -129
  126. data/vendor/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +126 -337
  127. data/vendor/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +1092 -155
  128. data/vendor/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +65 -1
  129. data/vendor/eigen/Eigen/src/Core/arch/AVX512/Complex.h +422 -0
  130. data/vendor/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +207 -236
  131. data/vendor/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1482 -495
  132. data/vendor/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +89 -0
  133. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +152 -165
  134. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +19 -251
  135. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2937 -0
  136. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +221 -0
  137. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +629 -0
  138. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +2042 -392
  139. data/vendor/eigen/Eigen/src/Core/arch/CUDA/Complex.h +235 -80
  140. data/vendor/eigen/Eigen/src/Core/arch/Default/BFloat16.h +700 -0
  141. data/vendor/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +102 -14
  142. data/vendor/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1649 -0
  143. data/vendor/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +110 -0
  144. data/vendor/eigen/Eigen/src/Core/arch/Default/Half.h +942 -0
  145. data/vendor/eigen/Eigen/src/Core/arch/Default/Settings.h +1 -1
  146. data/vendor/eigen/Eigen/src/Core/arch/Default/TypeCasting.h +120 -0
  147. data/vendor/eigen/Eigen/src/Core/arch/{CUDA → GPU}/MathFunctions.h +16 -4
  148. data/vendor/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +1685 -0
  149. data/vendor/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +80 -0
  150. data/vendor/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
  151. data/vendor/eigen/Eigen/src/Core/arch/MSA/Complex.h +648 -0
  152. data/vendor/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +387 -0
  153. data/vendor/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +1233 -0
  154. data/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h +313 -219
  155. data/vendor/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +183 -0
  156. data/vendor/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +54 -70
  157. data/vendor/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +4376 -549
  158. data/vendor/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +1419 -0
  159. data/vendor/eigen/Eigen/src/Core/arch/SSE/Complex.h +59 -179
  160. data/vendor/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +65 -428
  161. data/vendor/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +893 -283
  162. data/vendor/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +65 -0
  163. data/vendor/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +44 -0
  164. data/vendor/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +752 -0
  165. data/vendor/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +49 -0
  166. data/vendor/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +232 -0
  167. data/vendor/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +301 -0
  168. data/vendor/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +670 -0
  169. data/vendor/eigen/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +694 -0
  170. data/vendor/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +85 -0
  171. data/vendor/eigen/Eigen/src/Core/arch/ZVector/Complex.h +212 -183
  172. data/vendor/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +101 -5
  173. data/vendor/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +510 -395
  174. data/vendor/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +11 -2
  175. data/vendor/eigen/Eigen/src/Core/functors/BinaryFunctors.h +112 -46
  176. data/vendor/eigen/Eigen/src/Core/functors/NullaryFunctors.h +31 -30
  177. data/vendor/eigen/Eigen/src/Core/functors/StlFunctors.h +32 -2
  178. data/vendor/eigen/Eigen/src/Core/functors/UnaryFunctors.h +355 -16
  179. data/vendor/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1075 -586
  180. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +49 -24
  181. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +41 -35
  182. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +6 -6
  183. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +4 -2
  184. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +382 -483
  185. data/vendor/eigen/Eigen/src/Core/products/Parallelizer.h +22 -5
  186. data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +53 -30
  187. data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +16 -8
  188. data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +8 -6
  189. data/vendor/eigen/Eigen/src/Core/products/SelfadjointProduct.h +4 -4
  190. data/vendor/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +5 -4
  191. data/vendor/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +33 -27
  192. data/vendor/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +14 -12
  193. data/vendor/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +36 -34
  194. data/vendor/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +8 -4
  195. data/vendor/eigen/Eigen/src/Core/products/TriangularSolverVector.h +13 -10
  196. data/vendor/eigen/Eigen/src/Core/util/BlasUtil.h +304 -119
  197. data/vendor/eigen/Eigen/src/Core/util/ConfigureVectorization.h +512 -0
  198. data/vendor/eigen/Eigen/src/Core/util/Constants.h +25 -9
  199. data/vendor/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +26 -3
  200. data/vendor/eigen/Eigen/src/Core/util/ForwardDeclarations.h +29 -9
  201. data/vendor/eigen/Eigen/src/Core/util/IndexedViewHelper.h +186 -0
  202. data/vendor/eigen/Eigen/src/Core/util/IntegralConstant.h +272 -0
  203. data/vendor/eigen/Eigen/src/Core/util/MKL_support.h +8 -1
  204. data/vendor/eigen/Eigen/src/Core/util/Macros.h +709 -246
  205. data/vendor/eigen/Eigen/src/Core/util/Memory.h +222 -52
  206. data/vendor/eigen/Eigen/src/Core/util/Meta.h +355 -77
  207. data/vendor/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +5 -1
  208. data/vendor/eigen/Eigen/src/Core/util/ReshapedHelper.h +51 -0
  209. data/vendor/eigen/Eigen/src/Core/util/StaticAssert.h +8 -5
  210. data/vendor/eigen/Eigen/src/Core/util/SymbolicIndex.h +293 -0
  211. data/vendor/eigen/Eigen/src/Core/util/XprHelper.h +65 -30
  212. data/vendor/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +1 -1
  213. data/vendor/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +7 -4
  214. data/vendor/eigen/Eigen/src/Eigenvalues/EigenSolver.h +2 -2
  215. data/vendor/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +1 -1
  216. data/vendor/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +2 -2
  217. data/vendor/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +2 -2
  218. data/vendor/eigen/Eigen/src/Eigenvalues/RealQZ.h +9 -6
  219. data/vendor/eigen/Eigen/src/Eigenvalues/RealSchur.h +21 -9
  220. data/vendor/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +77 -43
  221. data/vendor/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +20 -15
  222. data/vendor/eigen/Eigen/src/Geometry/AlignedBox.h +99 -5
  223. data/vendor/eigen/Eigen/src/Geometry/AngleAxis.h +4 -4
  224. data/vendor/eigen/Eigen/src/Geometry/EulerAngles.h +3 -3
  225. data/vendor/eigen/Eigen/src/Geometry/Homogeneous.h +15 -11
  226. data/vendor/eigen/Eigen/src/Geometry/Hyperplane.h +1 -1
  227. data/vendor/eigen/Eigen/src/Geometry/OrthoMethods.h +3 -2
  228. data/vendor/eigen/Eigen/src/Geometry/ParametrizedLine.h +39 -2
  229. data/vendor/eigen/Eigen/src/Geometry/Quaternion.h +70 -14
  230. data/vendor/eigen/Eigen/src/Geometry/Rotation2D.h +3 -3
  231. data/vendor/eigen/Eigen/src/Geometry/Scaling.h +23 -5
  232. data/vendor/eigen/Eigen/src/Geometry/Transform.h +88 -67
  233. data/vendor/eigen/Eigen/src/Geometry/Translation.h +6 -12
  234. data/vendor/eigen/Eigen/src/Geometry/Umeyama.h +1 -1
  235. data/vendor/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +168 -0
  236. data/vendor/eigen/Eigen/src/Householder/BlockHouseholder.h +9 -2
  237. data/vendor/eigen/Eigen/src/Householder/Householder.h +8 -4
  238. data/vendor/eigen/Eigen/src/Householder/HouseholderSequence.h +123 -48
  239. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +15 -15
  240. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +7 -23
  241. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +5 -22
  242. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +41 -47
  243. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +51 -60
  244. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +70 -20
  245. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +2 -20
  246. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +11 -9
  247. data/vendor/eigen/Eigen/src/Jacobi/Jacobi.h +31 -10
  248. data/vendor/eigen/Eigen/src/KLUSupport/KLUSupport.h +358 -0
  249. data/vendor/eigen/Eigen/src/LU/Determinant.h +35 -19
  250. data/vendor/eigen/Eigen/src/LU/FullPivLU.h +29 -43
  251. data/vendor/eigen/Eigen/src/LU/InverseImpl.h +25 -8
  252. data/vendor/eigen/Eigen/src/LU/PartialPivLU.h +71 -58
  253. data/vendor/eigen/Eigen/src/LU/arch/InverseSize4.h +351 -0
  254. data/vendor/eigen/Eigen/src/OrderingMethods/Amd.h +7 -17
  255. data/vendor/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +297 -277
  256. data/vendor/eigen/Eigen/src/OrderingMethods/Ordering.h +6 -10
  257. data/vendor/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +1 -1
  258. data/vendor/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +9 -7
  259. data/vendor/eigen/Eigen/src/QR/ColPivHouseholderQR.h +41 -20
  260. data/vendor/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +100 -27
  261. data/vendor/eigen/Eigen/src/QR/FullPivHouseholderQR.h +59 -22
  262. data/vendor/eigen/Eigen/src/QR/HouseholderQR.h +48 -23
  263. data/vendor/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +25 -3
  264. data/vendor/eigen/Eigen/src/SVD/BDCSVD.h +183 -63
  265. data/vendor/eigen/Eigen/src/SVD/JacobiSVD.h +22 -14
  266. data/vendor/eigen/Eigen/src/SVD/SVDBase.h +83 -22
  267. data/vendor/eigen/Eigen/src/SVD/UpperBidiagonalization.h +3 -3
  268. data/vendor/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +17 -9
  269. data/vendor/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +12 -37
  270. data/vendor/eigen/Eigen/src/SparseCore/AmbiVector.h +3 -2
  271. data/vendor/eigen/Eigen/src/SparseCore/CompressedStorage.h +16 -0
  272. data/vendor/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +6 -6
  273. data/vendor/eigen/Eigen/src/SparseCore/SparseAssign.h +81 -27
  274. data/vendor/eigen/Eigen/src/SparseCore/SparseBlock.h +25 -57
  275. data/vendor/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +40 -11
  276. data/vendor/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +11 -15
  277. data/vendor/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +4 -2
  278. data/vendor/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +30 -8
  279. data/vendor/eigen/Eigen/src/SparseCore/SparseMatrix.h +126 -11
  280. data/vendor/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +5 -12
  281. data/vendor/eigen/Eigen/src/SparseCore/SparseProduct.h +13 -1
  282. data/vendor/eigen/Eigen/src/SparseCore/SparseRef.h +7 -7
  283. data/vendor/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +5 -2
  284. data/vendor/eigen/Eigen/src/SparseCore/SparseUtil.h +8 -0
  285. data/vendor/eigen/Eigen/src/SparseCore/SparseVector.h +1 -1
  286. data/vendor/eigen/Eigen/src/SparseCore/SparseView.h +1 -0
  287. data/vendor/eigen/Eigen/src/SparseLU/SparseLU.h +162 -12
  288. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +1 -1
  289. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +76 -2
  290. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +2 -2
  291. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +1 -1
  292. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +1 -1
  293. data/vendor/eigen/Eigen/src/SparseQR/SparseQR.h +19 -6
  294. data/vendor/eigen/Eigen/src/StlSupport/StdDeque.h +2 -12
  295. data/vendor/eigen/Eigen/src/StlSupport/StdList.h +2 -2
  296. data/vendor/eigen/Eigen/src/StlSupport/StdVector.h +2 -2
  297. data/vendor/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +6 -8
  298. data/vendor/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +175 -39
  299. data/vendor/eigen/Eigen/src/misc/lapacke.h +5 -4
  300. data/vendor/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +28 -2
  301. data/vendor/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +155 -11
  302. data/vendor/eigen/Eigen/src/plugins/BlockMethods.h +626 -242
  303. data/vendor/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.h +14 -0
  304. data/vendor/eigen/Eigen/src/plugins/IndexedViewMethods.h +262 -0
  305. data/vendor/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +4 -4
  306. data/vendor/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +10 -0
  307. data/vendor/eigen/Eigen/src/plugins/ReshapedMethods.h +149 -0
  308. data/vendor/eigen/README.md +2 -0
  309. data/vendor/eigen/bench/btl/README +1 -1
  310. data/vendor/eigen/bench/tensors/README +6 -7
  311. data/vendor/eigen/ci/README.md +56 -0
  312. data/vendor/eigen/demos/mix_eigen_and_c/README +1 -1
  313. data/vendor/eigen/unsupported/Eigen/CXX11/src/Tensor/README.md +213 -158
  314. data/vendor/eigen/unsupported/README.txt +1 -1
  315. data/vendor/tomotopy/README.kr.rst +21 -0
  316. data/vendor/tomotopy/README.rst +20 -0
  317. data/vendor/tomotopy/src/Labeling/FoRelevance.cpp +2 -2
  318. data/vendor/tomotopy/src/Labeling/Phraser.hpp +1 -1
  319. data/vendor/tomotopy/src/TopicModel/CTModel.hpp +2 -1
  320. data/vendor/tomotopy/src/TopicModel/DMRModel.hpp +2 -1
  321. data/vendor/tomotopy/src/TopicModel/DTModel.hpp +1 -1
  322. data/vendor/tomotopy/src/TopicModel/GDMRModel.hpp +2 -2
  323. data/vendor/tomotopy/src/TopicModel/HDP.h +1 -0
  324. data/vendor/tomotopy/src/TopicModel/HDPModel.hpp +53 -2
  325. data/vendor/tomotopy/src/TopicModel/HLDAModel.hpp +1 -1
  326. data/vendor/tomotopy/src/TopicModel/HPAModel.hpp +1 -0
  327. data/vendor/tomotopy/src/TopicModel/LDACVB0Model.hpp +2 -2
  328. data/vendor/tomotopy/src/TopicModel/LDAModel.hpp +16 -5
  329. data/vendor/tomotopy/src/TopicModel/LLDAModel.hpp +1 -0
  330. data/vendor/tomotopy/src/TopicModel/MGLDAModel.hpp +1 -0
  331. data/vendor/tomotopy/src/TopicModel/PLDAModel.hpp +1 -0
  332. data/vendor/tomotopy/src/TopicModel/PT.h +3 -1
  333. data/vendor/tomotopy/src/TopicModel/PTModel.hpp +31 -1
  334. data/vendor/tomotopy/src/TopicModel/SLDAModel.hpp +2 -2
  335. data/vendor/tomotopy/src/TopicModel/TopicModel.hpp +7 -5
  336. data/vendor/tomotopy/src/Utils/EigenAddonOps.hpp +36 -1
  337. data/vendor/tomotopy/src/Utils/exception.h +6 -0
  338. data/vendor/tomotopy/src/Utils/sample.hpp +14 -12
  339. data/vendor/tomotopy/src/Utils/sse_gamma.h +0 -3
  340. metadata +60 -14
  341. data/vendor/eigen/Eigen/CMakeLists.txt +0 -19
  342. data/vendor/eigen/Eigen/src/Core/arch/CUDA/Half.h +0 -674
  343. data/vendor/eigen/Eigen/src/Core/arch/CUDA/PacketMath.h +0 -333
  344. data/vendor/eigen/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +0 -1124
  345. data/vendor/eigen/Eigen/src/Core/arch/CUDA/TypeCasting.h +0 -212
  346. data/vendor/eigen/Eigen/src/Geometry/arch/Geometry_SSE.h +0 -161
  347. data/vendor/eigen/Eigen/src/LU/arch/Inverse_SSE.h +0 -338
@@ -14,7 +14,7 @@
14
14
  #define EIGEN_COREEVALUATORS_H
15
15
 
16
16
  namespace Eigen {
17
-
17
+
18
18
  namespace internal {
19
19
 
20
20
  // This class returns the evaluator kind from the expression storage kind.
@@ -63,8 +63,8 @@ template< typename T,
63
63
  template< typename T,
64
64
  typename Kind = typename evaluator_traits<typename T::NestedExpression>::Kind,
65
65
  typename Scalar = typename T::Scalar> struct unary_evaluator;
66
-
67
- // evaluator_traits<T> contains traits for evaluator<T>
66
+
67
+ // evaluator_traits<T> contains traits for evaluator<T>
68
68
 
69
69
  template<typename T>
70
70
  struct evaluator_traits_base
@@ -90,7 +90,8 @@ template<typename T>
90
90
  struct evaluator : public unary_evaluator<T>
91
91
  {
92
92
  typedef unary_evaluator<T> Base;
93
- EIGEN_DEVICE_FUNC explicit evaluator(const T& xpr) : Base(xpr) {}
93
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
94
+ explicit evaluator(const T& xpr) : Base(xpr) {}
94
95
  };
95
96
 
96
97
 
@@ -99,21 +100,29 @@ template<typename T>
99
100
  struct evaluator<const T>
100
101
  : evaluator<T>
101
102
  {
102
- EIGEN_DEVICE_FUNC
103
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
103
104
  explicit evaluator(const T& xpr) : evaluator<T>(xpr) {}
104
105
  };
105
106
 
106
107
  // ---------- base class for all evaluators ----------
107
108
 
108
109
  template<typename ExpressionType>
109
- struct evaluator_base : public noncopyable
110
+ struct evaluator_base
110
111
  {
111
112
  // TODO that's not very nice to have to propagate all these traits. They are currently only needed to handle outer,inner indices.
112
113
  typedef traits<ExpressionType> ExpressionTraits;
113
-
114
+
114
115
  enum {
115
116
  Alignment = 0
116
117
  };
118
+ // noncopyable:
119
+ // Don't make this class inherit noncopyable as this kills EBO (Empty Base Optimization)
120
+ // and make complex evaluator much larger than then should do.
121
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE evaluator_base() {}
122
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ~evaluator_base() {}
123
+ private:
124
+ EIGEN_DEVICE_FUNC evaluator_base(const evaluator_base&);
125
+ EIGEN_DEVICE_FUNC const evaluator_base& operator=(const evaluator_base&);
117
126
  };
118
127
 
119
128
  // -------------------- Matrix and Array --------------------
@@ -123,6 +132,33 @@ struct evaluator_base : public noncopyable
123
132
  // Here we directly specialize evaluator. This is not really a unary expression, and it is, by definition, dense,
124
133
  // so no need for more sophisticated dispatching.
125
134
 
135
+ // this helper permits to completely eliminate m_outerStride if it is known at compiletime.
136
+ template<typename Scalar,int OuterStride> class plainobjectbase_evaluator_data {
137
+ public:
138
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
139
+ plainobjectbase_evaluator_data(const Scalar* ptr, Index outerStride) : data(ptr)
140
+ {
141
+ #ifndef EIGEN_INTERNAL_DEBUGGING
142
+ EIGEN_UNUSED_VARIABLE(outerStride);
143
+ #endif
144
+ eigen_internal_assert(outerStride==OuterStride);
145
+ }
146
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
147
+ Index outerStride() const EIGEN_NOEXCEPT { return OuterStride; }
148
+ const Scalar *data;
149
+ };
150
+
151
+ template<typename Scalar> class plainobjectbase_evaluator_data<Scalar,Dynamic> {
152
+ public:
153
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
154
+ plainobjectbase_evaluator_data(const Scalar* ptr, Index outerStride) : data(ptr), m_outerStride(outerStride) {}
155
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
156
+ Index outerStride() const { return m_outerStride; }
157
+ const Scalar *data;
158
+ protected:
159
+ Index m_outerStride;
160
+ };
161
+
126
162
  template<typename Derived>
127
163
  struct evaluator<PlainObjectBase<Derived> >
128
164
  : evaluator_base<Derived>
@@ -136,23 +172,28 @@ struct evaluator<PlainObjectBase<Derived> >
136
172
  IsVectorAtCompileTime = PlainObjectType::IsVectorAtCompileTime,
137
173
  RowsAtCompileTime = PlainObjectType::RowsAtCompileTime,
138
174
  ColsAtCompileTime = PlainObjectType::ColsAtCompileTime,
139
-
175
+
140
176
  CoeffReadCost = NumTraits<Scalar>::ReadCost,
141
177
  Flags = traits<Derived>::EvaluatorFlags,
142
178
  Alignment = traits<Derived>::Alignment
143
179
  };
144
-
145
- EIGEN_DEVICE_FUNC evaluator()
146
- : m_data(0),
147
- m_outerStride(IsVectorAtCompileTime ? 0
148
- : int(IsRowMajor) ? ColsAtCompileTime
149
- : RowsAtCompileTime)
180
+ enum {
181
+ // We do not need to know the outer stride for vectors
182
+ OuterStrideAtCompileTime = IsVectorAtCompileTime ? 0
183
+ : int(IsRowMajor) ? ColsAtCompileTime
184
+ : RowsAtCompileTime
185
+ };
186
+
187
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
188
+ evaluator()
189
+ : m_d(0,OuterStrideAtCompileTime)
150
190
  {
151
191
  EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
152
192
  }
153
-
154
- EIGEN_DEVICE_FUNC explicit evaluator(const PlainObjectType& m)
155
- : m_data(m.data()), m_outerStride(IsVectorAtCompileTime ? 0 : m.outerStride())
193
+
194
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
195
+ explicit evaluator(const PlainObjectType& m)
196
+ : m_d(m.data(),IsVectorAtCompileTime ? 0 : m.outerStride())
156
197
  {
157
198
  EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
158
199
  }
@@ -161,30 +202,30 @@ struct evaluator<PlainObjectBase<Derived> >
161
202
  CoeffReturnType coeff(Index row, Index col) const
162
203
  {
163
204
  if (IsRowMajor)
164
- return m_data[row * m_outerStride.value() + col];
205
+ return m_d.data[row * m_d.outerStride() + col];
165
206
  else
166
- return m_data[row + col * m_outerStride.value()];
207
+ return m_d.data[row + col * m_d.outerStride()];
167
208
  }
168
209
 
169
210
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
170
211
  CoeffReturnType coeff(Index index) const
171
212
  {
172
- return m_data[index];
213
+ return m_d.data[index];
173
214
  }
174
215
 
175
216
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
176
217
  Scalar& coeffRef(Index row, Index col)
177
218
  {
178
219
  if (IsRowMajor)
179
- return const_cast<Scalar*>(m_data)[row * m_outerStride.value() + col];
220
+ return const_cast<Scalar*>(m_d.data)[row * m_d.outerStride() + col];
180
221
  else
181
- return const_cast<Scalar*>(m_data)[row + col * m_outerStride.value()];
222
+ return const_cast<Scalar*>(m_d.data)[row + col * m_d.outerStride()];
182
223
  }
183
224
 
184
225
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
185
226
  Scalar& coeffRef(Index index)
186
227
  {
187
- return const_cast<Scalar*>(m_data)[index];
228
+ return const_cast<Scalar*>(m_d.data)[index];
188
229
  }
189
230
 
190
231
  template<int LoadMode, typename PacketType>
@@ -192,16 +233,16 @@ struct evaluator<PlainObjectBase<Derived> >
192
233
  PacketType packet(Index row, Index col) const
193
234
  {
194
235
  if (IsRowMajor)
195
- return ploadt<PacketType, LoadMode>(m_data + row * m_outerStride.value() + col);
236
+ return ploadt<PacketType, LoadMode>(m_d.data + row * m_d.outerStride() + col);
196
237
  else
197
- return ploadt<PacketType, LoadMode>(m_data + row + col * m_outerStride.value());
238
+ return ploadt<PacketType, LoadMode>(m_d.data + row + col * m_d.outerStride());
198
239
  }
199
240
 
200
241
  template<int LoadMode, typename PacketType>
201
242
  EIGEN_STRONG_INLINE
202
243
  PacketType packet(Index index) const
203
244
  {
204
- return ploadt<PacketType, LoadMode>(m_data + index);
245
+ return ploadt<PacketType, LoadMode>(m_d.data + index);
205
246
  }
206
247
 
207
248
  template<int StoreMode,typename PacketType>
@@ -210,26 +251,22 @@ struct evaluator<PlainObjectBase<Derived> >
210
251
  {
211
252
  if (IsRowMajor)
212
253
  return pstoret<Scalar, PacketType, StoreMode>
213
- (const_cast<Scalar*>(m_data) + row * m_outerStride.value() + col, x);
254
+ (const_cast<Scalar*>(m_d.data) + row * m_d.outerStride() + col, x);
214
255
  else
215
256
  return pstoret<Scalar, PacketType, StoreMode>
216
- (const_cast<Scalar*>(m_data) + row + col * m_outerStride.value(), x);
257
+ (const_cast<Scalar*>(m_d.data) + row + col * m_d.outerStride(), x);
217
258
  }
218
259
 
219
260
  template<int StoreMode, typename PacketType>
220
261
  EIGEN_STRONG_INLINE
221
262
  void writePacket(Index index, const PacketType& x)
222
263
  {
223
- return pstoret<Scalar, PacketType, StoreMode>(const_cast<Scalar*>(m_data) + index, x);
264
+ return pstoret<Scalar, PacketType, StoreMode>(const_cast<Scalar*>(m_d.data) + index, x);
224
265
  }
225
266
 
226
267
  protected:
227
- const Scalar *m_data;
228
268
 
229
- // We do not need to know the outer stride for vectors
230
- variable_if_dynamic<Index, IsVectorAtCompileTime ? 0
231
- : int(IsRowMajor) ? ColsAtCompileTime
232
- : RowsAtCompileTime> m_outerStride;
269
+ plainobjectbase_evaluator_data<Scalar,OuterStrideAtCompileTime> m_d;
233
270
  };
234
271
 
235
272
  template<typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
@@ -237,11 +274,13 @@ struct evaluator<Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> >
237
274
  : evaluator<PlainObjectBase<Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> > >
238
275
  {
239
276
  typedef Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> XprType;
240
-
241
- EIGEN_DEVICE_FUNC evaluator() {}
242
277
 
243
- EIGEN_DEVICE_FUNC explicit evaluator(const XprType& m)
244
- : evaluator<PlainObjectBase<XprType> >(m)
278
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
279
+ evaluator() {}
280
+
281
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
282
+ explicit evaluator(const XprType& m)
283
+ : evaluator<PlainObjectBase<XprType> >(m)
245
284
  { }
246
285
  };
247
286
 
@@ -251,10 +290,12 @@ struct evaluator<Array<Scalar, Rows, Cols, Options, MaxRows, MaxCols> >
251
290
  {
252
291
  typedef Array<Scalar, Rows, Cols, Options, MaxRows, MaxCols> XprType;
253
292
 
254
- EIGEN_DEVICE_FUNC evaluator() {}
255
-
256
- EIGEN_DEVICE_FUNC explicit evaluator(const XprType& m)
257
- : evaluator<PlainObjectBase<XprType> >(m)
293
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
294
+ evaluator() {}
295
+
296
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
297
+ explicit evaluator(const XprType& m)
298
+ : evaluator<PlainObjectBase<XprType> >(m)
258
299
  { }
259
300
  };
260
301
 
@@ -265,14 +306,15 @@ struct unary_evaluator<Transpose<ArgType>, IndexBased>
265
306
  : evaluator_base<Transpose<ArgType> >
266
307
  {
267
308
  typedef Transpose<ArgType> XprType;
268
-
309
+
269
310
  enum {
270
- CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
311
+ CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
271
312
  Flags = evaluator<ArgType>::Flags ^ RowMajorBit,
272
313
  Alignment = evaluator<ArgType>::Alignment
273
314
  };
274
315
 
275
- EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& t) : m_argImpl(t.nestedExpression()) {}
316
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
317
+ explicit unary_evaluator(const XprType& t) : m_argImpl(t.nestedExpression()) {}
276
318
 
277
319
  typedef typename XprType::Scalar Scalar;
278
320
  typedef typename XprType::CoeffReturnType CoeffReturnType;
@@ -457,10 +499,10 @@ struct evaluator<CwiseNullaryOp<NullaryOp,PlainObjectType> >
457
499
  {
458
500
  typedef CwiseNullaryOp<NullaryOp,PlainObjectType> XprType;
459
501
  typedef typename internal::remove_all<PlainObjectType>::type PlainObjectTypeCleaned;
460
-
502
+
461
503
  enum {
462
504
  CoeffReadCost = internal::functor_traits<NullaryOp>::Cost,
463
-
505
+
464
506
  Flags = (evaluator<PlainObjectTypeCleaned>::Flags
465
507
  & ( HereditaryBits
466
508
  | (functor_has_linear_access<NullaryOp>::ret ? LinearAccessBit : 0)
@@ -517,19 +559,17 @@ struct unary_evaluator<CwiseUnaryOp<UnaryOp, ArgType>, IndexBased >
517
559
  : evaluator_base<CwiseUnaryOp<UnaryOp, ArgType> >
518
560
  {
519
561
  typedef CwiseUnaryOp<UnaryOp, ArgType> XprType;
520
-
562
+
521
563
  enum {
522
- CoeffReadCost = evaluator<ArgType>::CoeffReadCost + functor_traits<UnaryOp>::Cost,
523
-
564
+ CoeffReadCost = int(evaluator<ArgType>::CoeffReadCost) + int(functor_traits<UnaryOp>::Cost),
565
+
524
566
  Flags = evaluator<ArgType>::Flags
525
567
  & (HereditaryBits | LinearAccessBit | (functor_traits<UnaryOp>::PacketAccess ? PacketAccessBit : 0)),
526
568
  Alignment = evaluator<ArgType>::Alignment
527
569
  };
528
570
 
529
571
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
530
- explicit unary_evaluator(const XprType& op)
531
- : m_functor(op.functor()),
532
- m_argImpl(op.nestedExpression())
572
+ explicit unary_evaluator(const XprType& op) : m_d(op)
533
573
  {
534
574
  EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<UnaryOp>::Cost);
535
575
  EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
@@ -540,32 +580,43 @@ struct unary_evaluator<CwiseUnaryOp<UnaryOp, ArgType>, IndexBased >
540
580
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
541
581
  CoeffReturnType coeff(Index row, Index col) const
542
582
  {
543
- return m_functor(m_argImpl.coeff(row, col));
583
+ return m_d.func()(m_d.argImpl.coeff(row, col));
544
584
  }
545
585
 
546
586
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
547
587
  CoeffReturnType coeff(Index index) const
548
588
  {
549
- return m_functor(m_argImpl.coeff(index));
589
+ return m_d.func()(m_d.argImpl.coeff(index));
550
590
  }
551
591
 
552
592
  template<int LoadMode, typename PacketType>
553
593
  EIGEN_STRONG_INLINE
554
594
  PacketType packet(Index row, Index col) const
555
595
  {
556
- return m_functor.packetOp(m_argImpl.template packet<LoadMode, PacketType>(row, col));
596
+ return m_d.func().packetOp(m_d.argImpl.template packet<LoadMode, PacketType>(row, col));
557
597
  }
558
598
 
559
599
  template<int LoadMode, typename PacketType>
560
600
  EIGEN_STRONG_INLINE
561
601
  PacketType packet(Index index) const
562
602
  {
563
- return m_functor.packetOp(m_argImpl.template packet<LoadMode, PacketType>(index));
603
+ return m_d.func().packetOp(m_d.argImpl.template packet<LoadMode, PacketType>(index));
564
604
  }
565
605
 
566
606
  protected:
567
- const UnaryOp m_functor;
568
- evaluator<ArgType> m_argImpl;
607
+
608
+ // this helper permits to completely eliminate the functor if it is empty
609
+ struct Data
610
+ {
611
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
612
+ Data(const XprType& xpr) : op(xpr.functor()), argImpl(xpr.nestedExpression()) {}
613
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
614
+ const UnaryOp& func() const { return op; }
615
+ UnaryOp op;
616
+ evaluator<ArgType> argImpl;
617
+ };
618
+
619
+ Data m_d;
569
620
  };
570
621
 
571
622
  // -------------------- CwiseTernaryOp --------------------
@@ -577,7 +628,7 @@ struct evaluator<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3> >
577
628
  {
578
629
  typedef CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3> XprType;
579
630
  typedef ternary_evaluator<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3> > Base;
580
-
631
+
581
632
  EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) : Base(xpr) {}
582
633
  };
583
634
 
@@ -586,10 +637,10 @@ struct ternary_evaluator<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3>, IndexBased
586
637
  : evaluator_base<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3> >
587
638
  {
588
639
  typedef CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3> XprType;
589
-
640
+
590
641
  enum {
591
- CoeffReadCost = evaluator<Arg1>::CoeffReadCost + evaluator<Arg2>::CoeffReadCost + evaluator<Arg3>::CoeffReadCost + functor_traits<TernaryOp>::Cost,
592
-
642
+ CoeffReadCost = int(evaluator<Arg1>::CoeffReadCost) + int(evaluator<Arg2>::CoeffReadCost) + int(evaluator<Arg3>::CoeffReadCost) + int(functor_traits<TernaryOp>::Cost),
643
+
593
644
  Arg1Flags = evaluator<Arg1>::Flags,
594
645
  Arg2Flags = evaluator<Arg2>::Flags,
595
646
  Arg3Flags = evaluator<Arg3>::Flags,
@@ -609,11 +660,7 @@ struct ternary_evaluator<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3>, IndexBased
609
660
  evaluator<Arg3>::Alignment)
610
661
  };
611
662
 
612
- EIGEN_DEVICE_FUNC explicit ternary_evaluator(const XprType& xpr)
613
- : m_functor(xpr.functor()),
614
- m_arg1Impl(xpr.arg1()),
615
- m_arg2Impl(xpr.arg2()),
616
- m_arg3Impl(xpr.arg3())
663
+ EIGEN_DEVICE_FUNC explicit ternary_evaluator(const XprType& xpr) : m_d(xpr)
617
664
  {
618
665
  EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<TernaryOp>::Cost);
619
666
  EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
@@ -624,38 +671,48 @@ struct ternary_evaluator<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3>, IndexBased
624
671
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
625
672
  CoeffReturnType coeff(Index row, Index col) const
626
673
  {
627
- return m_functor(m_arg1Impl.coeff(row, col), m_arg2Impl.coeff(row, col), m_arg3Impl.coeff(row, col));
674
+ return m_d.func()(m_d.arg1Impl.coeff(row, col), m_d.arg2Impl.coeff(row, col), m_d.arg3Impl.coeff(row, col));
628
675
  }
629
676
 
630
677
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
631
678
  CoeffReturnType coeff(Index index) const
632
679
  {
633
- return m_functor(m_arg1Impl.coeff(index), m_arg2Impl.coeff(index), m_arg3Impl.coeff(index));
680
+ return m_d.func()(m_d.arg1Impl.coeff(index), m_d.arg2Impl.coeff(index), m_d.arg3Impl.coeff(index));
634
681
  }
635
682
 
636
683
  template<int LoadMode, typename PacketType>
637
684
  EIGEN_STRONG_INLINE
638
685
  PacketType packet(Index row, Index col) const
639
686
  {
640
- return m_functor.packetOp(m_arg1Impl.template packet<LoadMode,PacketType>(row, col),
641
- m_arg2Impl.template packet<LoadMode,PacketType>(row, col),
642
- m_arg3Impl.template packet<LoadMode,PacketType>(row, col));
687
+ return m_d.func().packetOp(m_d.arg1Impl.template packet<LoadMode,PacketType>(row, col),
688
+ m_d.arg2Impl.template packet<LoadMode,PacketType>(row, col),
689
+ m_d.arg3Impl.template packet<LoadMode,PacketType>(row, col));
643
690
  }
644
691
 
645
692
  template<int LoadMode, typename PacketType>
646
693
  EIGEN_STRONG_INLINE
647
694
  PacketType packet(Index index) const
648
695
  {
649
- return m_functor.packetOp(m_arg1Impl.template packet<LoadMode,PacketType>(index),
650
- m_arg2Impl.template packet<LoadMode,PacketType>(index),
651
- m_arg3Impl.template packet<LoadMode,PacketType>(index));
696
+ return m_d.func().packetOp(m_d.arg1Impl.template packet<LoadMode,PacketType>(index),
697
+ m_d.arg2Impl.template packet<LoadMode,PacketType>(index),
698
+ m_d.arg3Impl.template packet<LoadMode,PacketType>(index));
652
699
  }
653
700
 
654
701
  protected:
655
- const TernaryOp m_functor;
656
- evaluator<Arg1> m_arg1Impl;
657
- evaluator<Arg2> m_arg2Impl;
658
- evaluator<Arg3> m_arg3Impl;
702
+ // this helper permits to completely eliminate the functor if it is empty
703
+ struct Data
704
+ {
705
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
706
+ Data(const XprType& xpr) : op(xpr.functor()), arg1Impl(xpr.arg1()), arg2Impl(xpr.arg2()), arg3Impl(xpr.arg3()) {}
707
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
708
+ const TernaryOp& func() const { return op; }
709
+ TernaryOp op;
710
+ evaluator<Arg1> arg1Impl;
711
+ evaluator<Arg2> arg2Impl;
712
+ evaluator<Arg3> arg3Impl;
713
+ };
714
+
715
+ Data m_d;
659
716
  };
660
717
 
661
718
  // -------------------- CwiseBinaryOp --------------------
@@ -667,8 +724,9 @@ struct evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >
667
724
  {
668
725
  typedef CwiseBinaryOp<BinaryOp, Lhs, Rhs> XprType;
669
726
  typedef binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs> > Base;
670
-
671
- EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) : Base(xpr) {}
727
+
728
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
729
+ explicit evaluator(const XprType& xpr) : Base(xpr) {}
672
730
  };
673
731
 
674
732
  template<typename BinaryOp, typename Lhs, typename Rhs>
@@ -676,10 +734,10 @@ struct binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>, IndexBased, IndexBase
676
734
  : evaluator_base<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >
677
735
  {
678
736
  typedef CwiseBinaryOp<BinaryOp, Lhs, Rhs> XprType;
679
-
737
+
680
738
  enum {
681
- CoeffReadCost = evaluator<Lhs>::CoeffReadCost + evaluator<Rhs>::CoeffReadCost + functor_traits<BinaryOp>::Cost,
682
-
739
+ CoeffReadCost = int(evaluator<Lhs>::CoeffReadCost) + int(evaluator<Rhs>::CoeffReadCost) + int(functor_traits<BinaryOp>::Cost),
740
+
683
741
  LhsFlags = evaluator<Lhs>::Flags,
684
742
  RhsFlags = evaluator<Rhs>::Flags,
685
743
  SameType = is_same<typename Lhs::Scalar,typename Rhs::Scalar>::value,
@@ -696,10 +754,8 @@ struct binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>, IndexBased, IndexBase
696
754
  Alignment = EIGEN_PLAIN_ENUM_MIN(evaluator<Lhs>::Alignment,evaluator<Rhs>::Alignment)
697
755
  };
698
756
 
699
- EIGEN_DEVICE_FUNC explicit binary_evaluator(const XprType& xpr)
700
- : m_functor(xpr.functor()),
701
- m_lhsImpl(xpr.lhs()),
702
- m_rhsImpl(xpr.rhs())
757
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
758
+ explicit binary_evaluator(const XprType& xpr) : m_d(xpr)
703
759
  {
704
760
  EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<BinaryOp>::Cost);
705
761
  EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
@@ -710,35 +766,46 @@ struct binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>, IndexBased, IndexBase
710
766
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
711
767
  CoeffReturnType coeff(Index row, Index col) const
712
768
  {
713
- return m_functor(m_lhsImpl.coeff(row, col), m_rhsImpl.coeff(row, col));
769
+ return m_d.func()(m_d.lhsImpl.coeff(row, col), m_d.rhsImpl.coeff(row, col));
714
770
  }
715
771
 
716
772
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
717
773
  CoeffReturnType coeff(Index index) const
718
774
  {
719
- return m_functor(m_lhsImpl.coeff(index), m_rhsImpl.coeff(index));
775
+ return m_d.func()(m_d.lhsImpl.coeff(index), m_d.rhsImpl.coeff(index));
720
776
  }
721
777
 
722
778
  template<int LoadMode, typename PacketType>
723
779
  EIGEN_STRONG_INLINE
724
780
  PacketType packet(Index row, Index col) const
725
781
  {
726
- return m_functor.packetOp(m_lhsImpl.template packet<LoadMode,PacketType>(row, col),
727
- m_rhsImpl.template packet<LoadMode,PacketType>(row, col));
782
+ return m_d.func().packetOp(m_d.lhsImpl.template packet<LoadMode,PacketType>(row, col),
783
+ m_d.rhsImpl.template packet<LoadMode,PacketType>(row, col));
728
784
  }
729
785
 
730
786
  template<int LoadMode, typename PacketType>
731
787
  EIGEN_STRONG_INLINE
732
788
  PacketType packet(Index index) const
733
789
  {
734
- return m_functor.packetOp(m_lhsImpl.template packet<LoadMode,PacketType>(index),
735
- m_rhsImpl.template packet<LoadMode,PacketType>(index));
790
+ return m_d.func().packetOp(m_d.lhsImpl.template packet<LoadMode,PacketType>(index),
791
+ m_d.rhsImpl.template packet<LoadMode,PacketType>(index));
736
792
  }
737
793
 
738
794
  protected:
739
- const BinaryOp m_functor;
740
- evaluator<Lhs> m_lhsImpl;
741
- evaluator<Rhs> m_rhsImpl;
795
+
796
+ // this helper permits to completely eliminate the functor if it is empty
797
+ struct Data
798
+ {
799
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
800
+ Data(const XprType& xpr) : op(xpr.functor()), lhsImpl(xpr.lhs()), rhsImpl(xpr.rhs()) {}
801
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
802
+ const BinaryOp& func() const { return op; }
803
+ BinaryOp op;
804
+ evaluator<Lhs> lhsImpl;
805
+ evaluator<Rhs> rhsImpl;
806
+ };
807
+
808
+ Data m_d;
742
809
  };
743
810
 
744
811
  // -------------------- CwiseUnaryView --------------------
@@ -748,18 +815,16 @@ struct unary_evaluator<CwiseUnaryView<UnaryOp, ArgType>, IndexBased>
748
815
  : evaluator_base<CwiseUnaryView<UnaryOp, ArgType> >
749
816
  {
750
817
  typedef CwiseUnaryView<UnaryOp, ArgType> XprType;
751
-
818
+
752
819
  enum {
753
- CoeffReadCost = evaluator<ArgType>::CoeffReadCost + functor_traits<UnaryOp>::Cost,
754
-
820
+ CoeffReadCost = int(evaluator<ArgType>::CoeffReadCost) + int(functor_traits<UnaryOp>::Cost),
821
+
755
822
  Flags = (evaluator<ArgType>::Flags & (HereditaryBits | LinearAccessBit | DirectAccessBit)),
756
-
823
+
757
824
  Alignment = 0 // FIXME it is not very clear why alignment is necessarily lost...
758
825
  };
759
826
 
760
- EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& op)
761
- : m_unaryOp(op.functor()),
762
- m_argImpl(op.nestedExpression())
827
+ EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& op) : m_d(op)
763
828
  {
764
829
  EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits<UnaryOp>::Cost);
765
830
  EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
@@ -771,30 +836,41 @@ struct unary_evaluator<CwiseUnaryView<UnaryOp, ArgType>, IndexBased>
771
836
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
772
837
  CoeffReturnType coeff(Index row, Index col) const
773
838
  {
774
- return m_unaryOp(m_argImpl.coeff(row, col));
839
+ return m_d.func()(m_d.argImpl.coeff(row, col));
775
840
  }
776
841
 
777
842
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
778
843
  CoeffReturnType coeff(Index index) const
779
844
  {
780
- return m_unaryOp(m_argImpl.coeff(index));
845
+ return m_d.func()(m_d.argImpl.coeff(index));
781
846
  }
782
847
 
783
848
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
784
849
  Scalar& coeffRef(Index row, Index col)
785
850
  {
786
- return m_unaryOp(m_argImpl.coeffRef(row, col));
851
+ return m_d.func()(m_d.argImpl.coeffRef(row, col));
787
852
  }
788
853
 
789
854
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
790
855
  Scalar& coeffRef(Index index)
791
856
  {
792
- return m_unaryOp(m_argImpl.coeffRef(index));
857
+ return m_d.func()(m_d.argImpl.coeffRef(index));
793
858
  }
794
859
 
795
860
  protected:
796
- const UnaryOp m_unaryOp;
797
- evaluator<ArgType> m_argImpl;
861
+
862
+ // this helper permits to completely eliminate the functor if it is empty
863
+ struct Data
864
+ {
865
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
866
+ Data(const XprType& xpr) : op(xpr.functor()), argImpl(xpr.nestedExpression()) {}
867
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
868
+ const UnaryOp& func() const { return op; }
869
+ UnaryOp op;
870
+ evaluator<ArgType> argImpl;
871
+ };
872
+
873
+ Data m_d;
798
874
  };
799
875
 
800
876
  // -------------------- Map --------------------
@@ -811,14 +887,15 @@ struct mapbase_evaluator : evaluator_base<Derived>
811
887
  typedef typename XprType::PointerType PointerType;
812
888
  typedef typename XprType::Scalar Scalar;
813
889
  typedef typename XprType::CoeffReturnType CoeffReturnType;
814
-
890
+
815
891
  enum {
816
892
  IsRowMajor = XprType::RowsAtCompileTime,
817
893
  ColsAtCompileTime = XprType::ColsAtCompileTime,
818
894
  CoeffReadCost = NumTraits<Scalar>::ReadCost
819
895
  };
820
896
 
821
- EIGEN_DEVICE_FUNC explicit mapbase_evaluator(const XprType& map)
897
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
898
+ explicit mapbase_evaluator(const XprType& map)
822
899
  : m_data(const_cast<PointerType>(map.data())),
823
900
  m_innerStride(map.innerStride()),
824
901
  m_outerStride(map.outerStride())
@@ -882,17 +959,21 @@ struct mapbase_evaluator : evaluator_base<Derived>
882
959
  internal::pstoret<Scalar, PacketType, StoreMode>(m_data + index * m_innerStride.value(), x);
883
960
  }
884
961
  protected:
885
- EIGEN_DEVICE_FUNC
886
- inline Index rowStride() const { return XprType::IsRowMajor ? m_outerStride.value() : m_innerStride.value(); }
887
- EIGEN_DEVICE_FUNC
888
- inline Index colStride() const { return XprType::IsRowMajor ? m_innerStride.value() : m_outerStride.value(); }
962
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
963
+ Index rowStride() const EIGEN_NOEXCEPT {
964
+ return XprType::IsRowMajor ? m_outerStride.value() : m_innerStride.value();
965
+ }
966
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
967
+ Index colStride() const EIGEN_NOEXCEPT {
968
+ return XprType::IsRowMajor ? m_innerStride.value() : m_outerStride.value();
969
+ }
889
970
 
890
971
  PointerType m_data;
891
972
  const internal::variable_if_dynamic<Index, XprType::InnerStrideAtCompileTime> m_innerStride;
892
973
  const internal::variable_if_dynamic<Index, XprType::OuterStrideAtCompileTime> m_outerStride;
893
974
  };
894
975
 
895
- template<typename PlainObjectType, int MapOptions, typename StrideType>
976
+ template<typename PlainObjectType, int MapOptions, typename StrideType>
896
977
  struct evaluator<Map<PlainObjectType, MapOptions, StrideType> >
897
978
  : public mapbase_evaluator<Map<PlainObjectType, MapOptions, StrideType>, PlainObjectType>
898
979
  {
@@ -900,7 +981,7 @@ struct evaluator<Map<PlainObjectType, MapOptions, StrideType> >
900
981
  typedef typename XprType::Scalar Scalar;
901
982
  // TODO: should check for smaller packet types once we can handle multi-sized packet types
902
983
  typedef typename packet_traits<Scalar>::type PacketScalar;
903
-
984
+
904
985
  enum {
905
986
  InnerStrideAtCompileTime = StrideType::InnerStrideAtCompileTime == 0
906
987
  ? int(PlainObjectType::InnerStrideAtCompileTime)
@@ -912,34 +993,35 @@ struct evaluator<Map<PlainObjectType, MapOptions, StrideType> >
912
993
  HasNoOuterStride = StrideType::OuterStrideAtCompileTime == 0,
913
994
  HasNoStride = HasNoInnerStride && HasNoOuterStride,
914
995
  IsDynamicSize = PlainObjectType::SizeAtCompileTime==Dynamic,
915
-
996
+
916
997
  PacketAccessMask = bool(HasNoInnerStride) ? ~int(0) : ~int(PacketAccessBit),
917
998
  LinearAccessMask = bool(HasNoStride) || bool(PlainObjectType::IsVectorAtCompileTime) ? ~int(0) : ~int(LinearAccessBit),
918
999
  Flags = int( evaluator<PlainObjectType>::Flags) & (LinearAccessMask&PacketAccessMask),
919
-
1000
+
920
1001
  Alignment = int(MapOptions)&int(AlignedMask)
921
1002
  };
922
1003
 
923
1004
  EIGEN_DEVICE_FUNC explicit evaluator(const XprType& map)
924
- : mapbase_evaluator<XprType, PlainObjectType>(map)
1005
+ : mapbase_evaluator<XprType, PlainObjectType>(map)
925
1006
  { }
926
1007
  };
927
1008
 
928
1009
  // -------------------- Ref --------------------
929
1010
 
930
- template<typename PlainObjectType, int RefOptions, typename StrideType>
1011
+ template<typename PlainObjectType, int RefOptions, typename StrideType>
931
1012
  struct evaluator<Ref<PlainObjectType, RefOptions, StrideType> >
932
1013
  : public mapbase_evaluator<Ref<PlainObjectType, RefOptions, StrideType>, PlainObjectType>
933
1014
  {
934
1015
  typedef Ref<PlainObjectType, RefOptions, StrideType> XprType;
935
-
1016
+
936
1017
  enum {
937
1018
  Flags = evaluator<Map<PlainObjectType, RefOptions, StrideType> >::Flags,
938
1019
  Alignment = evaluator<Map<PlainObjectType, RefOptions, StrideType> >::Alignment
939
1020
  };
940
1021
 
941
- EIGEN_DEVICE_FUNC explicit evaluator(const XprType& ref)
942
- : mapbase_evaluator<XprType, PlainObjectType>(ref)
1022
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1023
+ explicit evaluator(const XprType& ref)
1024
+ : mapbase_evaluator<XprType, PlainObjectType>(ref)
943
1025
  { }
944
1026
  };
945
1027
 
@@ -947,8 +1029,8 @@ struct evaluator<Ref<PlainObjectType, RefOptions, StrideType> >
947
1029
 
948
1030
  template<typename ArgType, int BlockRows, int BlockCols, bool InnerPanel,
949
1031
  bool HasDirectAccess = internal::has_direct_access<ArgType>::ret> struct block_evaluator;
950
-
951
- template<typename ArgType, int BlockRows, int BlockCols, bool InnerPanel>
1032
+
1033
+ template<typename ArgType, int BlockRows, int BlockCols, bool InnerPanel>
952
1034
  struct evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel> >
953
1035
  : block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel>
954
1036
  {
@@ -956,15 +1038,15 @@ struct evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel> >
956
1038
  typedef typename XprType::Scalar Scalar;
957
1039
  // TODO: should check for smaller packet types once we can handle multi-sized packet types
958
1040
  typedef typename packet_traits<Scalar>::type PacketScalar;
959
-
1041
+
960
1042
  enum {
961
1043
  CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
962
-
1044
+
963
1045
  RowsAtCompileTime = traits<XprType>::RowsAtCompileTime,
964
1046
  ColsAtCompileTime = traits<XprType>::ColsAtCompileTime,
965
1047
  MaxRowsAtCompileTime = traits<XprType>::MaxRowsAtCompileTime,
966
1048
  MaxColsAtCompileTime = traits<XprType>::MaxColsAtCompileTime,
967
-
1049
+
968
1050
  ArgTypeIsRowMajor = (int(evaluator<ArgType>::Flags)&RowMajorBit) != 0,
969
1051
  IsRowMajor = (MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1) ? 1
970
1052
  : (MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1) ? 0
@@ -978,14 +1060,14 @@ struct evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel> >
978
1060
  ? int(outer_stride_at_compile_time<ArgType>::ret)
979
1061
  : int(inner_stride_at_compile_time<ArgType>::ret),
980
1062
  MaskPacketAccessBit = (InnerStrideAtCompileTime == 1 || HasSameStorageOrderAsArgType) ? PacketAccessBit : 0,
981
-
982
- FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1 || (InnerPanel && (evaluator<ArgType>::Flags&LinearAccessBit))) ? LinearAccessBit : 0,
1063
+
1064
+ FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1 || (InnerPanel && (evaluator<ArgType>::Flags&LinearAccessBit))) ? LinearAccessBit : 0,
983
1065
  FlagsRowMajorBit = XprType::Flags&RowMajorBit,
984
1066
  Flags0 = evaluator<ArgType>::Flags & ( (HereditaryBits & ~RowMajorBit) |
985
1067
  DirectAccessBit |
986
1068
  MaskPacketAccessBit),
987
1069
  Flags = Flags0 | FlagsLinearAccessBit | FlagsRowMajorBit,
988
-
1070
+
989
1071
  PacketAlignment = unpacket_traits<PacketScalar>::alignment,
990
1072
  Alignment0 = (InnerPanel && (OuterStrideAtCompileTime!=Dynamic)
991
1073
  && (OuterStrideAtCompileTime!=0)
@@ -993,7 +1075,8 @@ struct evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel> >
993
1075
  Alignment = EIGEN_PLAIN_ENUM_MIN(evaluator<ArgType>::Alignment, Alignment0)
994
1076
  };
995
1077
  typedef block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel> block_evaluator_type;
996
- EIGEN_DEVICE_FUNC explicit evaluator(const XprType& block) : block_evaluator_type(block)
1078
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1079
+ explicit evaluator(const XprType& block) : block_evaluator_type(block)
997
1080
  {
998
1081
  EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
999
1082
  }
@@ -1006,8 +1089,9 @@ struct block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel, /*HasDirectAcc
1006
1089
  {
1007
1090
  typedef Block<ArgType, BlockRows, BlockCols, InnerPanel> XprType;
1008
1091
 
1009
- EIGEN_DEVICE_FUNC explicit block_evaluator(const XprType& block)
1010
- : unary_evaluator<XprType>(block)
1092
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1093
+ explicit block_evaluator(const XprType& block)
1094
+ : unary_evaluator<XprType>(block)
1011
1095
  {}
1012
1096
  };
1013
1097
 
@@ -1017,79 +1101,74 @@ struct unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>, IndexBa
1017
1101
  {
1018
1102
  typedef Block<ArgType, BlockRows, BlockCols, InnerPanel> XprType;
1019
1103
 
1020
- EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& block)
1021
- : m_argImpl(block.nestedExpression()),
1022
- m_startRow(block.startRow()),
1104
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1105
+ explicit unary_evaluator(const XprType& block)
1106
+ : m_argImpl(block.nestedExpression()),
1107
+ m_startRow(block.startRow()),
1023
1108
  m_startCol(block.startCol()),
1024
- m_linear_offset(InnerPanel?(XprType::IsRowMajor ? block.startRow()*block.cols() : block.startCol()*block.rows()):0)
1109
+ m_linear_offset(ForwardLinearAccess?(ArgType::IsRowMajor ? block.startRow()*block.nestedExpression().cols() + block.startCol() : block.startCol()*block.nestedExpression().rows() + block.startRow()):0)
1025
1110
  { }
1026
-
1111
+
1027
1112
  typedef typename XprType::Scalar Scalar;
1028
1113
  typedef typename XprType::CoeffReturnType CoeffReturnType;
1029
1114
 
1030
1115
  enum {
1031
1116
  RowsAtCompileTime = XprType::RowsAtCompileTime,
1032
- ForwardLinearAccess = InnerPanel && bool(evaluator<ArgType>::Flags&LinearAccessBit)
1117
+ ForwardLinearAccess = (InnerPanel || int(XprType::IsRowMajor)==int(ArgType::IsRowMajor)) && bool(evaluator<ArgType>::Flags&LinearAccessBit)
1033
1118
  };
1034
-
1119
+
1035
1120
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1036
1121
  CoeffReturnType coeff(Index row, Index col) const
1037
- {
1038
- return m_argImpl.coeff(m_startRow.value() + row, m_startCol.value() + col);
1122
+ {
1123
+ return m_argImpl.coeff(m_startRow.value() + row, m_startCol.value() + col);
1039
1124
  }
1040
-
1125
+
1041
1126
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1042
1127
  CoeffReturnType coeff(Index index) const
1043
- {
1044
- if (ForwardLinearAccess)
1045
- return m_argImpl.coeff(m_linear_offset.value() + index);
1046
- else
1047
- return coeff(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0);
1128
+ {
1129
+ return linear_coeff_impl(index, bool_constant<ForwardLinearAccess>());
1048
1130
  }
1049
1131
 
1050
1132
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1051
1133
  Scalar& coeffRef(Index row, Index col)
1052
- {
1053
- return m_argImpl.coeffRef(m_startRow.value() + row, m_startCol.value() + col);
1134
+ {
1135
+ return m_argImpl.coeffRef(m_startRow.value() + row, m_startCol.value() + col);
1054
1136
  }
1055
-
1137
+
1056
1138
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1057
1139
  Scalar& coeffRef(Index index)
1058
- {
1059
- if (ForwardLinearAccess)
1060
- return m_argImpl.coeffRef(m_linear_offset.value() + index);
1061
- else
1062
- return coeffRef(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0);
1140
+ {
1141
+ return linear_coeffRef_impl(index, bool_constant<ForwardLinearAccess>());
1063
1142
  }
1064
-
1143
+
1065
1144
  template<int LoadMode, typename PacketType>
1066
1145
  EIGEN_STRONG_INLINE
1067
- PacketType packet(Index row, Index col) const
1068
- {
1069
- return m_argImpl.template packet<LoadMode,PacketType>(m_startRow.value() + row, m_startCol.value() + col);
1146
+ PacketType packet(Index row, Index col) const
1147
+ {
1148
+ return m_argImpl.template packet<LoadMode,PacketType>(m_startRow.value() + row, m_startCol.value() + col);
1070
1149
  }
1071
1150
 
1072
1151
  template<int LoadMode, typename PacketType>
1073
1152
  EIGEN_STRONG_INLINE
1074
- PacketType packet(Index index) const
1075
- {
1153
+ PacketType packet(Index index) const
1154
+ {
1076
1155
  if (ForwardLinearAccess)
1077
1156
  return m_argImpl.template packet<LoadMode,PacketType>(m_linear_offset.value() + index);
1078
1157
  else
1079
1158
  return packet<LoadMode,PacketType>(RowsAtCompileTime == 1 ? 0 : index,
1080
1159
  RowsAtCompileTime == 1 ? index : 0);
1081
1160
  }
1082
-
1161
+
1083
1162
  template<int StoreMode, typename PacketType>
1084
1163
  EIGEN_STRONG_INLINE
1085
- void writePacket(Index row, Index col, const PacketType& x)
1164
+ void writePacket(Index row, Index col, const PacketType& x)
1086
1165
  {
1087
- return m_argImpl.template writePacket<StoreMode,PacketType>(m_startRow.value() + row, m_startCol.value() + col, x);
1166
+ return m_argImpl.template writePacket<StoreMode,PacketType>(m_startRow.value() + row, m_startCol.value() + col, x);
1088
1167
  }
1089
-
1168
+
1090
1169
  template<int StoreMode, typename PacketType>
1091
1170
  EIGEN_STRONG_INLINE
1092
- void writePacket(Index index, const PacketType& x)
1171
+ void writePacket(Index index, const PacketType& x)
1093
1172
  {
1094
1173
  if (ForwardLinearAccess)
1095
1174
  return m_argImpl.template writePacket<StoreMode,PacketType>(m_linear_offset.value() + index, x);
@@ -1098,18 +1177,40 @@ struct unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>, IndexBa
1098
1177
  RowsAtCompileTime == 1 ? index : 0,
1099
1178
  x);
1100
1179
  }
1101
-
1180
+
1102
1181
  protected:
1182
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1183
+ CoeffReturnType linear_coeff_impl(Index index, internal::true_type /* ForwardLinearAccess */) const
1184
+ {
1185
+ return m_argImpl.coeff(m_linear_offset.value() + index);
1186
+ }
1187
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1188
+ CoeffReturnType linear_coeff_impl(Index index, internal::false_type /* not ForwardLinearAccess */) const
1189
+ {
1190
+ return coeff(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0);
1191
+ }
1192
+
1193
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1194
+ Scalar& linear_coeffRef_impl(Index index, internal::true_type /* ForwardLinearAccess */)
1195
+ {
1196
+ return m_argImpl.coeffRef(m_linear_offset.value() + index);
1197
+ }
1198
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1199
+ Scalar& linear_coeffRef_impl(Index index, internal::false_type /* not ForwardLinearAccess */)
1200
+ {
1201
+ return coeffRef(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0);
1202
+ }
1203
+
1103
1204
  evaluator<ArgType> m_argImpl;
1104
1205
  const variable_if_dynamic<Index, (ArgType::RowsAtCompileTime == 1 && BlockRows==1) ? 0 : Dynamic> m_startRow;
1105
1206
  const variable_if_dynamic<Index, (ArgType::ColsAtCompileTime == 1 && BlockCols==1) ? 0 : Dynamic> m_startCol;
1106
- const variable_if_dynamic<Index, InnerPanel ? Dynamic : 0> m_linear_offset;
1207
+ const variable_if_dynamic<Index, ForwardLinearAccess ? Dynamic : 0> m_linear_offset;
1107
1208
  };
1108
1209
 
1109
- // TODO: This evaluator does not actually use the child evaluator;
1210
+ // TODO: This evaluator does not actually use the child evaluator;
1110
1211
  // all action is via the data() as returned by the Block expression.
1111
1212
 
1112
- template<typename ArgType, int BlockRows, int BlockCols, bool InnerPanel>
1213
+ template<typename ArgType, int BlockRows, int BlockCols, bool InnerPanel>
1113
1214
  struct block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel, /* HasDirectAccess */ true>
1114
1215
  : mapbase_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>,
1115
1216
  typename Block<ArgType, BlockRows, BlockCols, InnerPanel>::PlainObject>
@@ -1117,8 +1218,9 @@ struct block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel, /* HasDirectAc
1117
1218
  typedef Block<ArgType, BlockRows, BlockCols, InnerPanel> XprType;
1118
1219
  typedef typename XprType::Scalar Scalar;
1119
1220
 
1120
- EIGEN_DEVICE_FUNC explicit block_evaluator(const XprType& block)
1121
- : mapbase_evaluator<XprType, typename XprType::PlainObject>(block)
1221
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1222
+ explicit block_evaluator(const XprType& block)
1223
+ : mapbase_evaluator<XprType, typename XprType::PlainObject>(block)
1122
1224
  {
1123
1225
  // TODO: for the 3.3 release, this should be turned to an internal assertion, but let's keep it as is for the beta lifetime
1124
1226
  eigen_assert(((internal::UIntPtr(block.data()) % EIGEN_PLAIN_ENUM_MAX(1,evaluator<XprType>::Alignment)) == 0) && "data is not aligned");
@@ -1141,18 +1243,19 @@ struct evaluator<Select<ConditionMatrixType, ThenMatrixType, ElseMatrixType> >
1141
1243
  evaluator<ElseMatrixType>::CoeffReadCost),
1142
1244
 
1143
1245
  Flags = (unsigned int)evaluator<ThenMatrixType>::Flags & evaluator<ElseMatrixType>::Flags & HereditaryBits,
1144
-
1246
+
1145
1247
  Alignment = EIGEN_PLAIN_ENUM_MIN(evaluator<ThenMatrixType>::Alignment, evaluator<ElseMatrixType>::Alignment)
1146
1248
  };
1147
1249
 
1148
- EIGEN_DEVICE_FUNC explicit evaluator(const XprType& select)
1250
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1251
+ explicit evaluator(const XprType& select)
1149
1252
  : m_conditionImpl(select.conditionMatrix()),
1150
1253
  m_thenImpl(select.thenMatrix()),
1151
1254
  m_elseImpl(select.elseMatrix())
1152
1255
  {
1153
1256
  EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
1154
1257
  }
1155
-
1258
+
1156
1259
  typedef typename XprType::CoeffReturnType CoeffReturnType;
1157
1260
 
1158
1261
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
@@ -1172,7 +1275,7 @@ struct evaluator<Select<ConditionMatrixType, ThenMatrixType, ElseMatrixType> >
1172
1275
  else
1173
1276
  return m_elseImpl.coeff(index);
1174
1277
  }
1175
-
1278
+
1176
1279
  protected:
1177
1280
  evaluator<ConditionMatrixType> m_conditionImpl;
1178
1281
  evaluator<ThenMatrixType> m_thenImpl;
@@ -1182,7 +1285,7 @@ protected:
1182
1285
 
1183
1286
  // -------------------- Replicate --------------------
1184
1287
 
1185
- template<typename ArgType, int RowFactor, int ColFactor>
1288
+ template<typename ArgType, int RowFactor, int ColFactor>
1186
1289
  struct unary_evaluator<Replicate<ArgType, RowFactor, ColFactor> >
1187
1290
  : evaluator_base<Replicate<ArgType, RowFactor, ColFactor> >
1188
1291
  {
@@ -1193,22 +1296,23 @@ struct unary_evaluator<Replicate<ArgType, RowFactor, ColFactor> >
1193
1296
  };
1194
1297
  typedef typename internal::nested_eval<ArgType,Factor>::type ArgTypeNested;
1195
1298
  typedef typename internal::remove_all<ArgTypeNested>::type ArgTypeNestedCleaned;
1196
-
1299
+
1197
1300
  enum {
1198
1301
  CoeffReadCost = evaluator<ArgTypeNestedCleaned>::CoeffReadCost,
1199
1302
  LinearAccessMask = XprType::IsVectorAtCompileTime ? LinearAccessBit : 0,
1200
1303
  Flags = (evaluator<ArgTypeNestedCleaned>::Flags & (HereditaryBits|LinearAccessMask) & ~RowMajorBit) | (traits<XprType>::Flags & RowMajorBit),
1201
-
1304
+
1202
1305
  Alignment = evaluator<ArgTypeNestedCleaned>::Alignment
1203
1306
  };
1204
1307
 
1205
- EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& replicate)
1308
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1309
+ explicit unary_evaluator(const XprType& replicate)
1206
1310
  : m_arg(replicate.nestedExpression()),
1207
1311
  m_argImpl(m_arg),
1208
1312
  m_rows(replicate.nestedExpression().rows()),
1209
1313
  m_cols(replicate.nestedExpression().cols())
1210
1314
  {}
1211
-
1315
+
1212
1316
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1213
1317
  CoeffReturnType coeff(Index row, Index col) const
1214
1318
  {
@@ -1219,10 +1323,10 @@ struct unary_evaluator<Replicate<ArgType, RowFactor, ColFactor> >
1219
1323
  const Index actual_col = internal::traits<XprType>::ColsAtCompileTime==1 ? 0
1220
1324
  : ColFactor==1 ? col
1221
1325
  : col % m_cols.value();
1222
-
1326
+
1223
1327
  return m_argImpl.coeff(actual_row, actual_col);
1224
1328
  }
1225
-
1329
+
1226
1330
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1227
1331
  CoeffReturnType coeff(Index index) const
1228
1332
  {
@@ -1230,7 +1334,7 @@ struct unary_evaluator<Replicate<ArgType, RowFactor, ColFactor> >
1230
1334
  const Index actual_index = internal::traits<XprType>::RowsAtCompileTime==1
1231
1335
  ? (ColFactor==1 ? index : index%m_cols.value())
1232
1336
  : (RowFactor==1 ? index : index%m_rows.value());
1233
-
1337
+
1234
1338
  return m_argImpl.coeff(actual_index);
1235
1339
  }
1236
1340
 
@@ -1247,7 +1351,7 @@ struct unary_evaluator<Replicate<ArgType, RowFactor, ColFactor> >
1247
1351
 
1248
1352
  return m_argImpl.template packet<LoadMode,PacketType>(actual_row, actual_col);
1249
1353
  }
1250
-
1354
+
1251
1355
  template<int LoadMode, typename PacketType>
1252
1356
  EIGEN_STRONG_INLINE
1253
1357
  PacketType packet(Index index) const
@@ -1258,7 +1362,7 @@ struct unary_evaluator<Replicate<ArgType, RowFactor, ColFactor> >
1258
1362
 
1259
1363
  return m_argImpl.template packet<LoadMode,PacketType>(actual_index);
1260
1364
  }
1261
-
1365
+
1262
1366
  protected:
1263
1367
  const ArgTypeNested m_arg;
1264
1368
  evaluator<ArgTypeNestedCleaned> m_argImpl;
@@ -1266,64 +1370,6 @@ protected:
1266
1370
  const variable_if_dynamic<Index, ArgType::ColsAtCompileTime> m_cols;
1267
1371
  };
1268
1372
 
1269
-
1270
- // -------------------- PartialReduxExpr --------------------
1271
-
1272
- template< typename ArgType, typename MemberOp, int Direction>
1273
- struct evaluator<PartialReduxExpr<ArgType, MemberOp, Direction> >
1274
- : evaluator_base<PartialReduxExpr<ArgType, MemberOp, Direction> >
1275
- {
1276
- typedef PartialReduxExpr<ArgType, MemberOp, Direction> XprType;
1277
- typedef typename internal::nested_eval<ArgType,1>::type ArgTypeNested;
1278
- typedef typename internal::remove_all<ArgTypeNested>::type ArgTypeNestedCleaned;
1279
- typedef typename ArgType::Scalar InputScalar;
1280
- typedef typename XprType::Scalar Scalar;
1281
- enum {
1282
- TraversalSize = Direction==int(Vertical) ? int(ArgType::RowsAtCompileTime) : int(ArgType::ColsAtCompileTime)
1283
- };
1284
- typedef typename MemberOp::template Cost<InputScalar,int(TraversalSize)> CostOpType;
1285
- enum {
1286
- CoeffReadCost = TraversalSize==Dynamic ? HugeCost
1287
- : TraversalSize * evaluator<ArgType>::CoeffReadCost + int(CostOpType::value),
1288
-
1289
- Flags = (traits<XprType>::Flags&RowMajorBit) | (evaluator<ArgType>::Flags&(HereditaryBits&(~RowMajorBit))) | LinearAccessBit,
1290
-
1291
- Alignment = 0 // FIXME this will need to be improved once PartialReduxExpr is vectorized
1292
- };
1293
-
1294
- EIGEN_DEVICE_FUNC explicit evaluator(const XprType xpr)
1295
- : m_arg(xpr.nestedExpression()), m_functor(xpr.functor())
1296
- {
1297
- EIGEN_INTERNAL_CHECK_COST_VALUE(TraversalSize==Dynamic ? HugeCost : int(CostOpType::value));
1298
- EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
1299
- }
1300
-
1301
- typedef typename XprType::CoeffReturnType CoeffReturnType;
1302
-
1303
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1304
- const Scalar coeff(Index i, Index j) const
1305
- {
1306
- if (Direction==Vertical)
1307
- return m_functor(m_arg.col(j));
1308
- else
1309
- return m_functor(m_arg.row(i));
1310
- }
1311
-
1312
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1313
- const Scalar coeff(Index index) const
1314
- {
1315
- if (Direction==Vertical)
1316
- return m_functor(m_arg.col(index));
1317
- else
1318
- return m_functor(m_arg.row(index));
1319
- }
1320
-
1321
- protected:
1322
- typename internal::add_const_on_value_type<ArgTypeNested>::type m_arg;
1323
- const MemberOp m_functor;
1324
- };
1325
-
1326
-
1327
1373
  // -------------------- MatrixWrapper and ArrayWrapper --------------------
1328
1374
  //
1329
1375
  // evaluator_wrapper_base<T> is a common base class for the
@@ -1340,7 +1386,8 @@ struct evaluator_wrapper_base
1340
1386
  Alignment = evaluator<ArgType>::Alignment
1341
1387
  };
1342
1388
 
1343
- EIGEN_DEVICE_FUNC explicit evaluator_wrapper_base(const ArgType& arg) : m_argImpl(arg) {}
1389
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1390
+ explicit evaluator_wrapper_base(const ArgType& arg) : m_argImpl(arg) {}
1344
1391
 
1345
1392
  typedef typename ArgType::Scalar Scalar;
1346
1393
  typedef typename ArgType::CoeffReturnType CoeffReturnType;
@@ -1407,7 +1454,8 @@ struct unary_evaluator<MatrixWrapper<TArgType> >
1407
1454
  {
1408
1455
  typedef MatrixWrapper<TArgType> XprType;
1409
1456
 
1410
- EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& wrapper)
1457
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1458
+ explicit unary_evaluator(const XprType& wrapper)
1411
1459
  : evaluator_wrapper_base<MatrixWrapper<TArgType> >(wrapper.nestedExpression())
1412
1460
  { }
1413
1461
  };
@@ -1418,7 +1466,8 @@ struct unary_evaluator<ArrayWrapper<TArgType> >
1418
1466
  {
1419
1467
  typedef ArrayWrapper<TArgType> XprType;
1420
1468
 
1421
- EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& wrapper)
1469
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1470
+ explicit unary_evaluator(const XprType& wrapper)
1422
1471
  : evaluator_wrapper_base<ArrayWrapper<TArgType> >(wrapper.nestedExpression())
1423
1472
  { }
1424
1473
  };
@@ -1445,9 +1494,9 @@ struct unary_evaluator<Reverse<ArgType, Direction> >
1445
1494
  ReversePacket = (Direction == BothDirections)
1446
1495
  || ((Direction == Vertical) && IsColMajor)
1447
1496
  || ((Direction == Horizontal) && IsRowMajor),
1448
-
1497
+
1449
1498
  CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
1450
-
1499
+
1451
1500
  // let's enable LinearAccess only with vectorization because of the product overhead
1452
1501
  // FIXME enable DirectAccess with negative strides?
1453
1502
  Flags0 = evaluator<ArgType>::Flags,
@@ -1456,16 +1505,17 @@ struct unary_evaluator<Reverse<ArgType, Direction> >
1456
1505
  ? LinearAccessBit : 0,
1457
1506
 
1458
1507
  Flags = int(Flags0) & (HereditaryBits | PacketAccessBit | LinearAccess),
1459
-
1508
+
1460
1509
  Alignment = 0 // FIXME in some rare cases, Alignment could be preserved, like a Vector4f.
1461
1510
  };
1462
1511
 
1463
- EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& reverse)
1512
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1513
+ explicit unary_evaluator(const XprType& reverse)
1464
1514
  : m_argImpl(reverse.nestedExpression()),
1465
1515
  m_rows(ReverseRow ? reverse.nestedExpression().rows() : 1),
1466
1516
  m_cols(ReverseCol ? reverse.nestedExpression().cols() : 1)
1467
1517
  { }
1468
-
1518
+
1469
1519
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1470
1520
  CoeffReturnType coeff(Index row, Index col) const
1471
1521
  {
@@ -1540,7 +1590,7 @@ struct unary_evaluator<Reverse<ArgType, Direction> >
1540
1590
  m_argImpl.template writePacket<LoadMode>
1541
1591
  (m_rows.value() * m_cols.value() - index - PacketSize, preverse(x));
1542
1592
  }
1543
-
1593
+
1544
1594
  protected:
1545
1595
  evaluator<ArgType> m_argImpl;
1546
1596
 
@@ -1558,20 +1608,21 @@ struct evaluator<Diagonal<ArgType, DiagIndex> >
1558
1608
  : evaluator_base<Diagonal<ArgType, DiagIndex> >
1559
1609
  {
1560
1610
  typedef Diagonal<ArgType, DiagIndex> XprType;
1561
-
1611
+
1562
1612
  enum {
1563
1613
  CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
1564
-
1614
+
1565
1615
  Flags = (unsigned int)(evaluator<ArgType>::Flags & (HereditaryBits | DirectAccessBit) & ~RowMajorBit) | LinearAccessBit,
1566
-
1616
+
1567
1617
  Alignment = 0
1568
1618
  };
1569
1619
 
1570
- EIGEN_DEVICE_FUNC explicit evaluator(const XprType& diagonal)
1620
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1621
+ explicit evaluator(const XprType& diagonal)
1571
1622
  : m_argImpl(diagonal.nestedExpression()),
1572
1623
  m_index(diagonal.index())
1573
1624
  { }
1574
-
1625
+
1575
1626
  typedef typename XprType::Scalar Scalar;
1576
1627
  typedef typename XprType::CoeffReturnType CoeffReturnType;
1577
1628
 
@@ -1604,8 +1655,10 @@ protected:
1604
1655
  const internal::variable_if_dynamicindex<Index, XprType::DiagIndex> m_index;
1605
1656
 
1606
1657
  private:
1607
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rowOffset() const { return m_index.value() > 0 ? 0 : -m_index.value(); }
1608
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index colOffset() const { return m_index.value() > 0 ? m_index.value() : 0; }
1658
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
1659
+ Index rowOffset() const { return m_index.value() > 0 ? 0 : -m_index.value(); }
1660
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
1661
+ Index colOffset() const { return m_index.value() > 0 ? m_index.value() : 0; }
1609
1662
  };
1610
1663
 
1611
1664
 
@@ -1629,25 +1682,25 @@ class EvalToTemp
1629
1682
  : public dense_xpr_base<EvalToTemp<ArgType> >::type
1630
1683
  {
1631
1684
  public:
1632
-
1685
+
1633
1686
  typedef typename dense_xpr_base<EvalToTemp>::type Base;
1634
1687
  EIGEN_GENERIC_PUBLIC_INTERFACE(EvalToTemp)
1635
-
1688
+
1636
1689
  explicit EvalToTemp(const ArgType& arg)
1637
1690
  : m_arg(arg)
1638
1691
  { }
1639
-
1692
+
1640
1693
  const ArgType& arg() const
1641
1694
  {
1642
1695
  return m_arg;
1643
1696
  }
1644
1697
 
1645
- Index rows() const
1698
+ EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
1646
1699
  {
1647
1700
  return m_arg.rows();
1648
1701
  }
1649
1702
 
1650
- Index cols() const
1703
+ EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
1651
1704
  {
1652
1705
  return m_arg.cols();
1653
1706
  }
@@ -1655,7 +1708,7 @@ class EvalToTemp
1655
1708
  private:
1656
1709
  const ArgType& m_arg;
1657
1710
  };
1658
-
1711
+
1659
1712
  template<typename ArgType>
1660
1713
  struct evaluator<EvalToTemp<ArgType> >
1661
1714
  : public evaluator<typename ArgType::PlainObject>
@@ -1663,7 +1716,7 @@ struct evaluator<EvalToTemp<ArgType> >
1663
1716
  typedef EvalToTemp<ArgType> XprType;
1664
1717
  typedef typename ArgType::PlainObject PlainObject;
1665
1718
  typedef evaluator<PlainObject> Base;
1666
-
1719
+
1667
1720
  EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr)
1668
1721
  : m_result(xpr.arg())
1669
1722
  {