tomoto 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (369) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/README.md +8 -10
  4. data/ext/tomoto/ct.cpp +11 -11
  5. data/ext/tomoto/dmr.cpp +14 -13
  6. data/ext/tomoto/dt.cpp +14 -14
  7. data/ext/tomoto/extconf.rb +7 -5
  8. data/ext/tomoto/gdmr.cpp +7 -7
  9. data/ext/tomoto/hdp.cpp +9 -9
  10. data/ext/tomoto/hlda.cpp +13 -13
  11. data/ext/tomoto/hpa.cpp +5 -5
  12. data/ext/tomoto/lda.cpp +42 -39
  13. data/ext/tomoto/llda.cpp +6 -6
  14. data/ext/tomoto/mglda.cpp +15 -15
  15. data/ext/tomoto/pa.cpp +6 -6
  16. data/ext/tomoto/plda.cpp +6 -6
  17. data/ext/tomoto/slda.cpp +8 -8
  18. data/ext/tomoto/{ext.cpp → tomoto.cpp} +8 -8
  19. data/ext/tomoto/utils.h +16 -70
  20. data/lib/tomoto/version.rb +1 -1
  21. data/lib/tomoto.rb +5 -1
  22. data/vendor/EigenRand/EigenRand/Core.h +10 -10
  23. data/vendor/EigenRand/EigenRand/Dists/Basic.h +208 -9
  24. data/vendor/EigenRand/EigenRand/Dists/Discrete.h +52 -31
  25. data/vendor/EigenRand/EigenRand/Dists/GammaPoisson.h +9 -8
  26. data/vendor/EigenRand/EigenRand/Dists/NormalExp.h +28 -21
  27. data/vendor/EigenRand/EigenRand/EigenRand +11 -6
  28. data/vendor/EigenRand/EigenRand/Macro.h +13 -7
  29. data/vendor/EigenRand/EigenRand/MorePacketMath.h +348 -740
  30. data/vendor/EigenRand/EigenRand/MvDists/Multinomial.h +5 -3
  31. data/vendor/EigenRand/EigenRand/MvDists/MvNormal.h +9 -3
  32. data/vendor/EigenRand/EigenRand/PacketFilter.h +11 -253
  33. data/vendor/EigenRand/EigenRand/PacketRandomEngine.h +21 -47
  34. data/vendor/EigenRand/EigenRand/RandUtils.h +50 -344
  35. data/vendor/EigenRand/EigenRand/arch/AVX/MorePacketMath.h +619 -0
  36. data/vendor/EigenRand/EigenRand/arch/AVX/PacketFilter.h +149 -0
  37. data/vendor/EigenRand/EigenRand/arch/AVX/RandUtils.h +228 -0
  38. data/vendor/EigenRand/EigenRand/arch/NEON/MorePacketMath.h +473 -0
  39. data/vendor/EigenRand/EigenRand/arch/NEON/PacketFilter.h +142 -0
  40. data/vendor/EigenRand/EigenRand/arch/NEON/RandUtils.h +126 -0
  41. data/vendor/EigenRand/EigenRand/arch/SSE/MorePacketMath.h +501 -0
  42. data/vendor/EigenRand/EigenRand/arch/SSE/PacketFilter.h +133 -0
  43. data/vendor/EigenRand/EigenRand/arch/SSE/RandUtils.h +120 -0
  44. data/vendor/EigenRand/EigenRand/doc.h +24 -12
  45. data/vendor/EigenRand/README.md +57 -4
  46. data/vendor/eigen/COPYING.APACHE +203 -0
  47. data/vendor/eigen/COPYING.BSD +1 -1
  48. data/vendor/eigen/COPYING.MINPACK +51 -52
  49. data/vendor/eigen/Eigen/Cholesky +0 -1
  50. data/vendor/eigen/Eigen/Core +112 -265
  51. data/vendor/eigen/Eigen/Eigenvalues +2 -3
  52. data/vendor/eigen/Eigen/Geometry +5 -8
  53. data/vendor/eigen/Eigen/Householder +0 -1
  54. data/vendor/eigen/Eigen/Jacobi +0 -1
  55. data/vendor/eigen/Eigen/KLUSupport +41 -0
  56. data/vendor/eigen/Eigen/LU +2 -5
  57. data/vendor/eigen/Eigen/OrderingMethods +0 -3
  58. data/vendor/eigen/Eigen/PaStiXSupport +1 -0
  59. data/vendor/eigen/Eigen/PardisoSupport +0 -0
  60. data/vendor/eigen/Eigen/QR +2 -3
  61. data/vendor/eigen/Eigen/QtAlignedMalloc +0 -1
  62. data/vendor/eigen/Eigen/SVD +0 -1
  63. data/vendor/eigen/Eigen/Sparse +0 -2
  64. data/vendor/eigen/Eigen/SparseCholesky +0 -8
  65. data/vendor/eigen/Eigen/SparseLU +4 -0
  66. data/vendor/eigen/Eigen/SparseQR +0 -1
  67. data/vendor/eigen/Eigen/src/Cholesky/LDLT.h +42 -27
  68. data/vendor/eigen/Eigen/src/Cholesky/LLT.h +39 -23
  69. data/vendor/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +90 -47
  70. data/vendor/eigen/Eigen/src/Core/ArithmeticSequence.h +413 -0
  71. data/vendor/eigen/Eigen/src/Core/Array.h +99 -11
  72. data/vendor/eigen/Eigen/src/Core/ArrayBase.h +3 -3
  73. data/vendor/eigen/Eigen/src/Core/ArrayWrapper.h +21 -21
  74. data/vendor/eigen/Eigen/src/Core/Assign.h +1 -1
  75. data/vendor/eigen/Eigen/src/Core/AssignEvaluator.h +125 -50
  76. data/vendor/eigen/Eigen/src/Core/Assign_MKL.h +10 -10
  77. data/vendor/eigen/Eigen/src/Core/BandMatrix.h +16 -16
  78. data/vendor/eigen/Eigen/src/Core/Block.h +56 -60
  79. data/vendor/eigen/Eigen/src/Core/BooleanRedux.h +29 -31
  80. data/vendor/eigen/Eigen/src/Core/CommaInitializer.h +7 -3
  81. data/vendor/eigen/Eigen/src/Core/CoreEvaluators.h +325 -272
  82. data/vendor/eigen/Eigen/src/Core/CoreIterators.h +5 -0
  83. data/vendor/eigen/Eigen/src/Core/CwiseBinaryOp.h +21 -22
  84. data/vendor/eigen/Eigen/src/Core/CwiseNullaryOp.h +153 -18
  85. data/vendor/eigen/Eigen/src/Core/CwiseUnaryOp.h +6 -6
  86. data/vendor/eigen/Eigen/src/Core/CwiseUnaryView.h +14 -10
  87. data/vendor/eigen/Eigen/src/Core/DenseBase.h +132 -42
  88. data/vendor/eigen/Eigen/src/Core/DenseCoeffsBase.h +25 -21
  89. data/vendor/eigen/Eigen/src/Core/DenseStorage.h +153 -71
  90. data/vendor/eigen/Eigen/src/Core/Diagonal.h +21 -23
  91. data/vendor/eigen/Eigen/src/Core/DiagonalMatrix.h +50 -2
  92. data/vendor/eigen/Eigen/src/Core/DiagonalProduct.h +1 -1
  93. data/vendor/eigen/Eigen/src/Core/Dot.h +10 -10
  94. data/vendor/eigen/Eigen/src/Core/EigenBase.h +10 -9
  95. data/vendor/eigen/Eigen/src/Core/ForceAlignedAccess.h +8 -4
  96. data/vendor/eigen/Eigen/src/Core/Fuzzy.h +3 -3
  97. data/vendor/eigen/Eigen/src/Core/GeneralProduct.h +20 -10
  98. data/vendor/eigen/Eigen/src/Core/GenericPacketMath.h +599 -152
  99. data/vendor/eigen/Eigen/src/Core/GlobalFunctions.h +40 -33
  100. data/vendor/eigen/Eigen/src/Core/IO.h +40 -7
  101. data/vendor/eigen/Eigen/src/Core/IndexedView.h +237 -0
  102. data/vendor/eigen/Eigen/src/Core/Inverse.h +9 -10
  103. data/vendor/eigen/Eigen/src/Core/Map.h +7 -7
  104. data/vendor/eigen/Eigen/src/Core/MapBase.h +10 -3
  105. data/vendor/eigen/Eigen/src/Core/MathFunctions.h +767 -125
  106. data/vendor/eigen/Eigen/src/Core/MathFunctionsImpl.h +118 -19
  107. data/vendor/eigen/Eigen/src/Core/Matrix.h +131 -25
  108. data/vendor/eigen/Eigen/src/Core/MatrixBase.h +21 -3
  109. data/vendor/eigen/Eigen/src/Core/NestByValue.h +25 -50
  110. data/vendor/eigen/Eigen/src/Core/NoAlias.h +4 -3
  111. data/vendor/eigen/Eigen/src/Core/NumTraits.h +107 -20
  112. data/vendor/eigen/Eigen/src/Core/PartialReduxEvaluator.h +232 -0
  113. data/vendor/eigen/Eigen/src/Core/PermutationMatrix.h +3 -31
  114. data/vendor/eigen/Eigen/src/Core/PlainObjectBase.h +152 -59
  115. data/vendor/eigen/Eigen/src/Core/Product.h +30 -25
  116. data/vendor/eigen/Eigen/src/Core/ProductEvaluators.h +192 -125
  117. data/vendor/eigen/Eigen/src/Core/Random.h +37 -1
  118. data/vendor/eigen/Eigen/src/Core/Redux.h +180 -170
  119. data/vendor/eigen/Eigen/src/Core/Ref.h +121 -23
  120. data/vendor/eigen/Eigen/src/Core/Replicate.h +8 -8
  121. data/vendor/eigen/Eigen/src/Core/Reshaped.h +454 -0
  122. data/vendor/eigen/Eigen/src/Core/ReturnByValue.h +7 -5
  123. data/vendor/eigen/Eigen/src/Core/Reverse.h +18 -12
  124. data/vendor/eigen/Eigen/src/Core/Select.h +8 -6
  125. data/vendor/eigen/Eigen/src/Core/SelfAdjointView.h +33 -20
  126. data/vendor/eigen/Eigen/src/Core/Solve.h +14 -14
  127. data/vendor/eigen/Eigen/src/Core/SolveTriangular.h +16 -16
  128. data/vendor/eigen/Eigen/src/Core/SolverBase.h +41 -3
  129. data/vendor/eigen/Eigen/src/Core/StableNorm.h +100 -70
  130. data/vendor/eigen/Eigen/src/Core/StlIterators.h +463 -0
  131. data/vendor/eigen/Eigen/src/Core/Stride.h +9 -4
  132. data/vendor/eigen/Eigen/src/Core/Swap.h +5 -4
  133. data/vendor/eigen/Eigen/src/Core/Transpose.h +88 -27
  134. data/vendor/eigen/Eigen/src/Core/Transpositions.h +26 -47
  135. data/vendor/eigen/Eigen/src/Core/TriangularMatrix.h +93 -75
  136. data/vendor/eigen/Eigen/src/Core/VectorBlock.h +5 -5
  137. data/vendor/eigen/Eigen/src/Core/VectorwiseOp.h +159 -70
  138. data/vendor/eigen/Eigen/src/Core/Visitor.h +137 -29
  139. data/vendor/eigen/Eigen/src/Core/arch/AVX/Complex.h +50 -129
  140. data/vendor/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +126 -337
  141. data/vendor/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +1092 -155
  142. data/vendor/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +65 -1
  143. data/vendor/eigen/Eigen/src/Core/arch/AVX512/Complex.h +422 -0
  144. data/vendor/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +207 -236
  145. data/vendor/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1482 -495
  146. data/vendor/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +89 -0
  147. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +152 -165
  148. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +19 -251
  149. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2937 -0
  150. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +221 -0
  151. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +629 -0
  152. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +2042 -392
  153. data/vendor/eigen/Eigen/src/Core/arch/CUDA/Complex.h +235 -80
  154. data/vendor/eigen/Eigen/src/Core/arch/Default/BFloat16.h +700 -0
  155. data/vendor/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +102 -14
  156. data/vendor/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1649 -0
  157. data/vendor/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +110 -0
  158. data/vendor/eigen/Eigen/src/Core/arch/Default/Half.h +942 -0
  159. data/vendor/eigen/Eigen/src/Core/arch/Default/Settings.h +1 -1
  160. data/vendor/eigen/Eigen/src/Core/arch/Default/TypeCasting.h +120 -0
  161. data/vendor/eigen/Eigen/src/Core/arch/{CUDA → GPU}/MathFunctions.h +16 -4
  162. data/vendor/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +1685 -0
  163. data/vendor/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +80 -0
  164. data/vendor/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
  165. data/vendor/eigen/Eigen/src/Core/arch/MSA/Complex.h +648 -0
  166. data/vendor/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +387 -0
  167. data/vendor/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +1233 -0
  168. data/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h +313 -219
  169. data/vendor/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +183 -0
  170. data/vendor/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +54 -70
  171. data/vendor/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +4376 -549
  172. data/vendor/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +1419 -0
  173. data/vendor/eigen/Eigen/src/Core/arch/SSE/Complex.h +59 -179
  174. data/vendor/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +65 -428
  175. data/vendor/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +893 -283
  176. data/vendor/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +65 -0
  177. data/vendor/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +44 -0
  178. data/vendor/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +752 -0
  179. data/vendor/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +49 -0
  180. data/vendor/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +232 -0
  181. data/vendor/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +301 -0
  182. data/vendor/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +670 -0
  183. data/vendor/eigen/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +694 -0
  184. data/vendor/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +85 -0
  185. data/vendor/eigen/Eigen/src/Core/arch/ZVector/Complex.h +212 -183
  186. data/vendor/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +101 -5
  187. data/vendor/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +510 -395
  188. data/vendor/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +11 -2
  189. data/vendor/eigen/Eigen/src/Core/functors/BinaryFunctors.h +112 -46
  190. data/vendor/eigen/Eigen/src/Core/functors/NullaryFunctors.h +31 -30
  191. data/vendor/eigen/Eigen/src/Core/functors/StlFunctors.h +32 -2
  192. data/vendor/eigen/Eigen/src/Core/functors/UnaryFunctors.h +355 -16
  193. data/vendor/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1075 -586
  194. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +49 -24
  195. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +41 -35
  196. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +6 -6
  197. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +4 -2
  198. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +382 -483
  199. data/vendor/eigen/Eigen/src/Core/products/Parallelizer.h +22 -5
  200. data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +53 -30
  201. data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +16 -8
  202. data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +8 -6
  203. data/vendor/eigen/Eigen/src/Core/products/SelfadjointProduct.h +4 -4
  204. data/vendor/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +5 -4
  205. data/vendor/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +33 -27
  206. data/vendor/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +14 -12
  207. data/vendor/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +36 -34
  208. data/vendor/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +8 -4
  209. data/vendor/eigen/Eigen/src/Core/products/TriangularSolverVector.h +13 -10
  210. data/vendor/eigen/Eigen/src/Core/util/BlasUtil.h +304 -119
  211. data/vendor/eigen/Eigen/src/Core/util/ConfigureVectorization.h +512 -0
  212. data/vendor/eigen/Eigen/src/Core/util/Constants.h +25 -9
  213. data/vendor/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +26 -3
  214. data/vendor/eigen/Eigen/src/Core/util/ForwardDeclarations.h +29 -9
  215. data/vendor/eigen/Eigen/src/Core/util/IndexedViewHelper.h +186 -0
  216. data/vendor/eigen/Eigen/src/Core/util/IntegralConstant.h +272 -0
  217. data/vendor/eigen/Eigen/src/Core/util/MKL_support.h +8 -1
  218. data/vendor/eigen/Eigen/src/Core/util/Macros.h +709 -246
  219. data/vendor/eigen/Eigen/src/Core/util/Memory.h +222 -52
  220. data/vendor/eigen/Eigen/src/Core/util/Meta.h +355 -77
  221. data/vendor/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +5 -1
  222. data/vendor/eigen/Eigen/src/Core/util/ReshapedHelper.h +51 -0
  223. data/vendor/eigen/Eigen/src/Core/util/StaticAssert.h +8 -5
  224. data/vendor/eigen/Eigen/src/Core/util/SymbolicIndex.h +293 -0
  225. data/vendor/eigen/Eigen/src/Core/util/XprHelper.h +65 -30
  226. data/vendor/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +1 -1
  227. data/vendor/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +7 -4
  228. data/vendor/eigen/Eigen/src/Eigenvalues/EigenSolver.h +2 -2
  229. data/vendor/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +1 -1
  230. data/vendor/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +2 -2
  231. data/vendor/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +2 -2
  232. data/vendor/eigen/Eigen/src/Eigenvalues/RealQZ.h +9 -6
  233. data/vendor/eigen/Eigen/src/Eigenvalues/RealSchur.h +21 -9
  234. data/vendor/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +77 -43
  235. data/vendor/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +20 -15
  236. data/vendor/eigen/Eigen/src/Geometry/AlignedBox.h +99 -5
  237. data/vendor/eigen/Eigen/src/Geometry/AngleAxis.h +4 -4
  238. data/vendor/eigen/Eigen/src/Geometry/EulerAngles.h +3 -3
  239. data/vendor/eigen/Eigen/src/Geometry/Homogeneous.h +15 -11
  240. data/vendor/eigen/Eigen/src/Geometry/Hyperplane.h +1 -1
  241. data/vendor/eigen/Eigen/src/Geometry/OrthoMethods.h +3 -2
  242. data/vendor/eigen/Eigen/src/Geometry/ParametrizedLine.h +39 -2
  243. data/vendor/eigen/Eigen/src/Geometry/Quaternion.h +70 -14
  244. data/vendor/eigen/Eigen/src/Geometry/Rotation2D.h +3 -3
  245. data/vendor/eigen/Eigen/src/Geometry/Scaling.h +23 -5
  246. data/vendor/eigen/Eigen/src/Geometry/Transform.h +88 -67
  247. data/vendor/eigen/Eigen/src/Geometry/Translation.h +6 -12
  248. data/vendor/eigen/Eigen/src/Geometry/Umeyama.h +1 -1
  249. data/vendor/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +168 -0
  250. data/vendor/eigen/Eigen/src/Householder/BlockHouseholder.h +9 -2
  251. data/vendor/eigen/Eigen/src/Householder/Householder.h +8 -4
  252. data/vendor/eigen/Eigen/src/Householder/HouseholderSequence.h +123 -48
  253. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +15 -15
  254. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +7 -23
  255. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +5 -22
  256. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +41 -47
  257. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +51 -60
  258. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +70 -20
  259. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +2 -20
  260. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +11 -9
  261. data/vendor/eigen/Eigen/src/Jacobi/Jacobi.h +31 -10
  262. data/vendor/eigen/Eigen/src/KLUSupport/KLUSupport.h +358 -0
  263. data/vendor/eigen/Eigen/src/LU/Determinant.h +35 -19
  264. data/vendor/eigen/Eigen/src/LU/FullPivLU.h +29 -43
  265. data/vendor/eigen/Eigen/src/LU/InverseImpl.h +25 -8
  266. data/vendor/eigen/Eigen/src/LU/PartialPivLU.h +71 -58
  267. data/vendor/eigen/Eigen/src/LU/arch/InverseSize4.h +351 -0
  268. data/vendor/eigen/Eigen/src/OrderingMethods/Amd.h +7 -17
  269. data/vendor/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +297 -277
  270. data/vendor/eigen/Eigen/src/OrderingMethods/Ordering.h +6 -10
  271. data/vendor/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +1 -1
  272. data/vendor/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +9 -7
  273. data/vendor/eigen/Eigen/src/QR/ColPivHouseholderQR.h +41 -20
  274. data/vendor/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +100 -27
  275. data/vendor/eigen/Eigen/src/QR/FullPivHouseholderQR.h +59 -22
  276. data/vendor/eigen/Eigen/src/QR/HouseholderQR.h +48 -23
  277. data/vendor/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +25 -3
  278. data/vendor/eigen/Eigen/src/SVD/BDCSVD.h +183 -63
  279. data/vendor/eigen/Eigen/src/SVD/JacobiSVD.h +22 -14
  280. data/vendor/eigen/Eigen/src/SVD/SVDBase.h +83 -22
  281. data/vendor/eigen/Eigen/src/SVD/UpperBidiagonalization.h +3 -3
  282. data/vendor/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +17 -9
  283. data/vendor/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +12 -37
  284. data/vendor/eigen/Eigen/src/SparseCore/AmbiVector.h +3 -2
  285. data/vendor/eigen/Eigen/src/SparseCore/CompressedStorage.h +16 -0
  286. data/vendor/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +6 -6
  287. data/vendor/eigen/Eigen/src/SparseCore/SparseAssign.h +81 -27
  288. data/vendor/eigen/Eigen/src/SparseCore/SparseBlock.h +25 -57
  289. data/vendor/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +40 -11
  290. data/vendor/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +11 -15
  291. data/vendor/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +4 -2
  292. data/vendor/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +30 -8
  293. data/vendor/eigen/Eigen/src/SparseCore/SparseMatrix.h +126 -11
  294. data/vendor/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +5 -12
  295. data/vendor/eigen/Eigen/src/SparseCore/SparseProduct.h +13 -1
  296. data/vendor/eigen/Eigen/src/SparseCore/SparseRef.h +7 -7
  297. data/vendor/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +5 -2
  298. data/vendor/eigen/Eigen/src/SparseCore/SparseUtil.h +8 -0
  299. data/vendor/eigen/Eigen/src/SparseCore/SparseVector.h +1 -1
  300. data/vendor/eigen/Eigen/src/SparseCore/SparseView.h +1 -0
  301. data/vendor/eigen/Eigen/src/SparseLU/SparseLU.h +162 -12
  302. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +1 -1
  303. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +76 -2
  304. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +2 -2
  305. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +1 -1
  306. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +1 -1
  307. data/vendor/eigen/Eigen/src/SparseQR/SparseQR.h +19 -6
  308. data/vendor/eigen/Eigen/src/StlSupport/StdDeque.h +2 -12
  309. data/vendor/eigen/Eigen/src/StlSupport/StdList.h +2 -2
  310. data/vendor/eigen/Eigen/src/StlSupport/StdVector.h +2 -2
  311. data/vendor/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +6 -8
  312. data/vendor/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +175 -39
  313. data/vendor/eigen/Eigen/src/misc/lapacke.h +5 -4
  314. data/vendor/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +28 -2
  315. data/vendor/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +155 -11
  316. data/vendor/eigen/Eigen/src/plugins/BlockMethods.h +626 -242
  317. data/vendor/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.h +14 -0
  318. data/vendor/eigen/Eigen/src/plugins/IndexedViewMethods.h +262 -0
  319. data/vendor/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +4 -4
  320. data/vendor/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +10 -0
  321. data/vendor/eigen/Eigen/src/plugins/ReshapedMethods.h +149 -0
  322. data/vendor/eigen/README.md +2 -0
  323. data/vendor/eigen/bench/btl/README +1 -1
  324. data/vendor/eigen/bench/tensors/README +6 -7
  325. data/vendor/eigen/ci/README.md +56 -0
  326. data/vendor/eigen/demos/mix_eigen_and_c/README +1 -1
  327. data/vendor/eigen/unsupported/Eigen/CXX11/src/Tensor/README.md +213 -158
  328. data/vendor/eigen/unsupported/README.txt +1 -1
  329. data/vendor/tomotopy/README.kr.rst +78 -0
  330. data/vendor/tomotopy/README.rst +75 -0
  331. data/vendor/tomotopy/src/Labeling/FoRelevance.cpp +2 -2
  332. data/vendor/tomotopy/src/Labeling/Phraser.hpp +4 -4
  333. data/vendor/tomotopy/src/TopicModel/CTModel.hpp +7 -3
  334. data/vendor/tomotopy/src/TopicModel/DMRModel.hpp +7 -3
  335. data/vendor/tomotopy/src/TopicModel/DTModel.hpp +6 -3
  336. data/vendor/tomotopy/src/TopicModel/GDMRModel.hpp +2 -2
  337. data/vendor/tomotopy/src/TopicModel/HDP.h +1 -0
  338. data/vendor/tomotopy/src/TopicModel/HDPModel.hpp +57 -6
  339. data/vendor/tomotopy/src/TopicModel/HLDAModel.hpp +6 -3
  340. data/vendor/tomotopy/src/TopicModel/HPAModel.hpp +3 -2
  341. data/vendor/tomotopy/src/TopicModel/LDA.h +3 -3
  342. data/vendor/tomotopy/src/TopicModel/LDACVB0Model.hpp +5 -5
  343. data/vendor/tomotopy/src/TopicModel/LDAModel.hpp +50 -19
  344. data/vendor/tomotopy/src/TopicModel/LLDAModel.hpp +6 -2
  345. data/vendor/tomotopy/src/TopicModel/MGLDAModel.hpp +3 -2
  346. data/vendor/tomotopy/src/TopicModel/PAModel.hpp +1 -1
  347. data/vendor/tomotopy/src/TopicModel/PLDAModel.hpp +6 -2
  348. data/vendor/tomotopy/src/TopicModel/PT.h +3 -1
  349. data/vendor/tomotopy/src/TopicModel/PTModel.hpp +36 -3
  350. data/vendor/tomotopy/src/TopicModel/SLDAModel.hpp +6 -3
  351. data/vendor/tomotopy/src/TopicModel/TopicModel.hpp +55 -26
  352. data/vendor/tomotopy/src/Utils/AliasMethod.hpp +5 -4
  353. data/vendor/tomotopy/src/Utils/Dictionary.h +2 -2
  354. data/vendor/tomotopy/src/Utils/EigenAddonOps.hpp +36 -1
  355. data/vendor/tomotopy/src/Utils/MultiNormalDistribution.hpp +1 -1
  356. data/vendor/tomotopy/src/Utils/TruncMultiNormal.hpp +1 -1
  357. data/vendor/tomotopy/src/Utils/exception.h +6 -0
  358. data/vendor/tomotopy/src/Utils/math.h +2 -2
  359. data/vendor/tomotopy/src/Utils/sample.hpp +14 -12
  360. data/vendor/tomotopy/src/Utils/serializer.hpp +30 -5
  361. data/vendor/tomotopy/src/Utils/sse_gamma.h +0 -3
  362. metadata +64 -18
  363. data/vendor/eigen/Eigen/CMakeLists.txt +0 -19
  364. data/vendor/eigen/Eigen/src/Core/arch/CUDA/Half.h +0 -674
  365. data/vendor/eigen/Eigen/src/Core/arch/CUDA/PacketMath.h +0 -333
  366. data/vendor/eigen/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +0 -1124
  367. data/vendor/eigen/Eigen/src/Core/arch/CUDA/TypeCasting.h +0 -212
  368. data/vendor/eigen/Eigen/src/Geometry/arch/Geometry_SSE.h +0 -161
  369. data/vendor/eigen/Eigen/src/LU/arch/Inverse_SSE.h +0 -338
