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
@@ -14,8 +14,8 @@
14
14
  #include <vector>
15
15
  #include <list>
16
16
 
17
- namespace Eigen {
18
- /**
17
+ namespace Eigen {
18
+ /**
19
19
  * \brief Modified Incomplete Cholesky with dual threshold
20
20
  *
21
21
  * References : C-J. Lin and J. J. Moré, Incomplete Cholesky Factorizations with
@@ -41,28 +41,22 @@ namespace Eigen {
41
41
  * the info() method, then you can either increase the initial shift, or better use another preconditioning technique.
42
42
  *
43
43
  */
44
- template <typename Scalar, int _UpLo = Lower, typename _OrderingType =
45
- #ifndef EIGEN_MPL2_ONLY
46
- AMDOrdering<int>
47
- #else
48
- NaturalOrdering<int>
49
- #endif
50
- >
44
+ template <typename Scalar, int _UpLo = Lower, typename _OrderingType = AMDOrdering<int> >
51
45
  class IncompleteCholesky : public SparseSolverBase<IncompleteCholesky<Scalar,_UpLo,_OrderingType> >
52
46
  {
53
47
  protected:
54
48
  typedef SparseSolverBase<IncompleteCholesky<Scalar,_UpLo,_OrderingType> > Base;
55
49
  using Base::m_isInitialized;
56
50
  public:
57
- typedef typename NumTraits<Scalar>::Real RealScalar;
51
+ typedef typename NumTraits<Scalar>::Real RealScalar;
58
52
  typedef _OrderingType OrderingType;
59
53
  typedef typename OrderingType::PermutationType PermutationType;
60
- typedef typename PermutationType::StorageIndex StorageIndex;
54
+ typedef typename PermutationType::StorageIndex StorageIndex;
61
55
  typedef SparseMatrix<Scalar,ColMajor,StorageIndex> FactorType;
62
56
  typedef Matrix<Scalar,Dynamic,1> VectorSx;
63
57
  typedef Matrix<RealScalar,Dynamic,1> VectorRx;
64
58
  typedef Matrix<StorageIndex,Dynamic, 1> VectorIx;
65
- typedef std::vector<std::list<StorageIndex> > VectorList;
59
+ typedef std::vector<std::list<StorageIndex> > VectorList;
66
60
  enum { UpLo = _UpLo };
67
61
  enum {
68
62
  ColsAtCompileTime = Dynamic,
@@ -76,22 +70,22 @@ class IncompleteCholesky : public SparseSolverBase<IncompleteCholesky<Scalar,_Up
76
70
  *
77
71
  * \sa IncompleteCholesky(const MatrixType&)
78
72
  */
79
- IncompleteCholesky() : m_initialShift(1e-3),m_factorizationIsOk(false) {}
80
-
73
+ IncompleteCholesky() : m_initialShift(1e-3),m_analysisIsOk(false),m_factorizationIsOk(false) {}
74
+
81
75
  /** Constructor computing the incomplete factorization for the given matrix \a matrix.
82
76
  */
83
77
  template<typename MatrixType>
84
- IncompleteCholesky(const MatrixType& matrix) : m_initialShift(1e-3),m_factorizationIsOk(false)
78
+ IncompleteCholesky(const MatrixType& matrix) : m_initialShift(1e-3),m_analysisIsOk(false),m_factorizationIsOk(false)
85
79
  {
86
80
  compute(matrix);
87
81
  }
88
-
82
+
89
83
  /** \returns number of rows of the factored matrix */
90
- Index rows() const { return m_L.rows(); }
91
-
84
+ EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_L.rows(); }
85
+
92
86
  /** \returns number of columns of the factored matrix */
93
- Index cols() const { return m_L.cols(); }
94
-
87
+ EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_L.cols(); }
88
+
95
89
 
96
90
  /** \brief Reports whether previous computation was successful.
97
91
  *
@@ -106,19 +100,19 @@ class IncompleteCholesky : public SparseSolverBase<IncompleteCholesky<Scalar,_Up
106
100
  eigen_assert(m_isInitialized && "IncompleteCholesky is not initialized.");
107
101
  return m_info;
108
102
  }
109
-
103
+
110
104
  /** \brief Set the initial shift parameter \f$ \sigma \f$.
111
105
  */
112
106
  void setInitialShift(RealScalar shift) { m_initialShift = shift; }
113
-
107
+
114
108
  /** \brief Computes the fill reducing permutation vector using the sparsity pattern of \a mat
115
109
  */
116
110
  template<typename MatrixType>
117
111
  void analyzePattern(const MatrixType& mat)
118
112
  {
119
- OrderingType ord;
113
+ OrderingType ord;
120
114
  PermutationType pinv;
121
- ord(mat.template selfadjointView<UpLo>(), pinv);
115
+ ord(mat.template selfadjointView<UpLo>(), pinv);
122
116
  if(pinv.size()>0) m_perm = pinv.inverse();
123
117
  else m_perm.resize(0);
124
118
  m_L.resize(mat.rows(), mat.cols());
@@ -126,7 +120,7 @@ class IncompleteCholesky : public SparseSolverBase<IncompleteCholesky<Scalar,_Up
126
120
  m_isInitialized = true;
127
121
  m_info = Success;
128
122
  }
129
-
123
+
130
124
  /** \brief Performs the numerical factorization of the input matrix \a mat
131
125
  *
132
126
  * The method analyzePattern() or compute() must have been called beforehand
@@ -136,7 +130,7 @@ class IncompleteCholesky : public SparseSolverBase<IncompleteCholesky<Scalar,_Up
136
130
  */
137
131
  template<typename MatrixType>
138
132
  void factorize(const MatrixType& mat);
139
-
133
+
140
134
  /** Computes or re-computes the incomplete Cholesky factorization of the input matrix \a mat
141
135
  *
142
136
  * It is a shortcut for a sequential call to the analyzePattern() and factorize() methods.
@@ -149,7 +143,7 @@ class IncompleteCholesky : public SparseSolverBase<IncompleteCholesky<Scalar,_Up
149
143
  analyzePattern(mat);
150
144
  factorize(mat);
151
145
  }
152
-
146
+
153
147
  // internal
154
148
  template<typename Rhs, typename Dest>
155
149
  void _solve_impl(const Rhs& b, Dest& x) const
@@ -176,16 +170,16 @@ class IncompleteCholesky : public SparseSolverBase<IncompleteCholesky<Scalar,_Up
176
170
 
177
171
  protected:
178
172
  FactorType m_L; // The lower part stored in CSC
179
- VectorRx m_scale; // The vector for scaling the matrix
173
+ VectorRx m_scale; // The vector for scaling the matrix
180
174
  RealScalar m_initialShift; // The initial shift parameter
181
- bool m_analysisIsOk;
182
- bool m_factorizationIsOk;
175
+ bool m_analysisIsOk;
176
+ bool m_factorizationIsOk;
183
177
  ComputationInfo m_info;
184
- PermutationType m_perm;
178
+ PermutationType m_perm;
185
179
 
186
180
  private:
187
- inline void updateList(Ref<const VectorIx> colPtr, Ref<VectorIx> rowIdx, Ref<VectorSx> vals, const Index& col, const Index& jk, VectorIx& firstElt, VectorList& listCol);
188
- };
181
+ inline void updateList(Ref<const VectorIx> colPtr, Ref<VectorIx> rowIdx, Ref<VectorSx> vals, const Index& col, const Index& jk, VectorIx& firstElt, VectorList& listCol);
182
+ };
189
183
 
190
184
  // Based on the following paper:
191
185
  // C-J. Lin and J. J. Moré, Incomplete Cholesky Factorizations with
@@ -196,10 +190,10 @@ template<typename _MatrixType>
196
190
  void IncompleteCholesky<Scalar,_UpLo, OrderingType>::factorize(const _MatrixType& mat)
197
191
  {
198
192
  using std::sqrt;
199
- eigen_assert(m_analysisIsOk && "analyzePattern() should be called first");
200
-
193
+ eigen_assert(m_analysisIsOk && "analyzePattern() should be called first");
194
+
201
195
  // Dropping strategy : Keep only the p largest elements per column, where p is the number of elements in the column of the original matrix. Other strategies will be added
202
-
196
+
203
197
  // Apply the fill-reducing permutation computed in analyzePattern()
204
198
  if (m_perm.rows() == mat.rows() ) // To detect the null permutation
205
199
  {
@@ -212,8 +206,8 @@ void IncompleteCholesky<Scalar,_UpLo, OrderingType>::factorize(const _MatrixType
212
206
  {
213
207
  m_L.template selfadjointView<Lower>() = mat.template selfadjointView<_UpLo>();
214
208
  }
215
-
216
- Index n = m_L.cols();
209
+
210
+ Index n = m_L.cols();
217
211
  Index nnz = m_L.nonZeros();
218
212
  Map<VectorSx> vals(m_L.valuePtr(), nnz); //values
219
213
  Map<VectorIx> rowIdx(m_L.innerIndexPtr(), nnz); //Row indices
@@ -225,9 +219,9 @@ void IncompleteCholesky<Scalar,_UpLo, OrderingType>::factorize(const _MatrixType
225
219
  VectorIx col_pattern(n);
226
220
  col_pattern.fill(-1);
227
221
  StorageIndex col_nnz;
228
-
229
-
230
- // Computes the scaling factors
222
+
223
+
224
+ // Computes the scaling factors
231
225
  m_scale.resize(n);
232
226
  m_scale.setZero();
233
227
  for (Index j = 0; j < n; j++)
@@ -237,7 +231,7 @@ void IncompleteCholesky<Scalar,_UpLo, OrderingType>::factorize(const _MatrixType
237
231
  if(rowIdx[k]!=j)
238
232
  m_scale(rowIdx[k]) += numext::abs2(vals(k));
239
233
  }
240
-
234
+
241
235
  m_scale = m_scale.cwiseSqrt().cwiseSqrt();
242
236
 
243
237
  for (Index j = 0; j < n; ++j)
@@ -247,8 +241,8 @@ void IncompleteCholesky<Scalar,_UpLo, OrderingType>::factorize(const _MatrixType
247
241
  m_scale(j) = 1;
248
242
 
249
243
  // TODO disable scaling if not needed, i.e., if it is roughly uniform? (this will make solve() faster)
250
-
251
- // Scale and compute the shift for the matrix
244
+
245
+ // Scale and compute the shift for the matrix
252
246
  RealScalar mindiag = NumTraits<RealScalar>::highest();
253
247
  for (Index j = 0; j < n; j++)
254
248
  {
@@ -259,7 +253,7 @@ void IncompleteCholesky<Scalar,_UpLo, OrderingType>::factorize(const _MatrixType
259
253
  }
260
254
 
261
255
  FactorType L_save = m_L;
262
-
256
+
263
257
  RealScalar shift = 0;
264
258
  if(mindiag <= RealScalar(0.))
265
259
  shift = m_initialShift - mindiag;
@@ -381,7 +375,7 @@ inline void IncompleteCholesky<Scalar,_UpLo, OrderingType>::updateList(Ref<const
381
375
  if (jk < colPtr(col+1) )
382
376
  {
383
377
  Index p = colPtr(col+1) - jk;
384
- Index minpos;
378
+ Index minpos;
385
379
  rowIdx.segment(jk,p).minCoeff(&minpos);
386
380
  minpos += jk;
387
381
  if (rowIdx(minpos) != rowIdx(jk))
@@ -395,6 +389,6 @@ inline void IncompleteCholesky<Scalar,_UpLo, OrderingType>::updateList(Ref<const
395
389
  }
396
390
  }
397
391
 
398
- } // end namespace Eigen
392
+ } // end namespace Eigen
399
393
 
400
394
  #endif
@@ -12,19 +12,19 @@
12
12
  #define EIGEN_INCOMPLETE_LUT_H
13
13
 
14
14
 
15
- namespace Eigen {
15
+ namespace Eigen {
16
16
 
17
17
  namespace internal {
18
-
18
+
19
19
  /** \internal
20
- * Compute a quick-sort split of a vector
20
+ * Compute a quick-sort split of a vector
21
21
  * On output, the vector row is permuted such that its elements satisfy
22
22
  * abs(row(i)) >= abs(row(ncut)) if i<ncut
23
- * abs(row(i)) <= abs(row(ncut)) if i>ncut
23
+ * abs(row(i)) <= abs(row(ncut)) if i>ncut
24
24
  * \param row The vector of values
25
25
  * \param ind The array of index for the elements in @p row
26
26
  * \param ncut The number of largest elements to keep
27
- **/
27
+ **/
28
28
  template <typename VectorV, typename VectorI>
29
29
  Index QuickSplit(VectorV &row, VectorI &ind, Index ncut)
30
30
  {
@@ -34,15 +34,15 @@ Index QuickSplit(VectorV &row, VectorI &ind, Index ncut)
34
34
  Index mid;
35
35
  Index n = row.size(); /* length of the vector */
36
36
  Index first, last ;
37
-
37
+
38
38
  ncut--; /* to fit the zero-based indices */
39
- first = 0;
40
- last = n-1;
39
+ first = 0;
40
+ last = n-1;
41
41
  if (ncut < first || ncut > last ) return 0;
42
-
42
+
43
43
  do {
44
- mid = first;
45
- RealScalar abskey = abs(row(mid));
44
+ mid = first;
45
+ RealScalar abskey = abs(row(mid));
46
46
  for (Index j = first + 1; j <= last; j++) {
47
47
  if ( abs(row(j)) > abskey) {
48
48
  ++mid;
@@ -53,12 +53,12 @@ Index QuickSplit(VectorV &row, VectorI &ind, Index ncut)
53
53
  /* Interchange for the pivot element */
54
54
  swap(row(mid), row(first));
55
55
  swap(ind(mid), ind(first));
56
-
56
+
57
57
  if (mid > ncut) last = mid - 1;
58
- else if (mid < ncut ) first = mid + 1;
58
+ else if (mid < ncut ) first = mid + 1;
59
59
  } while (mid != ncut );
60
-
61
- return 0; /* mid is equal to ncut */
60
+
61
+ return 0; /* mid is equal to ncut */
62
62
  }
63
63
 
64
64
  }// end namespace internal
@@ -71,23 +71,23 @@ Index QuickSplit(VectorV &row, VectorI &ind, Index ncut)
71
71
  *
72
72
  * During the numerical factorization, two dropping rules are used :
73
73
  * 1) any element whose magnitude is less than some tolerance is dropped.
74
- * This tolerance is obtained by multiplying the input tolerance @p droptol
74
+ * This tolerance is obtained by multiplying the input tolerance @p droptol
75
75
  * by the average magnitude of all the original elements in the current row.
76
- * 2) After the elimination of the row, only the @p fill largest elements in
77
- * the L part and the @p fill largest elements in the U part are kept
78
- * (in addition to the diagonal element ). Note that @p fill is computed from
79
- * the input parameter @p fillfactor which is used the ratio to control the fill_in
76
+ * 2) After the elimination of the row, only the @p fill largest elements in
77
+ * the L part and the @p fill largest elements in the U part are kept
78
+ * (in addition to the diagonal element ). Note that @p fill is computed from
79
+ * the input parameter @p fillfactor which is used the ratio to control the fill_in
80
80
  * relatively to the initial number of nonzero elements.