@@ -0,0 +1,51 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2017 Gael Guennebaud <gael.guennebaud@inria.fr>
5
+ //
6
+ // This Source Code Form is subject to the terms of the Mozilla
7
+ // Public License v. 2.0. If a copy of the MPL was not distributed
8
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
+
10
+
11
+ #ifndef EIGEN_RESHAPED_HELPER_H
12
+ #define EIGEN_RESHAPED_HELPER_H
13
+
14
+ namespace Eigen {
15
+
16
+ enum AutoSize_t { AutoSize };
17
+ const int AutoOrder = 2;
18
+
19
+ namespace internal {
20
+
21
+ template<typename SizeType,typename OtherSize, int TotalSize>
22
+ struct get_compiletime_reshape_size {
23
+ enum { value = get_fixed_value<SizeType>::value };
24
+ };
25
+
26
+ template<typename SizeType>
27
+ Index get_runtime_reshape_size(SizeType size, Index /*other*/, Index /*total*/) {
28
+ return internal::get_runtime_value(size);
29
+ }
30
+
31
+ template<typename OtherSize, int TotalSize>
32
+ struct get_compiletime_reshape_size<AutoSize_t,OtherSize,TotalSize> {
33
+ enum {
34
+ other_size = get_fixed_value<OtherSize>::value,
35
+ value = (TotalSize==Dynamic || other_size==Dynamic) ? Dynamic : TotalSize / other_size };
36
+ };
37
+
38
+ inline Index get_runtime_reshape_size(AutoSize_t /*size*/, Index other, Index total) {
39
+ return total/other;
40
+ }
41
+
42
+ template<int Flags, int Order>
43
+ struct get_compiletime_reshape_order {
44
+ enum { value = Order == AutoOrder ? Flags & RowMajorBit : Order };
45
+ };
46
+
47
+ }
48
+
49
+ } // end namespace Eigen
50
+
51
+ #endif // EIGEN_RESHAPED_HELPER_H
@@ -27,7 +27,7 @@
27
27
  #ifndef EIGEN_STATIC_ASSERT