81
- *
81
+ *
82
82
  * The two extreme cases are when @p droptol=0 (to keep all the @p fill*2 largest elements)
83
- * and when @p fill=n/2 with @p droptol being different to zero.
84
- *
85
- * References : Yousef Saad, ILUT: A dual threshold incomplete LU factorization,
83
+ * and when @p fill=n/2 with @p droptol being different to zero.
84
+ *
85
+ * References : Yousef Saad, ILUT: A dual threshold incomplete LU factorization,
86
86
  * Numerical Linear Algebra with Applications, 1(4), pp 387-402, 1994.
87
- *
87
+ *
88
88
  * NOTE : The following implementation is derived from the ILUT implementation
89
- * in the SPARSKIT package, Copyright (C) 2005, the Regents of the University of Minnesota
90
- * released under the terms of the GNU LGPL:
89
+ * in the SPARSKIT package, Copyright (C) 2005, the Regents of the University of Minnesota
90
+ * released under the terms of the GNU LGPL:
91
91
  * http://www-users.cs.umn.edu/~saad/software/SPARSKIT/README
92
92
  * However, Yousef Saad gave us permission to relicense his ILUT code to MPL2.
93
93
  * See the Eigen mailing list archive, thread: ILUT, date: July 8, 2012:
@@ -115,28 +115,28 @@ class IncompleteLUT : public SparseSolverBase<IncompleteLUT<_Scalar, _StorageInd
115
115
  };
116
116
 
117
117
  public:
118
-
118
+
119
119
  IncompleteLUT()
120
120
  : m_droptol(NumTraits<Scalar>::dummy_precision()), m_fillfactor(10),
121
121
  m_analysisIsOk(false), m_factorizationIsOk(false)
122
122
  {}
123
-
123
+
124
124
  template<typename MatrixType>
125
125
  explicit IncompleteLUT(const MatrixType& mat, const RealScalar& droptol=NumTraits<Scalar>::dummy_precision(), int fillfactor = 10)
126
126
  : m_droptol(droptol),m_fillfactor(fillfactor),
127
127
  m_analysisIsOk(false),m_factorizationIsOk(false)
128
128
  {
129
129
  eigen_assert(fillfactor != 0);
130
- compute(mat);
130
+ compute(mat);
131
131
  }
132
-
133
- Index rows() const { return m_lu.rows(); }
134
-
135
- Index cols() const { return m_lu.cols(); }
132
+
133
+ EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_lu.rows(); }
134
+
135
+ EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_lu.cols(); }
136
136
 
137
137
  /** \brief Reports whether previous computation was successful.
138
138
  *
139
- * \returns \c Success if computation was succesful,
139
+ * \returns \c Success if computation was successful,
140
140
  * \c NumericalIssue if the matrix.appears to be negative.
141
141
  */