28
28
  #ifndef EIGEN_NO_STATIC_ASSERT
29
29
 
30
- #if EIGEN_MAX_CPP_VER>=11 && (__has_feature(cxx_static_assert) || (defined(__cplusplus) && __cplusplus >= 201103L) || (EIGEN_COMP_MSVC >= 1600))
30
+ #if EIGEN_MAX_CPP_VER>=11 && (__has_feature(cxx_static_assert) || (EIGEN_COMP_CXXVER >= 11) || (EIGEN_COMP_MSVC >= 1600))
31
31
 
32
32
  // if native static_assert is enabled, let's use it
33
33
  #define EIGEN_STATIC_ASSERT(X,MSG) static_assert(X,#MSG);
@@ -103,7 +103,10 @@
103
103
  STORAGE_KIND_MUST_MATCH=1,
104
104
  STORAGE_INDEX_MUST_MATCH=1,
105
105
  CHOLMOD_SUPPORTS_DOUBLE_PRECISION_ONLY=1,
106
- SELFADJOINTVIEW_ACCEPTS_UPPER_AND_LOWER_MODE_ONLY=1
106
+ SELFADJOINTVIEW_ACCEPTS_UPPER_AND_LOWER_MODE_ONLY=1,
107
+ INVALID_TEMPLATE_PARAMETER=1,
108
+ GPU_TENSOR_CONTRACTION_DOES_NOT_SUPPORT_OUTPUT_KERNELS=1,
109
+ THE_ARRAY_SIZE_SHOULD_EQUAL_WITH_PACKET_SIZE=1
107
110
  };