142
142
  ComputationInfo info() const
@@ -144,36 +144,36 @@ class IncompleteLUT : public SparseSolverBase<IncompleteLUT<_Scalar, _StorageInd
144
144
  eigen_assert(m_isInitialized && "IncompleteLUT is not initialized.");
145
145
  return m_info;
146
146
  }
147
-
147
+
148
148
  template<typename MatrixType>
149
149
  void analyzePattern(const MatrixType& amat);
150
-
150
+
151
151
  template<typename MatrixType>
152
152
  void factorize(const MatrixType& amat);
153
-
153
+
154
154
  /**
155
155
  * Compute an incomplete LU factorization with dual threshold on the matrix mat
156
156
  * No pivoting is done in this version
157
- *
157
+ *
158
158
  **/
159
159
  template<typename MatrixType>
160
160
  IncompleteLUT& compute(const MatrixType& amat)
161
161
  {
162
- analyzePattern(amat);
162
+ analyzePattern(amat);
163
163
  factorize(amat);
164
164
  return *this;
165
165
  }
166
166
 
167
- void setDroptol(const RealScalar& droptol);
168
- void setFillfactor(int fillfactor);
169
-
167
+ void setDroptol(const RealScalar& droptol);
168
+ void setFillfactor(int fillfactor);
169
+
170
170
  template<typename Rhs, typename Dest>