108
111
  };
109
112
 
@@ -182,7 +185,7 @@
182
185
  )
183
186
 
184
187
  #define EIGEN_STATIC_ASSERT_NON_INTEGER(TYPE) \
185
- EIGEN_STATIC_ASSERT(!NumTraits<TYPE>::IsInteger, THIS_FUNCTION_IS_NOT_FOR_INTEGER_NUMERIC_TYPES)
188
+ EIGEN_STATIC_ASSERT(!Eigen::NumTraits<TYPE>::IsInteger, THIS_FUNCTION_IS_NOT_FOR_INTEGER_NUMERIC_TYPES)
186
189
 
187
190
 
188
191
  // static assertion failing if it is guaranteed at compile-time that the two matrix expression types have different sizes
@@ -192,8 +195,8 @@
192
195
  YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES)
193
196
 
194
197
  #define EIGEN_STATIC_ASSERT_SIZE_1x1(TYPE) \
195
- EIGEN_STATIC_ASSERT((TYPE::RowsAtCompileTime == 1 || TYPE::RowsAtCompileTime == Dynamic) && \
196
- (TYPE::ColsAtCompileTime == 1 || TYPE::ColsAtCompileTime == Dynamic), \
198
+ EIGEN_STATIC_ASSERT((TYPE::RowsAtCompileTime == 1 || TYPE::RowsAtCompileTime == Eigen::Dynamic) && \
199
+ (TYPE::ColsAtCompileTime == 1 || TYPE::ColsAtCompileTime == Eigen::Dynamic), \
197
200
  THIS_METHOD_IS_ONLY_FOR_1x1_EXPRESSIONS)
198
201
 
199
202
  #define EIGEN_STATIC_ASSERT_LVALUE(Derived) \
@@ -0,0 +1,293 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2017 Gael Guennebaud <gael.guennebaud@inria.fr>
5
+ //
6
+ // This Source Code Form is subject to the terms of the Mozilla
7
+ // Public License v. 2.0. If a copy of the MPL was not distributed
8
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
+
10
+ #ifndef EIGEN_SYMBOLIC_INDEX_H
11
+ #define EIGEN_SYMBOLIC_INDEX_H
12
+
13
+ namespace Eigen {
14
+
15
+ /** \namespace Eigen::symbolic
16
+ * \ingroup Core_Module
17
+ *
18
+ * This namespace defines a set of classes and functions to build and evaluate symbolic expressions of scalar type Index.
19
+ * Here is a simple example:
20
+ *
21
+ * \code
22
+ * // First step, defines symbols:
23
+ * struct x_tag {}; static const symbolic::SymbolExpr<x_tag> x;
24
+ * struct y_tag {}; static const symbolic::SymbolExpr<y_tag> y;
25
+ * struct z_tag {}; static const symbolic::SymbolExpr<z_tag> z;
26
+ *
27
+ * // Defines an expression:
28
+ * auto expr = (x+3)/y+z;
29
+ *
30
+ * // And evaluate it: (c++14)
31
+ * std::cout << expr.eval(x=6,y=3,z=-13) << "\n";
32
+ *
33
+ * // In c++98/11, only one symbol per expression is supported for now:
34
+ * auto expr98 = (3-x)/2;
35
+ * std::cout << expr98.eval(x=6) << "\n";
36
+ * \endcode
37
+ *
38
+ * It is currently only used internally to define and manipulate the Eigen::last and Eigen::lastp1 symbols in Eigen::seq and Eigen::seqN.
39
+ *
40
+ */
41
+ namespace symbolic {
42
+
43
+ template<typename Tag> class Symbol;
44
+ template<typename Arg0> class NegateExpr;
45
+ template<typename Arg1,typename Arg2> class AddExpr;
46
+ template<typename Arg1,typename Arg2> class ProductExpr;
47
+ template<typename Arg1,typename Arg2> class QuotientExpr;
48
+
49
+ // A simple wrapper around an integral value to provide the eval method.
50
+ // We could also use a free-function symbolic_eval...
51
+ template<typename IndexType=Index>
52
+ class ValueExpr {
53
+ public:
54
+ ValueExpr(IndexType val) : m_value(val) {}
55
+ template<typename T>
56
+ IndexType eval_impl(const T&) const { return m_value; }
57
+ protected:
58
+ IndexType m_value;
59
+ };
60
+
61
+ // Specialization for compile-time value,
62
+ // It is similar to ValueExpr(N) but this version helps the compiler to generate better code.
63
+ template<int N>
64
+ class ValueExpr<internal::FixedInt<N> > {
65
+ public:
66
+ ValueExpr() {}
67
+ template<typename T>
68
+ EIGEN_CONSTEXPR Index eval_impl(const T&) const { return N; }
69
+ };
70
+
71
+
72
+ /** \class BaseExpr
73
+ * \ingroup Core_Module
74
+ * Common base class of any symbolic expressions
75
+ */
76
+ template<typename Derived>
77
+ class BaseExpr
78
+ {
79
+ public:
80
+ const Derived& derived() const { return *static_cast<const Derived*>(this); }
81
+
82
+ /** Evaluate the expression given the \a values of the symbols.
83
+ *
84
+ * \param values defines the values of the symbols, it can either be a SymbolValue or a std::tuple of SymbolValue
85
+ * as constructed by SymbolExpr::operator= operator.
86
+ *
87
+ */
88
+ template<typename T>
89
+ Index eval(const T& values) const { return derived().eval_impl(values); }
90
+
91
+ #if EIGEN_HAS_CXX14
92
+ template<typename... Types>
93
+ Index eval(Types&&... values) const { return derived().eval_impl(std::make_tuple(values...)); }
94
+ #endif
95
+
96
+ NegateExpr<Derived> operator-() const { return NegateExpr<Derived>(derived()); }
97
+
98
+ AddExpr<Derived,ValueExpr<> > operator+(Index b) const
99
+ { return AddExpr<Derived,ValueExpr<> >(derived(), b); }
100
+ AddExpr<Derived,ValueExpr<> > operator-(Index a) const
101
+ { return AddExpr<Derived,ValueExpr<> >(derived(), -a); }
102
+ ProductExpr<Derived,ValueExpr<> > operator*(Index a) const
103
+ { return ProductExpr<Derived,ValueExpr<> >(derived(),a); }
104
+ QuotientExpr<Derived,ValueExpr<> > operator/(Index a) const
105
+ { return QuotientExpr<Derived,ValueExpr<> >(derived(),a); }
106
+
107
+ friend AddExpr<Derived,ValueExpr<> > operator+(Index a, const BaseExpr& b)
108
+ { return AddExpr<Derived,ValueExpr<> >(b.derived(), a); }
109
+ friend AddExpr<NegateExpr<Derived>,ValueExpr<> > operator-(Index a, const BaseExpr& b)
110
+ { return AddExpr<NegateExpr<Derived>,ValueExpr<> >(-b.derived(), a); }
111
+ friend ProductExpr<ValueExpr<>,Derived> operator*(Index a, const BaseExpr& b)
112
+ { return ProductExpr<ValueExpr<>,Derived>(a,b.derived()); }
113
+ friend QuotientExpr<ValueExpr<>,Derived> operator/(Index a, const BaseExpr& b)
114
+ { return QuotientExpr<ValueExpr<>,Derived>(a,b.derived()); }
115
+
116
+ template<int N>
117
+ AddExpr<Derived,ValueExpr<internal::FixedInt<N> > > operator+(internal::FixedInt<N>) const
118
+ { return AddExpr<Derived,ValueExpr<internal::FixedInt<N> > >(derived(), ValueExpr<internal::FixedInt<N> >()); }
119
+ template<int N>
120
+ AddExpr<Derived,ValueExpr<internal::FixedInt<-N> > > operator-(internal::FixedInt<N>) const
121
+ { return AddExpr<Derived,ValueExpr<internal::FixedInt<-N> > >(derived(), ValueExpr<internal::FixedInt<-N> >()); }
122
+ template<int N>
123
+ ProductExpr<Derived,ValueExpr<internal::FixedInt<N> > > operator*(internal::FixedInt<N>) const
124
+ { return ProductExpr<Derived,ValueExpr<internal::FixedInt<N> > >(derived(),ValueExpr<internal::FixedInt<N> >()); }
125
+ template<int N>
126
+ QuotientExpr<Derived,ValueExpr<internal::FixedInt<N> > > operator/(internal::FixedInt<N>) const
127
+ { return QuotientExpr<Derived,ValueExpr<internal::FixedInt<N> > >(derived(),ValueExpr<internal::FixedInt<N> >()); }
128
+
129
+ template<int N>
130
+ friend AddExpr<Derived,ValueExpr<internal::FixedInt<N> > > operator+(internal::FixedInt<N>, const BaseExpr& b)
131
+ { return AddExpr<Derived,ValueExpr<internal::FixedInt<N> > >(b.derived(), ValueExpr<internal::FixedInt<N> >()); }
132
+ template<int N>
133
+ friend AddExpr<NegateExpr<Derived>,ValueExpr<internal::FixedInt<N> > > operator-(internal::FixedInt<N>, const BaseExpr& b)
134
+ { return AddExpr<NegateExpr<Derived>,ValueExpr<internal::FixedInt<N> > >(-b.derived(), ValueExpr<internal::FixedInt<N> >()); }
135
+ template<int N>
136
+ friend ProductExpr<ValueExpr<internal::FixedInt<N> >,Derived> operator*(internal::FixedInt<N>, const BaseExpr& b)
137
+ { return ProductExpr<ValueExpr<internal::FixedInt<N> >,Derived>(ValueExpr<internal::FixedInt<N> >(),b.derived()); }
138
+ template<int N>
139
+ friend QuotientExpr<ValueExpr<internal::FixedInt<N> >,Derived> operator/(internal::FixedInt<N>, const BaseExpr& b)
140
+ { return QuotientExpr<ValueExpr<internal::FixedInt<N> > ,Derived>(ValueExpr<internal::FixedInt<N> >(),b.derived()); }
141
+
142
+ #if (!EIGEN_HAS_CXX14)
143
+ template<int N>
144
+ AddExpr<Derived,ValueExpr<internal::FixedInt<N> > > operator+(internal::FixedInt<N> (*)()) const
145
+ { return AddExpr<Derived,ValueExpr<internal::FixedInt<N> > >(derived(), ValueExpr<internal::FixedInt<N> >()); }
146
+ template<int N>
147
+ AddExpr<Derived,ValueExpr<internal::FixedInt<-N> > > operator-(internal::FixedInt<N> (*)()) const
148
+ { return AddExpr<Derived,ValueExpr<internal::FixedInt<-N> > >(derived(), ValueExpr<internal::FixedInt<-N> >()); }
149
+ template<int N>
150
+ ProductExpr<Derived,ValueExpr<internal::FixedInt<N> > > operator*(internal::FixedInt<N> (*)()) const
151
+ { return ProductExpr<Derived,ValueExpr<internal::FixedInt<N> > >(derived(),ValueExpr<internal::FixedInt<N> >()); }
152
+ template<int N>
153
+ QuotientExpr<Derived,ValueExpr<internal::FixedInt<N> > > operator/(internal::FixedInt<N> (*)()) const
154
+ { return QuotientExpr<Derived,ValueExpr<internal::FixedInt<N> > >(derived(),ValueExpr<internal::FixedInt<N> >()); }
155
+
156
+ template<int N>
157
+ friend AddExpr<Derived,ValueExpr<internal::FixedInt<N> > > operator+(internal::FixedInt<N> (*)(), const BaseExpr& b)
158
+ { return AddExpr<Derived,ValueExpr<internal::FixedInt<N> > >(b.derived(), ValueExpr<internal::FixedInt<N> >()); }
159
+ template<int N>
160
+ friend AddExpr<NegateExpr<Derived>,ValueExpr<internal::FixedInt<N> > > operator-(internal::FixedInt<N> (*)(), const BaseExpr& b)
161
+ { return AddExpr<NegateExpr<Derived>,ValueExpr<internal::FixedInt<N> > >(-b.derived(), ValueExpr<internal::FixedInt<N> >()); }
162
+ template<int N>
163
+ friend ProductExpr<ValueExpr<internal::FixedInt<N> >,Derived> operator*(internal::FixedInt<N> (*)(), const BaseExpr& b)
164
+ { return ProductExpr<ValueExpr<internal::FixedInt<N> >,Derived>(ValueExpr<internal::FixedInt<N> >(),b.derived()); }
165
+ template<int N>
166
+ friend QuotientExpr<ValueExpr<internal::FixedInt<N> >,Derived> operator/(internal::FixedInt<N> (*)(), const BaseExpr& b)
167
+ { return QuotientExpr<ValueExpr<internal::FixedInt<N> > ,Derived>(ValueExpr<internal::FixedInt<N> >(),b.derived()); }
168
+ #endif
169
+
170
+
171
+ template<typename OtherDerived>
172
+ AddExpr<Derived,OtherDerived> operator+(const BaseExpr<OtherDerived> &b) const
173
+ { return AddExpr<Derived,OtherDerived>(derived(), b.derived()); }
174
+
175
+ template<typename OtherDerived>
176
+ AddExpr<Derived,NegateExpr<OtherDerived> > operator-(const BaseExpr<OtherDerived> &b) const
177
+ { return AddExpr<Derived,NegateExpr<OtherDerived> >(derived(), -b.derived()); }
178
+
179
+ template<typename OtherDerived>
180
+ ProductExpr<Derived,OtherDerived> operator*(const BaseExpr<OtherDerived> &b) const
181
+ { return ProductExpr<Derived,OtherDerived>(derived(), b.derived()); }
182
+
183
+ template<typename OtherDerived>
184
+ QuotientExpr<Derived,OtherDerived> operator/(const BaseExpr<OtherDerived> &b) const
185
+ { return QuotientExpr<Derived,OtherDerived>(derived(), b.derived()); }
186
+ };
187
+
188
+ template<typename T>
189
+ struct is_symbolic {
190
+ // BaseExpr has no conversion ctor, so we only have to check whether T can be statically cast to its base class BaseExpr<T>.
191
+ enum { value = internal::is_convertible<T,BaseExpr<T> >::value };
192
+ };
193
+
194
+ /** Represents the actual value of a symbol identified by its tag
195
+ *
196
+ * It is the return type of SymbolValue::operator=, and most of the time this is only way it is used.
197
+ */
198
+ template<typename Tag>
199
+ class SymbolValue
200
+ {
201
+ public:
202
+ /** Default constructor from the value \a val */
203
+ SymbolValue(Index val) : m_value(val) {}
204
+
205
+ /** \returns the stored value of the symbol */
206
+ Index value() const { return m_value; }
207
+ protected:
208
+ Index m_value;
209
+ };
210
+
211
+ /** Expression of a symbol uniquely identified by the template parameter type \c tag */
212
+ template<typename tag>
213
+ class SymbolExpr : public BaseExpr<SymbolExpr<tag> >
214
+ {
215
+ public:
216
+ /** Alias to the template parameter \c tag */
217
+ typedef tag Tag;
218
+
219
+ SymbolExpr() {}
220
+
221
+ /** Associate the value \a val to the given symbol \c *this, uniquely identified by its \c Tag.
222
+ *
223
+ * The returned object should be passed to ExprBase::eval() to evaluate a given expression with this specified runtime-time value.
224
+ */
225
+ SymbolValue<Tag> operator=(Index val) const {
226
+ return SymbolValue<Tag>(val);
227
+ }
228
+
229
+ Index eval_impl(const SymbolValue<Tag> &values) const { return values.value(); }
230
+
231
+ #if EIGEN_HAS_CXX14
232
+ // C++14 versions suitable for multiple symbols
233
+ template<typename... Types>
234
+ Index eval_impl(const std::tuple<Types...>& values) const { return std::get<SymbolValue<Tag> >(values).value(); }
235
+ #endif
236
+ };
237
+
238
+ template<typename Arg0>
239
+ class NegateExpr : public BaseExpr<NegateExpr<Arg0> >
240
+ {
241
+ public:
242
+ NegateExpr(const Arg0& arg0) : m_arg0(arg0) {}
243
+
244
+ template<typename T>
245
+ Index eval_impl(const T& values) const { return -m_arg0.eval_impl(values); }
246
+ protected:
247
+ Arg0 m_arg0;
248
+ };
249
+
250
+ template<typename Arg0, typename Arg1>
251
+ class AddExpr : public BaseExpr<AddExpr<Arg0,Arg1> >
252
+ {
253
+ public:
254
+ AddExpr(const Arg0& arg0, const Arg1& arg1) : m_arg0(arg0), m_arg1(arg1) {}
255
+
256
+ template<typename T>
257
+ Index eval_impl(const T& values) const { return m_arg0.eval_impl(values) + m_arg1.eval_impl(values); }
258
+ protected:
259
+ Arg0 m_arg0;
260
+ Arg1 m_arg1;
261
+ };
262
+
263
+ template<typename Arg0, typename Arg1>
264
+ class ProductExpr : public BaseExpr<ProductExpr<Arg0,Arg1> >
265
+ {
266
+ public:
267
+ ProductExpr(const Arg0& arg0, const Arg1& arg1) : m_arg0(arg0), m_arg1(arg1) {}
268
+
269
+ template<typename T>
270
+ Index eval_impl(const T& values) const { return m_arg0.eval_impl(values) * m_arg1.eval_impl(values); }
271
+ protected:
272
+ Arg0 m_arg0;
273
+ Arg1 m_arg1;
274
+ };
275
+
276
+ template<typename Arg0, typename Arg1>
277
+ class QuotientExpr : public BaseExpr<QuotientExpr<Arg0,Arg1> >
278
+ {
279
+ public:
280
+ QuotientExpr(const Arg0& arg0, const Arg1& arg1) : m_arg0(arg0), m_arg1(arg1) {}
281
+
282
+ template<typename T>
283
+ Index eval_impl(const T& values) const { return m_arg0.eval_impl(values) / m_arg1.eval_impl(values); }
284
+ protected:
285
+ Arg0 m_arg0;
286
+ Arg1 m_arg1;
287
+ };
288
+
289
+ } // end namespace symbolic
290
+
291
+ } // end namespace Eigen
292
+
293
+ #endif // EIGEN_SYMBOLIC_INDEX_H
@@ -34,6 +34,26 @@ inline IndexDest convert_index(const IndexSrc& idx) {
34
34
  return IndexDest(idx);
35
35
  }
36
36
 
37
+ // true if T can be considered as an integral index (i.e., and integral type or enum)
38
+ template<typename T> struct is_valid_index_type
39
+ {
40
+ enum { value =
41
+ #if EIGEN_HAS_TYPE_TRAITS
42
+ internal::is_integral<T>::value || std::is_enum<T>::value
43
+ #elif EIGEN_COMP_MSVC
44
+ internal::is_integral<T>::value || __is_enum(T)
45
+ #else
46
+ // without C++11, we use is_convertible to Index instead of is_integral in order to treat enums as Index.
47
+ internal::is_convertible<T,Index>::value && !internal::is_same<T,float>::value && !is_same<T,double>::value
48
+ #endif
49
+ };
50
+ };
51
+
52
+ // true if both types are not valid index types
53
+ template<typename RowIndices, typename ColIndices>
54
+ struct valid_indexed_view_overload {
55
+ enum { value = !(internal::is_valid_index_type<RowIndices>::value && internal::is_valid_index_type<ColIndices>::value) };
56
+ };
37
57
 
38
58
  // promote_scalar_arg is an helper used in operation between an expression and a scalar, like:
39
59
  // expression * scalar
@@ -90,6 +110,9 @@ class no_assignment_operator
90
110
  {
91
111
  private:
92
112
  no_assignment_operator& operator=(const no_assignment_operator&);
113
+ protected:
114
+ EIGEN_DEFAULT_COPY_CONSTRUCTOR(no_assignment_operator)
115
+ EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(no_assignment_operator)
93
116
  };
94
117
 
95
118
  /** \internal return the index type with the largest number of bits */
@@ -106,19 +129,23 @@ struct promote_index_type
106
129
  template<typename T, int Value> class variable_if_dynamic
107
130
  {
108
131
  public:
109
- EIGEN_EMPTY_STRUCT_CTOR(variable_if_dynamic)
132
+ EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(variable_if_dynamic)
110
133
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamic(T v) { EIGEN_ONLY_USED_FOR_DEBUG(v); eigen_assert(v == T(Value)); }
111
- EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE T value() { return T(Value); }
112
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T) {}
134
+ EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
135
+ T value() { return T(Value); }
136
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
137
+ operator T() const { return T(Value); }
138
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
139
+ void setValue(T v) const { EIGEN_ONLY_USED_FOR_DEBUG(v); eigen_assert(v == T(Value)); }
113
140
  };