171
171
  void _solve_impl(const Rhs& b, Dest& x) const
172
172
  {
173
173
  x = m_Pinv * b;
174
174
  x = m_lu.template triangularView<UnitLower>().solve(x);
175
175
  x = m_lu.template triangularView<Upper>().solve(x);
176
- x = m_P * x;
176
+ x = m_P * x;
177
177
  }
178
178
 
179
179
  protected:
@@ -200,22 +200,22 @@ protected:
200
200
 
201
201
  /**
202
202
  * Set control parameter droptol
203
- * \param droptol Drop any element whose magnitude is less than this tolerance
204
- **/
203
+ * \param droptol Drop any element whose magnitude is less than this tolerance
204
+ **/
205
205
  template<typename Scalar, typename StorageIndex>
206
206
  void IncompleteLUT<Scalar,StorageIndex>::setDroptol(const RealScalar& droptol)
207
207
  {
208
- this->m_droptol = droptol;
208
+ this->m_droptol = droptol;
209
209
  }
210
210
 
211
211
  /**
212
212
  * Set control parameter fillfactor
213
- * \param fillfactor This is used to compute the number @p fill_in of largest elements to keep on each row.
214
- **/
213
+ * \param fillfactor This is used to compute the number @p fill_in of largest elements to keep on each row.
214
+ **/
215
215
  template<typename Scalar, typename StorageIndex>