114
141
 
115
142
  template<typename T> class variable_if_dynamic<T, Dynamic>
116
143
  {
117
144
  T m_value;
118
- EIGEN_DEVICE_FUNC variable_if_dynamic() { eigen_assert(false); }
119
145
  public:
120
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamic(T value) : m_value(value) {}
146
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamic(T value = 0) EIGEN_NO_THROW : m_value(value) {}
121
147
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T value() const { return m_value; }
148
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE operator T() const { return m_value; }
122
149
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T value) { m_value = value; }
123
150
  };
124
151
 
@@ -129,8 +156,10 @@ template<typename T, int Value> class variable_if_dynamicindex
129
156
  public:
130
157
  EIGEN_EMPTY_STRUCT_CTOR(variable_if_dynamicindex)
131
158
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamicindex(T v) { EIGEN_ONLY_USED_FOR_DEBUG(v); eigen_assert(v == T(Value)); }
132
- EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE T value() { return T(Value); }
133
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T) {}
159
+ EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
160
+ T value() { return T(Value); }
161
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
162
+ void setValue(T) {}
134
163
  };
135
164
 
136
165
  template<typename T> class variable_if_dynamicindex<T, DynamicIndex>
@@ -155,16 +184,7 @@ template<typename T> struct functor_traits
155
184
 
156
185
  template<typename T> struct packet_traits;
157
186
 
158
- template<typename T> struct unpacket_traits
159
- {
160
- typedef T type;
161
- typedef T half;
162
- enum
163
- {
164
- size = 1,
165
- alignment = 1
166
- };
167
- };
187
+ template<typename T> struct unpacket_traits;
168
188
 
169
189
  template<int Size, typename PacketType,
170
190
  bool Stop = Size==Dynamic || (Size%unpacket_traits<PacketType>::size)==0 || is_same<PacketType,typename unpacket_traits<PacketType>::half>::value>
@@ -383,7 +403,7 @@ template<typename T> struct plain_matrix_type_row_major
383
403
  typedef Matrix<typename traits<T>::Scalar,
384
404
  Rows,
385
405
  Cols,
386
- (MaxCols==1&&MaxRows!=1) ? RowMajor : ColMajor,
406
+ (MaxCols==1&&MaxRows!=1) ? ColMajor : RowMajor,
387
407
  MaxRows,
388
408
  MaxCols
389
409
  > type;
@@ -400,7 +420,7 @@ struct ref_selector
400
420
  T const&,
401
421
  const T
402
422
  >::type type;
403
-
423
+
404
424
  typedef typename conditional<
405
425
  bool(traits<T>::Flags & NestByRefBit),