216
216
  void IncompleteLUT<Scalar,StorageIndex>::setFillfactor(int fillfactor)
217
217
  {
218
- this->m_fillfactor = fillfactor;
218
+ this->m_fillfactor = fillfactor;
219
219
  }
220
220
 
221
221
  template <typename Scalar, typename StorageIndex>
@@ -225,24 +225,15 @@ void IncompleteLUT<Scalar,StorageIndex>::analyzePattern(const _MatrixType& amat)
225
225
  // Compute the Fill-reducing permutation
226
226
  // Since ILUT does not perform any numerical pivoting,
227
227
  // it is highly preferable to keep the diagonal through symmetric permutations.
228
- #ifndef EIGEN_MPL2_ONLY
229
228
  // To this end, let's symmetrize the pattern and perform AMD on it.
230
229
  SparseMatrix<Scalar,ColMajor, StorageIndex> mat1 = amat;
231
230
  SparseMatrix<Scalar,ColMajor, StorageIndex> mat2 = amat.transpose();
232
231
  // FIXME for a matrix with nearly symmetric pattern, mat2+mat1 is the appropriate choice.
233
- // on the other hand for a really non-symmetric pattern, mat2*mat1 should be prefered...
232
+ // on the other hand for a really non-symmetric pattern, mat2*mat1 should be preferred...
234
233
  SparseMatrix<Scalar,ColMajor, StorageIndex> AtA = mat2 + mat1;
235
234
  AMDOrdering<StorageIndex> ordering;
236
235
  ordering(AtA,m_P);
237
236
  m_Pinv = m_P.inverse(); // cache the inverse permutation
238
- #else
239
- // If AMD is not available, (MPL2-only), then let's use the slower COLAMD routine.
240
- SparseMatrix<Scalar,ColMajor, StorageIndex> mat1 = amat;
241
- COLAMDOrdering<StorageIndex> ordering;
242
- ordering(mat1,m_Pinv);
243
- m_P = m_Pinv.inverse();
244
- #endif
245
-
246
237
  m_analysisIsOk = true;
247
238
  m_factorizationIsOk = false;
248
239
  m_isInitialized = true;
@@ -10,7 +10,7 @@
10
10
  #ifndef EIGEN_ITERATIVE_SOLVER_BASE_H
11
11
  #define EIGEN_ITERATIVE_SOLVER_BASE_H
12
12
 