406
426
  T &,
@@ -438,7 +458,7 @@ template<typename T, int n, typename PlainObject = typename plain_object_eval<T>
438
458
  {
439
459
  enum {
440
460
  ScalarReadCost = NumTraits<typename traits<T>::Scalar>::ReadCost,
441
- CoeffReadCost = evaluator<T>::CoeffReadCost, // NOTE What if an evaluator evaluate itself into a tempory?
461
+ CoeffReadCost = evaluator<T>::CoeffReadCost, // NOTE What if an evaluator evaluate itself into a temporary?
442
462
  // Then CoeffReadCost will be small (e.g., 1) but we still have to evaluate, especially if n>1.
443
463
  // This situation is already taken care by the EvalBeforeNestingBit flag, which is turned ON
444
464
  // for all evaluator creating a temporary. This flag is then propagated by the parent evaluators.
@@ -579,14 +599,14 @@ template<typename ExpressionType, typename Scalar = typename ExpressionType::Sca
579
599
  struct plain_row_type
580
600
  {
581
601
  typedef Matrix<Scalar, 1, ExpressionType::ColsAtCompileTime,
582
- ExpressionType::PlainObject::Options | RowMajor, 1, ExpressionType::MaxColsAtCompileTime> MatrixRowType;
602
+ int(ExpressionType::PlainObject::Options) | int(RowMajor), 1, ExpressionType::MaxColsAtCompileTime> MatrixRowType;
583
603
  typedef Array<Scalar, 1, ExpressionType::ColsAtCompileTime,
584
- ExpressionType::PlainObject::Options | RowMajor, 1, ExpressionType::MaxColsAtCompileTime> ArrayRowType;
604
+ int(ExpressionType::PlainObject::Options) | int(RowMajor), 1, ExpressionType::MaxColsAtCompileTime> ArrayRowType;
585
605
 
586
606
  typedef typename conditional<
587
607
  is_same< typename traits<ExpressionType>::XprKind, MatrixXpr >::value,
588
608
  MatrixRowType,
589
- ArrayRowType
609
+ ArrayRowType
590
610
  >::type type;
591
611
  };
592
612
 
@@ -601,7 +621,7 @@ struct plain_col_type
601
621
  typedef typename conditional<
602
622
  is_same< typename traits<ExpressionType>::XprKind, MatrixXpr >::value,
603
623
  MatrixColType,
604
- ArrayColType
624
+ ArrayColType
605
625
  >::type type;
606
626
  };
607
627
 
@@ -617,7 +637,7 @@ struct plain_diag_type
617
637
  typedef typename conditional<
618
638
  is_same< typename traits<ExpressionType>::XprKind, MatrixXpr >::value,
619
639
  MatrixDiagType,
620
- ArrayDiagType
640
+ ArrayDiagType
621
641
  >::type type;
622
642
  };
623
643
 
@@ -654,24 +674,39 @@ template<typename T> struct is_diagonal<DiagonalWrapper<T> >
654
674
  template<typename T, int S> struct is_diagonal<DiagonalMatrix<T,S> >
655
675
  { enum { ret = true }; };
656
676
 
677
+
678
+ template<typename T> struct is_identity
679
+ { enum { value = false }; };
680
+
681
+ template<typename T> struct is_identity<CwiseNullaryOp<internal::scalar_identity_op<typename T::Scalar>, T> >
682
+ { enum { value = true }; };
683
+
684
+
657
685
  template<typename S1, typename S2> struct glue_shapes;
658
686
  template<> struct glue_shapes<DenseShape,TriangularShape> { typedef TriangularShape type; };
659
687
 
660
688
  template<typename T1, typename T2>
661
- bool is_same_dense(const T1 &mat1, const T2 &mat2, typename enable_if<has_direct_access<T1>::ret&&has_direct_access<T2>::ret, T1>::type * = 0)
689
+ struct possibly_same_dense {
690
+ enum { value = has_direct_access<T1>::ret && has_direct_access<T2>::ret && is_same<typename T1::Scalar,typename T2::Scalar>::value };
691
+ };
692
+
693
+ template<typename T1, typename T2>
694
+ EIGEN_DEVICE_FUNC
695
+ bool is_same_dense(const T1 &mat1, const T2 &mat2, typename enable_if<possibly_same_dense<T1,T2>::value>::type * = 0)
662
696
  {
663
697
  return (mat1.data()==mat2.data()) && (mat1.innerStride()==mat2.innerStride()) && (mat1.outerStride()==mat2.outerStride());
664
698
  }
665
699
 
666
700
  template<typename T1, typename T2>
667
- bool is_same_dense(const T1 &, const T2 &, typename enable_if<!(has_direct_access<T1>::ret&&has_direct_access<T2>::ret), T1>::type * = 0)
701
+ EIGEN_DEVICE_FUNC
702
+ bool is_same_dense(const T1 &, const T2 &, typename enable_if<!possibly_same_dense<T1,T2>::value>::type * = 0)
668
703
  {
669
704
  return false;
670
705
  }
671
706
 
672
707
  // Internal helper defining the cost of a scalar division for the type T.
673
708
  // The default heuristic can be specialized for each scalar type and architecture.
674
- template<typename T,bool Vectorized=false,typename EnaleIf = void>
709
+ template<typename T,bool Vectorized=false,typename EnableIf = void>
675
710
  struct scalar_div_cost {
676
711
  enum { value = 8*NumTraits<T>::MulCost };
677
712
  };
@@ -718,7 +753,7 @@ std::string demangle_flags(int f)
718
753
  if(f&DirectAccessBit) res += " | Direct";
719
754
  if(f&NestByRefBit) res += " | NestByRef";
720
755
  if(f&NoPreferredStorageOrderBit) res += " | NoPreferredStorageOrderBit";
721
-
756
+
722
757
  return res;
723
758
  }
724
759
  #endif
@@ -815,7 +850,7 @@ struct ScalarBinaryOpTraits<void,void,BinaryOp>
815
850
  #define EIGEN_CHECK_BINARY_COMPATIBILIY(BINOP,LHS,RHS) \
816
851
  EIGEN_STATIC_ASSERT((Eigen::internal::has_ReturnType<ScalarBinaryOpTraits<LHS, RHS,BINOP> >::value), \
817
852
  YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
818
-
853
+
819
854
  } // end namespace Eigen
820
855
 
821
856
  #endif // EIGEN_XPRHELPER_H
@@ -214,7 +214,7 @@ template<typename _MatrixType> class ComplexEigenSolver
214
214
 
215
215
  /** \brief Reports whether previous computation was successful.
216
216
  *
217
- * \returns \c Success if computation was succesful, \c NoConvergence otherwise.
217
+ * \returns \c Success if computation was successful, \c NoConvergence otherwise.
218
218
  */
219
219
  ComputationInfo info() const
220
220
  {
@@ -212,7 +212,7 @@ template<typename _MatrixType> class ComplexSchur
212
212
 
213
213
  /** \brief Reports whether previous computation was successful.
214
214
  *
215
- * \returns \c Success if computation was succesful, \c NoConvergence otherwise.
215
+ * \returns \c Success if computation was successful, \c NoConvergence otherwise.
216
216
  */
217
217
  ComputationInfo info() const
218
218
  {
@@ -300,10 +300,13 @@ typename ComplexSchur<MatrixType>::ComplexScalar ComplexSchur<MatrixType>::compu
300
300
  ComplexScalar trace = t.coeff(0,0) + t.coeff(1,1);
301
301
  ComplexScalar eival1 = (trace + disc) / RealScalar(2);
302
302
  ComplexScalar eival2 = (trace - disc) / RealScalar(2);
303
-
304
- if(numext::norm1(eival1) > numext::norm1(eival2))
303
+ RealScalar eival1_norm = numext::norm1(eival1);
304
+ RealScalar eival2_norm = numext::norm1(eival2);
305
+ // A division by zero can only occur if eival1==eival2==0.
306
+ // In this case, det==0, and all we have to do is checking that eival2_norm!=0
307
+ if(eival1_norm > eival2_norm)
305
308
  eival2 = det / eival1;
306
- else
309
+ else if(eival2_norm!=RealScalar(0))
307
310
  eival1 = det / eival2;
308
311
 
309
312
  // choose the eigenvalue closest to the bottom entry of the diagonal
@@ -110,7 +110,7 @@ template<typename _MatrixType> class EigenSolver
110
110
  *
111
111
  * \sa compute() for an example.
112
112
  */
113
- EigenSolver() : m_eivec(), m_eivalues(), m_isInitialized(false), m_realSchur(), m_matT(), m_tmp() {}
113
+ EigenSolver() : m_eivec(), m_eivalues(), m_isInitialized(false), m_eigenvectorsOk(false), m_realSchur(), m_matT(), m_tmp() {}
114
114
 
115
115
  /** \brief Default constructor with memory preallocation
116
116
  *
@@ -277,7 +277,7 @@ template<typename _MatrixType> class EigenSolver
277
277
  template<typename InputType>
278
278
  EigenSolver& compute(const EigenBase<InputType>& matrix, bool computeEigenvectors = true);
279
279
 
280
- /** \returns NumericalIssue if the input contains INF or NaN values or overflow occured. Returns Success otherwise. */
280
+ /** \returns NumericalIssue if the input contains INF or NaN values or overflow occurred. Returns Success otherwise. */
281
281
  ComputationInfo info() const
282
282
  {
283
283
  eigen_assert(m_isInitialized && "EigenSolver is not initialized.");
@@ -121,7 +121,7 @@ class GeneralizedSelfAdjointEigenSolver : public SelfAdjointEigenSolver<_MatrixT
121
121
  *
122
122
  * \returns Reference to \c *this
123
123
  *
124
- * Accoring to \p options, this function computes eigenvalues and (if requested)
124
+ * According to \p options, this function computes eigenvalues and (if requested)
125
125
  * the eigenvectors of one of the following three generalized eigenproblems:
126
126
  * - \c Ax_lBx: \f$ Ax = \lambda B x \f$
127
127
  * - \c ABx_lx: \f$ ABx = \lambda x \f$