13
- namespace Eigen {
13
+ namespace Eigen {
14
14
 
15
15
  namespace internal {
16
16
 
@@ -145,7 +145,7 @@ class IterativeSolverBase : public SparseSolverBase<Derived>
145
145
  protected:
146
146
  typedef SparseSolverBase<Derived> Base;
147
147
  using Base::m_isInitialized;
148
-
148
+
149
149
  public:
150
150
  typedef typename internal::traits<Derived>::MatrixType MatrixType;
151
151
  typedef typename internal::traits<Derived>::Preconditioner Preconditioner;
@@ -169,10 +169,10 @@ public:
169
169
  }
170
170
 
171
171
  /** Initialize the solver with matrix \a A for further \c Ax=b solving.
172
- *
172
+ *
173
173
  * This constructor is a shortcut for the default constructor followed
174
174
  * by a call to compute().
175
- *
175
+ *
176
176
  * \warning this class stores a reference to the matrix A as well as some
177
177
  * precomputed values that depend on it. Therefore, if \a A is changed
178
178
  * this class becomes invalid. Call compute() to update it with the new
@@ -187,7 +187,7 @@ public:
187
187
  }
188
188
 
189
189
  ~IterativeSolverBase() {}
190
-
190
+
191
191
  /** Initializes the iterative solver for the sparsity pattern of the matrix \a A for further solving \c Ax=b problems.
192
192
  *
193
193
  * Currently, this function mostly calls analyzePattern on the preconditioner. In the future
@@ -203,7 +203,7 @@ public:
203
203
  m_info = m_preconditioner.info();
204
204
  return derived();
205
205
  }
206
-
206
+
207
207
  /** Initializes the iterative solver with the numerical values of the matrix \a A for further solving \c Ax=b problems.
208
208
  *
209
209
  * Currently, this function mostly calls factorize on the preconditioner.
@@ -216,7 +216,7 @@ public:
216
216
  template<typename MatrixDerived>
217
217
  Derived& factorize(const EigenBase<MatrixDerived>& A)
218
218
  {
219
- eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
219
+ eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
220
220
  grab(A.derived());
221
221
  m_preconditioner.factorize(matrix());
222
222
  m_factorizationIsOk = true;
@@ -247,16 +247,16 @@ public:
247
247
  }
248
248
 
249
249
  /** \internal */
250
- Index rows() const { return matrix().rows(); }
250
+ EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return matrix().rows(); }
251
251
 
252
252
  /** \internal */
253
- Index cols() const { return matrix().cols(); }
253
+ EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return matrix().cols(); }
254
254
 
255
255
  /** \returns the tolerance threshold used by the stopping criteria.
256
256
  * \sa setTolerance()
257
257
  */
258
258
  RealScalar tolerance() const { return m_tolerance; }
259
-
259
+
260
260
  /** Sets the tolerance threshold used by the stopping criteria.
261
261
  *
262
262
  * This value is used as an upper bound to the relative residual error: |Ax-b|/|b|.
@@ -270,19 +270,19 @@ public:
270
270
 
271
271
  /** \returns a read-write reference to the preconditioner for custom configuration. */
272
272
  Preconditioner& preconditioner() { return m_preconditioner; }
273
-
273
+
274
274
  /** \returns a read-only reference to the preconditioner. */
275
275
  const Preconditioner& preconditioner() const { return m_preconditioner; }
276
276
 
277
277
  /** \returns the max number of iterations.
278
- * It is either the value setted by setMaxIterations or, by default,
278
+ * It is either the value set by setMaxIterations or, by default,
279
279
  * twice the number of columns of the matrix.
280
280
  */
281
281
  Index maxIterations() const
282
282
  {
283
283
  return (m_maxIterations<0) ? 2*matrix().cols() : m_maxIterations;
284
284
  }
285
-
285
+
286
286
  /** Sets the max number of iterations.
287
287
  * Default is twice the number of columns of the matrix.
288
288
  */
@@ -328,13 +328,13 @@ public:
328
328
  eigen_assert(m_isInitialized && "IterativeSolverBase is not initialized.");
329
329
  return m_info;
330
330
  }
331
-
331
+
332
332
  /** \internal */
333
333
  template<typename Rhs, typename DestDerived>
334
- void _solve_impl(const Rhs& b, SparseMatrixBase<DestDerived> &aDest) const
334
+ void _solve_with_guess_impl(const Rhs& b, SparseMatrixBase<DestDerived> &aDest) const
335
335
  {
336
336
  eigen_assert(rows()==b.rows());
337
-
337
+
338
338
  Index rhsCols = b.cols();
339
339
  Index size = b.rows();
340
340
  DestDerived& dest(aDest.derived());
@@ -344,15 +344,65 @@ public:
344
344
  // We do not directly fill dest because sparse expressions have to be free of aliasing issue.
345
345
  // For non square least-square problems, b and dest might not have the same size whereas they might alias each-other.
346
346
  typename DestDerived::PlainObject tmp(cols(),rhsCols);
347
+ ComputationInfo global_info = Success;
347
348
  for(Index k=0; k<rhsCols; ++k)
348
349
  {
349
350
  tb = b.col(k);
350
- tx = derived().solve(tb);
351
+ tx = dest.col(k);
352
+ derived()._solve_vector_with_guess_impl(tb,tx);
351
353
  tmp.col(k) = tx.sparseView(0);
354
+
355
+ // The call to _solve_vector_with_guess_impl updates m_info, so if it failed for a previous column
356
+ // we need to restore it to the worst value.
357
+ if(m_info==NumericalIssue)
358
+ global_info = NumericalIssue;
359
+ else if(m_info==NoConvergence)
360
+ global_info = NoConvergence;
352
361
  }
362
+ m_info = global_info;
353
363
  dest.swap(tmp);
354
364
  }
355
365
 
366
+ template<typename Rhs, typename DestDerived>
367
+ typename internal::enable_if<Rhs::ColsAtCompileTime!=1 && DestDerived::ColsAtCompileTime!=1>::type
368
+ _solve_with_guess_impl(const Rhs& b, MatrixBase<DestDerived> &aDest) const
369
+ {
370
+ eigen_assert(rows()==b.rows());
371
+
372
+ Index rhsCols = b.cols();
373
+ DestDerived& dest(aDest.derived());
374
+ ComputationInfo global_info = Success;
375
+ for(Index k=0; k<rhsCols; ++k)
376
+ {
377
+ typename DestDerived::ColXpr xk(dest,k);
378
+ typename Rhs::ConstColXpr bk(b,k);
379
+ derived()._solve_vector_with_guess_impl(bk,xk);
380
+
381
+ // The call to _solve_vector_with_guess updates m_info, so if it failed for a previous column
382
+ // we need to restore it to the worst value.
383
+ if(m_info==NumericalIssue)
384
+ global_info = NumericalIssue;
385
+ else if(m_info==NoConvergence)
386
+ global_info = NoConvergence;
387
+ }
388
+ m_info = global_info;
389
+ }
390
+
391
+ template<typename Rhs, typename DestDerived>
392
+ typename internal::enable_if<Rhs::ColsAtCompileTime==1 || DestDerived::ColsAtCompileTime==1>::type
393
+ _solve_with_guess_impl(const Rhs& b, MatrixBase<DestDerived> &dest) const
394
+ {
395
+ derived()._solve_vector_with_guess_impl(b,dest.derived());
396
+ }
397
+
398
+ /** \internal default initial guess = 0 */
399
+ template<typename Rhs,typename Dest>
400
+ void _solve_impl(const Rhs& b, Dest& x) const
401
+ {
402
+ x.setZero();
403
+ derived()._solve_with_guess_impl(b,x);
404
+ }
405
+
356
406
  protected:
357
407
  void init()
358
408
  {
@@ -370,19 +420,19 @@ protected:
370
420
  {
371
421
  return m_matrixWrapper.matrix();
372
422
  }
373
-
423
+
374
424
  template<typename InputType>
375
425
  void grab(const InputType &A)
376
426
  {
377
427
  m_matrixWrapper.grab(A);
378
428
  }
379
-
429
+
380
430
  MatrixWrapper m_matrixWrapper;
381
431
  Preconditioner m_preconditioner;
382
432
 
383
433
  Index m_maxIterations;
384
434
  RealScalar m_tolerance;
385
-
435
+
386
436
  mutable RealScalar m_error;
387
437
  mutable Index m_iterations;
388
438
  mutable ComputationInfo m_info;