tomoto 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (420) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +3 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +123 -0
  5. data/ext/tomoto/ext.cpp +245 -0
  6. data/ext/tomoto/extconf.rb +28 -0
  7. data/lib/tomoto.rb +12 -0
  8. data/lib/tomoto/ct.rb +11 -0
  9. data/lib/tomoto/hdp.rb +11 -0
  10. data/lib/tomoto/lda.rb +67 -0
  11. data/lib/tomoto/version.rb +3 -0
  12. data/vendor/EigenRand/EigenRand/Core.h +1139 -0
  13. data/vendor/EigenRand/EigenRand/Dists/Basic.h +111 -0
  14. data/vendor/EigenRand/EigenRand/Dists/Discrete.h +877 -0
  15. data/vendor/EigenRand/EigenRand/Dists/GammaPoisson.h +108 -0
  16. data/vendor/EigenRand/EigenRand/Dists/NormalExp.h +626 -0
  17. data/vendor/EigenRand/EigenRand/EigenRand +19 -0
  18. data/vendor/EigenRand/EigenRand/Macro.h +24 -0
  19. data/vendor/EigenRand/EigenRand/MorePacketMath.h +978 -0
  20. data/vendor/EigenRand/EigenRand/PacketFilter.h +286 -0
  21. data/vendor/EigenRand/EigenRand/PacketRandomEngine.h +624 -0
  22. data/vendor/EigenRand/EigenRand/RandUtils.h +413 -0
  23. data/vendor/EigenRand/EigenRand/doc.h +220 -0
  24. data/vendor/EigenRand/LICENSE +21 -0
  25. data/vendor/EigenRand/README.md +288 -0
  26. data/vendor/eigen/COPYING.BSD +26 -0
  27. data/vendor/eigen/COPYING.GPL +674 -0
  28. data/vendor/eigen/COPYING.LGPL +502 -0
  29. data/vendor/eigen/COPYING.MINPACK +52 -0
  30. data/vendor/eigen/COPYING.MPL2 +373 -0
  31. data/vendor/eigen/COPYING.README +18 -0
  32. data/vendor/eigen/Eigen/CMakeLists.txt +19 -0
  33. data/vendor/eigen/Eigen/Cholesky +46 -0
  34. data/vendor/eigen/Eigen/CholmodSupport +48 -0
  35. data/vendor/eigen/Eigen/Core +537 -0
  36. data/vendor/eigen/Eigen/Dense +7 -0
  37. data/vendor/eigen/Eigen/Eigen +2 -0
  38. data/vendor/eigen/Eigen/Eigenvalues +61 -0
  39. data/vendor/eigen/Eigen/Geometry +62 -0
  40. data/vendor/eigen/Eigen/Householder +30 -0
  41. data/vendor/eigen/Eigen/IterativeLinearSolvers +48 -0
  42. data/vendor/eigen/Eigen/Jacobi +33 -0
  43. data/vendor/eigen/Eigen/LU +50 -0
  44. data/vendor/eigen/Eigen/MetisSupport +35 -0
  45. data/vendor/eigen/Eigen/OrderingMethods +73 -0
  46. data/vendor/eigen/Eigen/PaStiXSupport +48 -0
  47. data/vendor/eigen/Eigen/PardisoSupport +35 -0
  48. data/vendor/eigen/Eigen/QR +51 -0
  49. data/vendor/eigen/Eigen/QtAlignedMalloc +40 -0
  50. data/vendor/eigen/Eigen/SPQRSupport +34 -0
  51. data/vendor/eigen/Eigen/SVD +51 -0
  52. data/vendor/eigen/Eigen/Sparse +36 -0
  53. data/vendor/eigen/Eigen/SparseCholesky +45 -0
  54. data/vendor/eigen/Eigen/SparseCore +69 -0
  55. data/vendor/eigen/Eigen/SparseLU +46 -0
  56. data/vendor/eigen/Eigen/SparseQR +37 -0
  57. data/vendor/eigen/Eigen/StdDeque +27 -0
  58. data/vendor/eigen/Eigen/StdList +26 -0
  59. data/vendor/eigen/Eigen/StdVector +27 -0
  60. data/vendor/eigen/Eigen/SuperLUSupport +64 -0
  61. data/vendor/eigen/Eigen/UmfPackSupport +40 -0
  62. data/vendor/eigen/Eigen/src/Cholesky/LDLT.h +673 -0
  63. data/vendor/eigen/Eigen/src/Cholesky/LLT.h +542 -0
  64. data/vendor/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h +99 -0
  65. data/vendor/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +639 -0
  66. data/vendor/eigen/Eigen/src/Core/Array.h +329 -0
  67. data/vendor/eigen/Eigen/src/Core/ArrayBase.h +226 -0
  68. data/vendor/eigen/Eigen/src/Core/ArrayWrapper.h +209 -0
  69. data/vendor/eigen/Eigen/src/Core/Assign.h +90 -0
  70. data/vendor/eigen/Eigen/src/Core/AssignEvaluator.h +935 -0
  71. data/vendor/eigen/Eigen/src/Core/Assign_MKL.h +178 -0
  72. data/vendor/eigen/Eigen/src/Core/BandMatrix.h +353 -0
  73. data/vendor/eigen/Eigen/src/Core/Block.h +452 -0
  74. data/vendor/eigen/Eigen/src/Core/BooleanRedux.h +164 -0
  75. data/vendor/eigen/Eigen/src/Core/CommaInitializer.h +160 -0
  76. data/vendor/eigen/Eigen/src/Core/ConditionEstimator.h +175 -0
  77. data/vendor/eigen/Eigen/src/Core/CoreEvaluators.h +1688 -0
  78. data/vendor/eigen/Eigen/src/Core/CoreIterators.h +127 -0
  79. data/vendor/eigen/Eigen/src/Core/CwiseBinaryOp.h +184 -0
  80. data/vendor/eigen/Eigen/src/Core/CwiseNullaryOp.h +866 -0
  81. data/vendor/eigen/Eigen/src/Core/CwiseTernaryOp.h +197 -0
  82. data/vendor/eigen/Eigen/src/Core/CwiseUnaryOp.h +103 -0
  83. data/vendor/eigen/Eigen/src/Core/CwiseUnaryView.h +128 -0
  84. data/vendor/eigen/Eigen/src/Core/DenseBase.h +611 -0
  85. data/vendor/eigen/Eigen/src/Core/DenseCoeffsBase.h +681 -0
  86. data/vendor/eigen/Eigen/src/Core/DenseStorage.h +570 -0
  87. data/vendor/eigen/Eigen/src/Core/Diagonal.h +260 -0
  88. data/vendor/eigen/Eigen/src/Core/DiagonalMatrix.h +343 -0
  89. data/vendor/eigen/Eigen/src/Core/DiagonalProduct.h +28 -0
  90. data/vendor/eigen/Eigen/src/Core/Dot.h +318 -0
  91. data/vendor/eigen/Eigen/src/Core/EigenBase.h +159 -0
  92. data/vendor/eigen/Eigen/src/Core/ForceAlignedAccess.h +146 -0
  93. data/vendor/eigen/Eigen/src/Core/Fuzzy.h +155 -0
  94. data/vendor/eigen/Eigen/src/Core/GeneralProduct.h +455 -0
  95. data/vendor/eigen/Eigen/src/Core/GenericPacketMath.h +593 -0
  96. data/vendor/eigen/Eigen/src/Core/GlobalFunctions.h +187 -0
  97. data/vendor/eigen/Eigen/src/Core/IO.h +225 -0
  98. data/vendor/eigen/Eigen/src/Core/Inverse.h +118 -0
  99. data/vendor/eigen/Eigen/src/Core/Map.h +171 -0
  100. data/vendor/eigen/Eigen/src/Core/MapBase.h +303 -0
  101. data/vendor/eigen/Eigen/src/Core/MathFunctions.h +1415 -0
  102. data/vendor/eigen/Eigen/src/Core/MathFunctionsImpl.h +101 -0
  103. data/vendor/eigen/Eigen/src/Core/Matrix.h +459 -0
  104. data/vendor/eigen/Eigen/src/Core/MatrixBase.h +529 -0
  105. data/vendor/eigen/Eigen/src/Core/NestByValue.h +110 -0
  106. data/vendor/eigen/Eigen/src/Core/NoAlias.h +108 -0
  107. data/vendor/eigen/Eigen/src/Core/NumTraits.h +248 -0
  108. data/vendor/eigen/Eigen/src/Core/PermutationMatrix.h +633 -0
  109. data/vendor/eigen/Eigen/src/Core/PlainObjectBase.h +1035 -0
  110. data/vendor/eigen/Eigen/src/Core/Product.h +186 -0
  111. data/vendor/eigen/Eigen/src/Core/ProductEvaluators.h +1112 -0
  112. data/vendor/eigen/Eigen/src/Core/Random.h +182 -0
  113. data/vendor/eigen/Eigen/src/Core/Redux.h +505 -0
  114. data/vendor/eigen/Eigen/src/Core/Ref.h +283 -0
  115. data/vendor/eigen/Eigen/src/Core/Replicate.h +142 -0
  116. data/vendor/eigen/Eigen/src/Core/ReturnByValue.h +117 -0
  117. data/vendor/eigen/Eigen/src/Core/Reverse.h +211 -0
  118. data/vendor/eigen/Eigen/src/Core/Select.h +162 -0
  119. data/vendor/eigen/Eigen/src/Core/SelfAdjointView.h +352 -0
  120. data/vendor/eigen/Eigen/src/Core/SelfCwiseBinaryOp.h +47 -0
  121. data/vendor/eigen/Eigen/src/Core/Solve.h +188 -0
  122. data/vendor/eigen/Eigen/src/Core/SolveTriangular.h +235 -0
  123. data/vendor/eigen/Eigen/src/Core/SolverBase.h +130 -0
  124. data/vendor/eigen/Eigen/src/Core/StableNorm.h +221 -0
  125. data/vendor/eigen/Eigen/src/Core/Stride.h +111 -0
  126. data/vendor/eigen/Eigen/src/Core/Swap.h +67 -0
  127. data/vendor/eigen/Eigen/src/Core/Transpose.h +403 -0
  128. data/vendor/eigen/Eigen/src/Core/Transpositions.h +407 -0
  129. data/vendor/eigen/Eigen/src/Core/TriangularMatrix.h +983 -0
  130. data/vendor/eigen/Eigen/src/Core/VectorBlock.h +96 -0
  131. data/vendor/eigen/Eigen/src/Core/VectorwiseOp.h +695 -0
  132. data/vendor/eigen/Eigen/src/Core/Visitor.h +273 -0
  133. data/vendor/eigen/Eigen/src/Core/arch/AVX/Complex.h +451 -0
  134. data/vendor/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +439 -0
  135. data/vendor/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +637 -0
  136. data/vendor/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +51 -0
  137. data/vendor/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +391 -0
  138. data/vendor/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1316 -0
  139. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +430 -0
  140. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +322 -0
  141. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +1061 -0
  142. data/vendor/eigen/Eigen/src/Core/arch/CUDA/Complex.h +103 -0
  143. data/vendor/eigen/Eigen/src/Core/arch/CUDA/Half.h +674 -0
  144. data/vendor/eigen/Eigen/src/Core/arch/CUDA/MathFunctions.h +91 -0
  145. data/vendor/eigen/Eigen/src/Core/arch/CUDA/PacketMath.h +333 -0
  146. data/vendor/eigen/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +1124 -0
  147. data/vendor/eigen/Eigen/src/Core/arch/CUDA/TypeCasting.h +212 -0
  148. data/vendor/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +29 -0
  149. data/vendor/eigen/Eigen/src/Core/arch/Default/Settings.h +49 -0
  150. data/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h +490 -0
  151. data/vendor/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +91 -0
  152. data/vendor/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +760 -0
  153. data/vendor/eigen/Eigen/src/Core/arch/SSE/Complex.h +471 -0
  154. data/vendor/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +562 -0
  155. data/vendor/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +895 -0
  156. data/vendor/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +77 -0
  157. data/vendor/eigen/Eigen/src/Core/arch/ZVector/Complex.h +397 -0
  158. data/vendor/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +137 -0
  159. data/vendor/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +945 -0
  160. data/vendor/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +168 -0
  161. data/vendor/eigen/Eigen/src/Core/functors/BinaryFunctors.h +475 -0
  162. data/vendor/eigen/Eigen/src/Core/functors/NullaryFunctors.h +188 -0
  163. data/vendor/eigen/Eigen/src/Core/functors/StlFunctors.h +136 -0
  164. data/vendor/eigen/Eigen/src/Core/functors/TernaryFunctors.h +25 -0
  165. data/vendor/eigen/Eigen/src/Core/functors/UnaryFunctors.h +792 -0
  166. data/vendor/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +2156 -0
  167. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +492 -0
  168. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +311 -0
  169. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +145 -0
  170. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +122 -0
  171. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +619 -0
  172. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +136 -0
  173. data/vendor/eigen/Eigen/src/Core/products/Parallelizer.h +163 -0
  174. data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +521 -0
  175. data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +287 -0
  176. data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +260 -0
  177. data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +118 -0
  178. data/vendor/eigen/Eigen/src/Core/products/SelfadjointProduct.h +133 -0
  179. data/vendor/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +93 -0
  180. data/vendor/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +466 -0
  181. data/vendor/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +315 -0
  182. data/vendor/eigen/Eigen/src/Core/products/TriangularMatrixVector.h +350 -0
  183. data/vendor/eigen/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +255 -0
  184. data/vendor/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +335 -0
  185. data/vendor/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +163 -0
  186. data/vendor/eigen/Eigen/src/Core/products/TriangularSolverVector.h +145 -0
  187. data/vendor/eigen/Eigen/src/Core/util/BlasUtil.h +398 -0
  188. data/vendor/eigen/Eigen/src/Core/util/Constants.h +547 -0
  189. data/vendor/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +83 -0
  190. data/vendor/eigen/Eigen/src/Core/util/ForwardDeclarations.h +302 -0
  191. data/vendor/eigen/Eigen/src/Core/util/MKL_support.h +130 -0
  192. data/vendor/eigen/Eigen/src/Core/util/Macros.h +1001 -0
  193. data/vendor/eigen/Eigen/src/Core/util/Memory.h +993 -0
  194. data/vendor/eigen/Eigen/src/Core/util/Meta.h +534 -0
  195. data/vendor/eigen/Eigen/src/Core/util/NonMPL2.h +3 -0
  196. data/vendor/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +27 -0
  197. data/vendor/eigen/Eigen/src/Core/util/StaticAssert.h +218 -0
  198. data/vendor/eigen/Eigen/src/Core/util/XprHelper.h +821 -0
  199. data/vendor/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +346 -0
  200. data/vendor/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +459 -0
  201. data/vendor/eigen/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +91 -0
  202. data/vendor/eigen/Eigen/src/Eigenvalues/EigenSolver.h +622 -0
  203. data/vendor/eigen/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +418 -0
  204. data/vendor/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +226 -0
  205. data/vendor/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +374 -0
  206. data/vendor/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +158 -0
  207. data/vendor/eigen/Eigen/src/Eigenvalues/RealQZ.h +654 -0
  208. data/vendor/eigen/Eigen/src/Eigenvalues/RealSchur.h +546 -0
  209. data/vendor/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +77 -0
  210. data/vendor/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +870 -0
  211. data/vendor/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +87 -0
  212. data/vendor/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +556 -0
  213. data/vendor/eigen/Eigen/src/Geometry/AlignedBox.h +392 -0
  214. data/vendor/eigen/Eigen/src/Geometry/AngleAxis.h +247 -0
  215. data/vendor/eigen/Eigen/src/Geometry/EulerAngles.h +114 -0
  216. data/vendor/eigen/Eigen/src/Geometry/Homogeneous.h +497 -0
  217. data/vendor/eigen/Eigen/src/Geometry/Hyperplane.h +282 -0
  218. data/vendor/eigen/Eigen/src/Geometry/OrthoMethods.h +234 -0
  219. data/vendor/eigen/Eigen/src/Geometry/ParametrizedLine.h +195 -0
  220. data/vendor/eigen/Eigen/src/Geometry/Quaternion.h +814 -0
  221. data/vendor/eigen/Eigen/src/Geometry/Rotation2D.h +199 -0
  222. data/vendor/eigen/Eigen/src/Geometry/RotationBase.h +206 -0
  223. data/vendor/eigen/Eigen/src/Geometry/Scaling.h +170 -0
  224. data/vendor/eigen/Eigen/src/Geometry/Transform.h +1542 -0
  225. data/vendor/eigen/Eigen/src/Geometry/Translation.h +208 -0
  226. data/vendor/eigen/Eigen/src/Geometry/Umeyama.h +166 -0
  227. data/vendor/eigen/Eigen/src/Geometry/arch/Geometry_SSE.h +161 -0
  228. data/vendor/eigen/Eigen/src/Householder/BlockHouseholder.h +103 -0
  229. data/vendor/eigen/Eigen/src/Householder/Householder.h +172 -0
  230. data/vendor/eigen/Eigen/src/Householder/HouseholderSequence.h +470 -0
  231. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +226 -0
  232. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +228 -0
  233. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +246 -0
  234. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +400 -0
  235. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +462 -0
  236. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +394 -0
  237. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +216 -0
  238. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +115 -0
  239. data/vendor/eigen/Eigen/src/Jacobi/Jacobi.h +462 -0
  240. data/vendor/eigen/Eigen/src/LU/Determinant.h +101 -0
  241. data/vendor/eigen/Eigen/src/LU/FullPivLU.h +891 -0
  242. data/vendor/eigen/Eigen/src/LU/InverseImpl.h +415 -0
  243. data/vendor/eigen/Eigen/src/LU/PartialPivLU.h +611 -0
  244. data/vendor/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h +83 -0
  245. data/vendor/eigen/Eigen/src/LU/arch/Inverse_SSE.h +338 -0
  246. data/vendor/eigen/Eigen/src/MetisSupport/MetisSupport.h +137 -0
  247. data/vendor/eigen/Eigen/src/OrderingMethods/Amd.h +445 -0
  248. data/vendor/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +1843 -0
  249. data/vendor/eigen/Eigen/src/OrderingMethods/Ordering.h +157 -0
  250. data/vendor/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +678 -0
  251. data/vendor/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +543 -0
  252. data/vendor/eigen/Eigen/src/QR/ColPivHouseholderQR.h +653 -0
  253. data/vendor/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +97 -0
  254. data/vendor/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +562 -0
  255. data/vendor/eigen/Eigen/src/QR/FullPivHouseholderQR.h +676 -0
  256. data/vendor/eigen/Eigen/src/QR/HouseholderQR.h +409 -0
  257. data/vendor/eigen/Eigen/src/QR/HouseholderQR_LAPACKE.h +68 -0
  258. data/vendor/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +313 -0
  259. data/vendor/eigen/Eigen/src/SVD/BDCSVD.h +1246 -0
  260. data/vendor/eigen/Eigen/src/SVD/JacobiSVD.h +804 -0
  261. data/vendor/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h +91 -0
  262. data/vendor/eigen/Eigen/src/SVD/SVDBase.h +315 -0
  263. data/vendor/eigen/Eigen/src/SVD/UpperBidiagonalization.h +414 -0
  264. data/vendor/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +689 -0
  265. data/vendor/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +199 -0
  266. data/vendor/eigen/Eigen/src/SparseCore/AmbiVector.h +377 -0
  267. data/vendor/eigen/Eigen/src/SparseCore/CompressedStorage.h +258 -0
  268. data/vendor/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +352 -0
  269. data/vendor/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h +67 -0
  270. data/vendor/eigen/Eigen/src/SparseCore/SparseAssign.h +216 -0
  271. data/vendor/eigen/Eigen/src/SparseCore/SparseBlock.h +603 -0
  272. data/vendor/eigen/Eigen/src/SparseCore/SparseColEtree.h +206 -0
  273. data/vendor/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +341 -0
  274. data/vendor/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +726 -0
  275. data/vendor/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +148 -0
  276. data/vendor/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +320 -0
  277. data/vendor/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h +138 -0
  278. data/vendor/eigen/Eigen/src/SparseCore/SparseDot.h +98 -0
  279. data/vendor/eigen/Eigen/src/SparseCore/SparseFuzzy.h +29 -0
  280. data/vendor/eigen/Eigen/src/SparseCore/SparseMap.h +305 -0
  281. data/vendor/eigen/Eigen/src/SparseCore/SparseMatrix.h +1403 -0
  282. data/vendor/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +405 -0
  283. data/vendor/eigen/Eigen/src/SparseCore/SparsePermutation.h +178 -0
  284. data/vendor/eigen/Eigen/src/SparseCore/SparseProduct.h +169 -0
  285. data/vendor/eigen/Eigen/src/SparseCore/SparseRedux.h +49 -0
  286. data/vendor/eigen/Eigen/src/SparseCore/SparseRef.h +397 -0
  287. data/vendor/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +656 -0
  288. data/vendor/eigen/Eigen/src/SparseCore/SparseSolverBase.h +124 -0
  289. data/vendor/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +198 -0
  290. data/vendor/eigen/Eigen/src/SparseCore/SparseTranspose.h +92 -0
  291. data/vendor/eigen/Eigen/src/SparseCore/SparseTriangularView.h +189 -0
  292. data/vendor/eigen/Eigen/src/SparseCore/SparseUtil.h +178 -0
  293. data/vendor/eigen/Eigen/src/SparseCore/SparseVector.h +478 -0
  294. data/vendor/eigen/Eigen/src/SparseCore/SparseView.h +253 -0
  295. data/vendor/eigen/Eigen/src/SparseCore/TriangularSolver.h +315 -0
  296. data/vendor/eigen/Eigen/src/SparseLU/SparseLU.h +773 -0
  297. data/vendor/eigen/Eigen/src/SparseLU/SparseLUImpl.h +66 -0
  298. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +226 -0
  299. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_Structs.h +110 -0
  300. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +301 -0
  301. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_Utils.h +80 -0
  302. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_column_bmod.h +181 -0
  303. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +179 -0
  304. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +107 -0
  305. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +280 -0
  306. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +126 -0
  307. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +130 -0
  308. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +223 -0
  309. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_panel_dfs.h +258 -0
  310. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_pivotL.h +137 -0
  311. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_pruneL.h +136 -0
  312. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_relax_snode.h +83 -0
  313. data/vendor/eigen/Eigen/src/SparseQR/SparseQR.h +745 -0
  314. data/vendor/eigen/Eigen/src/StlSupport/StdDeque.h +126 -0
  315. data/vendor/eigen/Eigen/src/StlSupport/StdList.h +106 -0
  316. data/vendor/eigen/Eigen/src/StlSupport/StdVector.h +131 -0
  317. data/vendor/eigen/Eigen/src/StlSupport/details.h +84 -0
  318. data/vendor/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +1027 -0
  319. data/vendor/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +506 -0
  320. data/vendor/eigen/Eigen/src/misc/Image.h +82 -0
  321. data/vendor/eigen/Eigen/src/misc/Kernel.h +79 -0
  322. data/vendor/eigen/Eigen/src/misc/RealSvd2x2.h +55 -0
  323. data/vendor/eigen/Eigen/src/misc/blas.h +440 -0
  324. data/vendor/eigen/Eigen/src/misc/lapack.h +152 -0
  325. data/vendor/eigen/Eigen/src/misc/lapacke.h +16291 -0
  326. data/vendor/eigen/Eigen/src/misc/lapacke_mangling.h +17 -0
  327. data/vendor/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +332 -0
  328. data/vendor/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +552 -0
  329. data/vendor/eigen/Eigen/src/plugins/BlockMethods.h +1058 -0
  330. data/vendor/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.h +115 -0
  331. data/vendor/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.h +163 -0
  332. data/vendor/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +152 -0
  333. data/vendor/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +85 -0
  334. data/vendor/eigen/README.md +3 -0
  335. data/vendor/eigen/bench/README.txt +55 -0
  336. data/vendor/eigen/bench/btl/COPYING +340 -0
  337. data/vendor/eigen/bench/btl/README +154 -0
  338. data/vendor/eigen/bench/tensors/README +21 -0
  339. data/vendor/eigen/blas/README.txt +6 -0
  340. data/vendor/eigen/demos/mandelbrot/README +10 -0
  341. data/vendor/eigen/demos/mix_eigen_and_c/README +9 -0
  342. data/vendor/eigen/demos/opengl/README +13 -0
  343. data/vendor/eigen/unsupported/Eigen/CXX11/src/Tensor/README.md +1760 -0
  344. data/vendor/eigen/unsupported/README.txt +50 -0
  345. data/vendor/tomotopy/LICENSE +21 -0
  346. data/vendor/tomotopy/README.kr.rst +375 -0
  347. data/vendor/tomotopy/README.rst +382 -0
  348. data/vendor/tomotopy/src/Labeling/FoRelevance.cpp +362 -0
  349. data/vendor/tomotopy/src/Labeling/FoRelevance.h +88 -0
  350. data/vendor/tomotopy/src/Labeling/Labeler.h +50 -0
  351. data/vendor/tomotopy/src/TopicModel/CT.h +37 -0
  352. data/vendor/tomotopy/src/TopicModel/CTModel.cpp +13 -0
  353. data/vendor/tomotopy/src/TopicModel/CTModel.hpp +293 -0
  354. data/vendor/tomotopy/src/TopicModel/DMR.h +51 -0
  355. data/vendor/tomotopy/src/TopicModel/DMRModel.cpp +13 -0
  356. data/vendor/tomotopy/src/TopicModel/DMRModel.hpp +374 -0
  357. data/vendor/tomotopy/src/TopicModel/DT.h +65 -0
  358. data/vendor/tomotopy/src/TopicModel/DTM.h +22 -0
  359. data/vendor/tomotopy/src/TopicModel/DTModel.cpp +15 -0
  360. data/vendor/tomotopy/src/TopicModel/DTModel.hpp +572 -0
  361. data/vendor/tomotopy/src/TopicModel/GDMR.h +37 -0
  362. data/vendor/tomotopy/src/TopicModel/GDMRModel.cpp +14 -0
  363. data/vendor/tomotopy/src/TopicModel/GDMRModel.hpp +485 -0
  364. data/vendor/tomotopy/src/TopicModel/HDP.h +74 -0
  365. data/vendor/tomotopy/src/TopicModel/HDPModel.cpp +13 -0
  366. data/vendor/tomotopy/src/TopicModel/HDPModel.hpp +592 -0
  367. data/vendor/tomotopy/src/TopicModel/HLDA.h +40 -0
  368. data/vendor/tomotopy/src/TopicModel/HLDAModel.cpp +13 -0
  369. data/vendor/tomotopy/src/TopicModel/HLDAModel.hpp +681 -0
  370. data/vendor/tomotopy/src/TopicModel/HPA.h +27 -0
  371. data/vendor/tomotopy/src/TopicModel/HPAModel.cpp +21 -0
  372. data/vendor/tomotopy/src/TopicModel/HPAModel.hpp +588 -0
  373. data/vendor/tomotopy/src/TopicModel/LDA.h +144 -0
  374. data/vendor/tomotopy/src/TopicModel/LDACVB0Model.hpp +442 -0
  375. data/vendor/tomotopy/src/TopicModel/LDAModel.cpp +13 -0
  376. data/vendor/tomotopy/src/TopicModel/LDAModel.hpp +1058 -0
  377. data/vendor/tomotopy/src/TopicModel/LLDA.h +45 -0
  378. data/vendor/tomotopy/src/TopicModel/LLDAModel.cpp +13 -0
  379. data/vendor/tomotopy/src/TopicModel/LLDAModel.hpp +203 -0
  380. data/vendor/tomotopy/src/TopicModel/MGLDA.h +63 -0
  381. data/vendor/tomotopy/src/TopicModel/MGLDAModel.cpp +17 -0
  382. data/vendor/tomotopy/src/TopicModel/MGLDAModel.hpp +558 -0
  383. data/vendor/tomotopy/src/TopicModel/PA.h +43 -0
  384. data/vendor/tomotopy/src/TopicModel/PAModel.cpp +13 -0
  385. data/vendor/tomotopy/src/TopicModel/PAModel.hpp +467 -0
  386. data/vendor/tomotopy/src/TopicModel/PLDA.h +17 -0
  387. data/vendor/tomotopy/src/TopicModel/PLDAModel.cpp +13 -0
  388. data/vendor/tomotopy/src/TopicModel/PLDAModel.hpp +214 -0
  389. data/vendor/tomotopy/src/TopicModel/SLDA.h +54 -0
  390. data/vendor/tomotopy/src/TopicModel/SLDAModel.cpp +17 -0
  391. data/vendor/tomotopy/src/TopicModel/SLDAModel.hpp +456 -0
  392. data/vendor/tomotopy/src/TopicModel/TopicModel.hpp +692 -0
  393. data/vendor/tomotopy/src/Utils/AliasMethod.hpp +169 -0
  394. data/vendor/tomotopy/src/Utils/Dictionary.h +80 -0
  395. data/vendor/tomotopy/src/Utils/EigenAddonOps.hpp +181 -0
  396. data/vendor/tomotopy/src/Utils/LBFGS.h +202 -0
  397. data/vendor/tomotopy/src/Utils/LBFGS/LineSearchBacktracking.h +120 -0
  398. data/vendor/tomotopy/src/Utils/LBFGS/LineSearchBracketing.h +122 -0
  399. data/vendor/tomotopy/src/Utils/LBFGS/Param.h +213 -0
  400. data/vendor/tomotopy/src/Utils/LUT.hpp +82 -0
  401. data/vendor/tomotopy/src/Utils/MultiNormalDistribution.hpp +69 -0
  402. data/vendor/tomotopy/src/Utils/PolyaGamma.hpp +200 -0
  403. data/vendor/tomotopy/src/Utils/PolyaGammaHybrid.hpp +672 -0
  404. data/vendor/tomotopy/src/Utils/ThreadPool.hpp +150 -0
  405. data/vendor/tomotopy/src/Utils/Trie.hpp +220 -0
  406. data/vendor/tomotopy/src/Utils/TruncMultiNormal.hpp +94 -0
  407. data/vendor/tomotopy/src/Utils/Utils.hpp +337 -0
  408. data/vendor/tomotopy/src/Utils/avx_gamma.h +46 -0
  409. data/vendor/tomotopy/src/Utils/avx_mathfun.h +736 -0
  410. data/vendor/tomotopy/src/Utils/exception.h +28 -0
  411. data/vendor/tomotopy/src/Utils/math.h +281 -0
  412. data/vendor/tomotopy/src/Utils/rtnorm.hpp +2690 -0
  413. data/vendor/tomotopy/src/Utils/sample.hpp +192 -0
  414. data/vendor/tomotopy/src/Utils/serializer.hpp +695 -0
  415. data/vendor/tomotopy/src/Utils/slp.hpp +131 -0
  416. data/vendor/tomotopy/src/Utils/sse_gamma.h +48 -0
  417. data/vendor/tomotopy/src/Utils/sse_mathfun.h +710 -0
  418. data/vendor/tomotopy/src/Utils/text.hpp +49 -0
  419. data/vendor/tomotopy/src/Utils/tvector.hpp +543 -0
  420. metadata +531 -0
@@ -0,0 +1,197 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2008-2014 Gael Guennebaud <gael.guennebaud@inria.fr>
5
+ // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
6
+ // Copyright (C) 2016 Eugene Brevdo <ebrevdo@gmail.com>
7
+ //
8
+ // This Source Code Form is subject to the terms of the Mozilla
9
+ // Public License v. 2.0. If a copy of the MPL was not distributed
10
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
11
+
12
+ #ifndef EIGEN_CWISE_TERNARY_OP_H
13
+ #define EIGEN_CWISE_TERNARY_OP_H
14
+
15
+ namespace Eigen {
16
+
17
+ namespace internal {
18
+ template <typename TernaryOp, typename Arg1, typename Arg2, typename Arg3>
19
+ struct traits<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3> > {
20
+ // we must not inherit from traits<Arg1> since it has
21
+ // the potential to cause problems with MSVC
22
+ typedef typename remove_all<Arg1>::type Ancestor;
23
+ typedef typename traits<Ancestor>::XprKind XprKind;
24
+ enum {
25
+ RowsAtCompileTime = traits<Ancestor>::RowsAtCompileTime,
26
+ ColsAtCompileTime = traits<Ancestor>::ColsAtCompileTime,
27
+ MaxRowsAtCompileTime = traits<Ancestor>::MaxRowsAtCompileTime,
28
+ MaxColsAtCompileTime = traits<Ancestor>::MaxColsAtCompileTime
29
+ };
30
+
31
+ // even though we require Arg1, Arg2, and Arg3 to have the same scalar type
32
+ // (see CwiseTernaryOp constructor),
33
+ // we still want to handle the case when the result type is different.
34
+ typedef typename result_of<TernaryOp(
35
+ const typename Arg1::Scalar&, const typename Arg2::Scalar&,
36
+ const typename Arg3::Scalar&)>::type Scalar;
37
+
38
+ typedef typename internal::traits<Arg1>::StorageKind StorageKind;
39
+ typedef typename internal::traits<Arg1>::StorageIndex StorageIndex;
40
+
41
+ typedef typename Arg1::Nested Arg1Nested;
42
+ typedef typename Arg2::Nested Arg2Nested;
43
+ typedef typename Arg3::Nested Arg3Nested;
44
+ typedef typename remove_reference<Arg1Nested>::type _Arg1Nested;
45
+ typedef typename remove_reference<Arg2Nested>::type _Arg2Nested;
46
+ typedef typename remove_reference<Arg3Nested>::type _Arg3Nested;
47
+ enum { Flags = _Arg1Nested::Flags & RowMajorBit };
48
+ };
49
+ } // end namespace internal
50
+
51
+ template <typename TernaryOp, typename Arg1, typename Arg2, typename Arg3,
52
+ typename StorageKind>
53
+ class CwiseTernaryOpImpl;
54
+
55
+ /** \class CwiseTernaryOp
56
+ * \ingroup Core_Module
57
+ *
58
+ * \brief Generic expression where a coefficient-wise ternary operator is
59
+ * applied to two expressions
60
+ *
61
+ * \tparam TernaryOp template functor implementing the operator
62
+ * \tparam Arg1Type the type of the first argument
63
+ * \tparam Arg2Type the type of the second argument
64
+ * \tparam Arg3Type the type of the third argument
65
+ *
66
+ * This class represents an expression where a coefficient-wise ternary
67
+ * operator is applied to three expressions.
68
+ * It is the return type of ternary operators, by which we mean only those
69
+ * ternary operators where
70
+ * all three arguments are Eigen expressions.
71
+ * For example, the return type of betainc(matrix1, matrix2, matrix3) is a
72
+ * CwiseTernaryOp.
73
+ *
74
+ * Most of the time, this is the only way that it is used, so you typically
75
+ * don't have to name
76
+ * CwiseTernaryOp types explicitly.
77
+ *
78
+ * \sa MatrixBase::ternaryExpr(const MatrixBase<Argument2> &, const
79
+ * MatrixBase<Argument3> &, const CustomTernaryOp &) const, class CwiseBinaryOp,
80
+ * class CwiseUnaryOp, class CwiseNullaryOp
81
+ */
82
+ template <typename TernaryOp, typename Arg1Type, typename Arg2Type,
83
+ typename Arg3Type>
84
+ class CwiseTernaryOp : public CwiseTernaryOpImpl<
85
+ TernaryOp, Arg1Type, Arg2Type, Arg3Type,
86
+ typename internal::traits<Arg1Type>::StorageKind>,
87
+ internal::no_assignment_operator
88
+ {
89
+ public:
90
+ typedef typename internal::remove_all<Arg1Type>::type Arg1;
91
+ typedef typename internal::remove_all<Arg2Type>::type Arg2;
92
+ typedef typename internal::remove_all<Arg3Type>::type Arg3;
93
+
94
+ typedef typename CwiseTernaryOpImpl<
95
+ TernaryOp, Arg1Type, Arg2Type, Arg3Type,
96
+ typename internal::traits<Arg1Type>::StorageKind>::Base Base;
97
+ EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseTernaryOp)
98
+
99
+ typedef typename internal::ref_selector<Arg1Type>::type Arg1Nested;
100
+ typedef typename internal::ref_selector<Arg2Type>::type Arg2Nested;
101
+ typedef typename internal::ref_selector<Arg3Type>::type Arg3Nested;
102
+ typedef typename internal::remove_reference<Arg1Nested>::type _Arg1Nested;
103
+ typedef typename internal::remove_reference<Arg2Nested>::type _Arg2Nested;
104
+ typedef typename internal::remove_reference<Arg3Nested>::type _Arg3Nested;
105
+
106
+ EIGEN_DEVICE_FUNC
107
+ EIGEN_STRONG_INLINE CwiseTernaryOp(const Arg1& a1, const Arg2& a2,
108
+ const Arg3& a3,
109
+ const TernaryOp& func = TernaryOp())
110
+ : m_arg1(a1), m_arg2(a2), m_arg3(a3), m_functor(func) {
111
+ // require the sizes to match
112
+ EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Arg1, Arg2)
113
+ EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Arg1, Arg3)
114
+
115
+ // The index types should match
116
+ EIGEN_STATIC_ASSERT((internal::is_same<
117
+ typename internal::traits<Arg1Type>::StorageKind,
118
+ typename internal::traits<Arg2Type>::StorageKind>::value),
119
+ STORAGE_KIND_MUST_MATCH)
120
+ EIGEN_STATIC_ASSERT((internal::is_same<
121
+ typename internal::traits<Arg1Type>::StorageKind,
122
+ typename internal::traits<Arg3Type>::StorageKind>::value),
123
+ STORAGE_KIND_MUST_MATCH)
124
+
125
+ eigen_assert(a1.rows() == a2.rows() && a1.cols() == a2.cols() &&
126
+ a1.rows() == a3.rows() && a1.cols() == a3.cols());
127
+ }
128
+
129
+ EIGEN_DEVICE_FUNC
130
+ EIGEN_STRONG_INLINE Index rows() const {
131
+ // return the fixed size type if available to enable compile time
132
+ // optimizations
133
+ if (internal::traits<typename internal::remove_all<Arg1Nested>::type>::
134
+ RowsAtCompileTime == Dynamic &&
135
+ internal::traits<typename internal::remove_all<Arg2Nested>::type>::
136
+ RowsAtCompileTime == Dynamic)
137
+ return m_arg3.rows();
138
+ else if (internal::traits<typename internal::remove_all<Arg1Nested>::type>::
139
+ RowsAtCompileTime == Dynamic &&
140
+ internal::traits<typename internal::remove_all<Arg3Nested>::type>::
141
+ RowsAtCompileTime == Dynamic)
142
+ return m_arg2.rows();
143
+ else
144
+ return m_arg1.rows();
145
+ }
146
+ EIGEN_DEVICE_FUNC
147
+ EIGEN_STRONG_INLINE Index cols() const {
148
+ // return the fixed size type if available to enable compile time
149
+ // optimizations
150
+ if (internal::traits<typename internal::remove_all<Arg1Nested>::type>::
151
+ ColsAtCompileTime == Dynamic &&
152
+ internal::traits<typename internal::remove_all<Arg2Nested>::type>::
153
+ ColsAtCompileTime == Dynamic)
154
+ return m_arg3.cols();
155
+ else if (internal::traits<typename internal::remove_all<Arg1Nested>::type>::
156
+ ColsAtCompileTime == Dynamic &&
157
+ internal::traits<typename internal::remove_all<Arg3Nested>::type>::
158
+ ColsAtCompileTime == Dynamic)
159
+ return m_arg2.cols();
160
+ else
161
+ return m_arg1.cols();
162
+ }
163
+
164
+ /** \returns the first argument nested expression */
165
+ EIGEN_DEVICE_FUNC
166
+ const _Arg1Nested& arg1() const { return m_arg1; }
167
+ /** \returns the first argument nested expression */
168
+ EIGEN_DEVICE_FUNC
169
+ const _Arg2Nested& arg2() const { return m_arg2; }
170
+ /** \returns the third argument nested expression */
171
+ EIGEN_DEVICE_FUNC
172
+ const _Arg3Nested& arg3() const { return m_arg3; }
173
+ /** \returns the functor representing the ternary operation */
174
+ EIGEN_DEVICE_FUNC
175
+ const TernaryOp& functor() const { return m_functor; }
176
+
177
+ protected:
178
+ Arg1Nested m_arg1;
179
+ Arg2Nested m_arg2;
180
+ Arg3Nested m_arg3;
181
+ const TernaryOp m_functor;
182
+ };
183
+
184
+ // Generic API dispatcher
185
+ template <typename TernaryOp, typename Arg1, typename Arg2, typename Arg3,
186
+ typename StorageKind>
187
+ class CwiseTernaryOpImpl
188
+ : public internal::generic_xpr_base<
189
+ CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3> >::type {
190
+ public:
191
+ typedef typename internal::generic_xpr_base<
192
+ CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3> >::type Base;
193
+ };
194
+
195
+ } // end namespace Eigen
196
+
197
+ #endif // EIGEN_CWISE_TERNARY_OP_H
@@ -0,0 +1,103 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2008-2014 Gael Guennebaud <gael.guennebaud@inria.fr>
5
+ // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
6
+ //
7
+ // This Source Code Form is subject to the terms of the Mozilla
8
+ // Public License v. 2.0. If a copy of the MPL was not distributed
9
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
+
11
+ #ifndef EIGEN_CWISE_UNARY_OP_H
12
+ #define EIGEN_CWISE_UNARY_OP_H
13
+
14
+ namespace Eigen {
15
+
16
+ namespace internal {
17
+ template<typename UnaryOp, typename XprType>
18
+ struct traits<CwiseUnaryOp<UnaryOp, XprType> >
19
+ : traits<XprType>
20
+ {
21
+ typedef typename result_of<
22
+ UnaryOp(const typename XprType::Scalar&)
23
+ >::type Scalar;
24
+ typedef typename XprType::Nested XprTypeNested;
25
+ typedef typename remove_reference<XprTypeNested>::type _XprTypeNested;
26
+ enum {
27
+ Flags = _XprTypeNested::Flags & RowMajorBit
28
+ };
29
+ };
30
+ }
31
+
32
+ template<typename UnaryOp, typename XprType, typename StorageKind>
33
+ class CwiseUnaryOpImpl;
34
+
35
+ /** \class CwiseUnaryOp
36
+ * \ingroup Core_Module
37
+ *
38
+ * \brief Generic expression where a coefficient-wise unary operator is applied to an expression
39
+ *
40
+ * \tparam UnaryOp template functor implementing the operator
41
+ * \tparam XprType the type of the expression to which we are applying the unary operator
42
+ *
43
+ * This class represents an expression where a unary operator is applied to an expression.
44
+ * It is the return type of all operations taking exactly 1 input expression, regardless of the
45
+ * presence of other inputs such as scalars. For example, the operator* in the expression 3*matrix
46
+ * is considered unary, because only the right-hand side is an expression, and its
47
+ * return type is a specialization of CwiseUnaryOp.
48
+ *
49
+ * Most of the time, this is the only way that it is used, so you typically don't have to name
50
+ * CwiseUnaryOp types explicitly.
51
+ *
52
+ * \sa MatrixBase::unaryExpr(const CustomUnaryOp &) const, class CwiseBinaryOp, class CwiseNullaryOp
53
+ */
54
+ template<typename UnaryOp, typename XprType>
55
+ class CwiseUnaryOp : public CwiseUnaryOpImpl<UnaryOp, XprType, typename internal::traits<XprType>::StorageKind>, internal::no_assignment_operator
56
+ {
57
+ public:
58
+
59
+ typedef typename CwiseUnaryOpImpl<UnaryOp, XprType,typename internal::traits<XprType>::StorageKind>::Base Base;
60
+ EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseUnaryOp)
61
+ typedef typename internal::ref_selector<XprType>::type XprTypeNested;
62
+ typedef typename internal::remove_all<XprType>::type NestedExpression;
63
+
64
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
65
+ explicit CwiseUnaryOp(const XprType& xpr, const UnaryOp& func = UnaryOp())
66
+ : m_xpr(xpr), m_functor(func) {}
67
+
68
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
69
+ Index rows() const { return m_xpr.rows(); }
70
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
71
+ Index cols() const { return m_xpr.cols(); }
72
+
73
+ /** \returns the functor representing the unary operation */
74
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
75
+ const UnaryOp& functor() const { return m_functor; }
76
+
77
+ /** \returns the nested expression */
78
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
79
+ const typename internal::remove_all<XprTypeNested>::type&
80
+ nestedExpression() const { return m_xpr; }
81
+
82
+ /** \returns the nested expression */
83
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
84
+ typename internal::remove_all<XprTypeNested>::type&
85
+ nestedExpression() { return m_xpr; }
86
+
87
+ protected:
88
+ XprTypeNested m_xpr;
89
+ const UnaryOp m_functor;
90
+ };
91
+
92
+ // Generic API dispatcher
93
+ template<typename UnaryOp, typename XprType, typename StorageKind>
94
+ class CwiseUnaryOpImpl
95
+ : public internal::generic_xpr_base<CwiseUnaryOp<UnaryOp, XprType> >::type
96
+ {
97
+ public:
98
+ typedef typename internal::generic_xpr_base<CwiseUnaryOp<UnaryOp, XprType> >::type Base;
99
+ };
100
+
101
+ } // end namespace Eigen
102
+
103
+ #endif // EIGEN_CWISE_UNARY_OP_H
@@ -0,0 +1,128 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2009-2010 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_CWISE_UNARY_VIEW_H
11
+ #define EIGEN_CWISE_UNARY_VIEW_H
12
+
13
+ namespace Eigen {
14
+
15
+ namespace internal {
16
+ template<typename ViewOp, typename MatrixType>
17
+ struct traits<CwiseUnaryView<ViewOp, MatrixType> >
18
+ : traits<MatrixType>
19
+ {
20
+ typedef typename result_of<
21
+ ViewOp(const typename traits<MatrixType>::Scalar&)
22
+ >::type Scalar;
23
+ typedef typename MatrixType::Nested MatrixTypeNested;
24
+ typedef typename remove_all<MatrixTypeNested>::type _MatrixTypeNested;
25
+ enum {
26
+ FlagsLvalueBit = is_lvalue<MatrixType>::value ? LvalueBit : 0,
27
+ Flags = traits<_MatrixTypeNested>::Flags & (RowMajorBit | FlagsLvalueBit | DirectAccessBit), // FIXME DirectAccessBit should not be handled by expressions
28
+ MatrixTypeInnerStride = inner_stride_at_compile_time<MatrixType>::ret,
29
+ // need to cast the sizeof's from size_t to int explicitly, otherwise:
30
+ // "error: no integral type can represent all of the enumerator values
31
+ InnerStrideAtCompileTime = MatrixTypeInnerStride == Dynamic
32
+ ? int(Dynamic)
33
+ : int(MatrixTypeInnerStride) * int(sizeof(typename traits<MatrixType>::Scalar) / sizeof(Scalar)),
34
+ OuterStrideAtCompileTime = outer_stride_at_compile_time<MatrixType>::ret == Dynamic
35
+ ? int(Dynamic)
36
+ : outer_stride_at_compile_time<MatrixType>::ret * int(sizeof(typename traits<MatrixType>::Scalar) / sizeof(Scalar))
37
+ };
38
+ };
39
+ }
40
+
41
+ template<typename ViewOp, typename MatrixType, typename StorageKind>
42
+ class CwiseUnaryViewImpl;
43
+
44
+ /** \class CwiseUnaryView
45
+ * \ingroup Core_Module
46
+ *
47
+ * \brief Generic lvalue expression of a coefficient-wise unary operator of a matrix or a vector
48
+ *
49
+ * \tparam ViewOp template functor implementing the view
50
+ * \tparam MatrixType the type of the matrix we are applying the unary operator
51
+ *
52
+ * This class represents a lvalue expression of a generic unary view operator of a matrix or a vector.
53
+ * It is the return type of real() and imag(), and most of the time this is the only way it is used.
54
+ *
55
+ * \sa MatrixBase::unaryViewExpr(const CustomUnaryOp &) const, class CwiseUnaryOp
56
+ */
57
+ template<typename ViewOp, typename MatrixType>
58
+ class CwiseUnaryView : public CwiseUnaryViewImpl<ViewOp, MatrixType, typename internal::traits<MatrixType>::StorageKind>
59
+ {
60
+ public:
61
+
62
+ typedef typename CwiseUnaryViewImpl<ViewOp, MatrixType,typename internal::traits<MatrixType>::StorageKind>::Base Base;
63
+ EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseUnaryView)
64
+ typedef typename internal::ref_selector<MatrixType>::non_const_type MatrixTypeNested;
65
+ typedef typename internal::remove_all<MatrixType>::type NestedExpression;
66
+
67
+ explicit inline CwiseUnaryView(MatrixType& mat, const ViewOp& func = ViewOp())
68
+ : m_matrix(mat), m_functor(func) {}
69
+
70
+ EIGEN_INHERIT_ASSIGNMENT_OPERATORS(CwiseUnaryView)
71
+
72
+ EIGEN_STRONG_INLINE Index rows() const { return m_matrix.rows(); }
73
+ EIGEN_STRONG_INLINE Index cols() const { return m_matrix.cols(); }
74
+
75
+ /** \returns the functor representing unary operation */
76
+ const ViewOp& functor() const { return m_functor; }
77
+
78
+ /** \returns the nested expression */
79
+ const typename internal::remove_all<MatrixTypeNested>::type&
80
+ nestedExpression() const { return m_matrix; }
81
+
82
+ /** \returns the nested expression */
83
+ typename internal::remove_reference<MatrixTypeNested>::type&
84
+ nestedExpression() { return m_matrix.const_cast_derived(); }
85
+
86
+ protected:
87
+ MatrixTypeNested m_matrix;
88
+ ViewOp m_functor;
89
+ };
90
+
91
+ // Generic API dispatcher
92
+ template<typename ViewOp, typename XprType, typename StorageKind>
93
+ class CwiseUnaryViewImpl
94
+ : public internal::generic_xpr_base<CwiseUnaryView<ViewOp, XprType> >::type
95
+ {
96
+ public:
97
+ typedef typename internal::generic_xpr_base<CwiseUnaryView<ViewOp, XprType> >::type Base;
98
+ };
99
+
100
+ template<typename ViewOp, typename MatrixType>
101
+ class CwiseUnaryViewImpl<ViewOp,MatrixType,Dense>
102
+ : public internal::dense_xpr_base< CwiseUnaryView<ViewOp, MatrixType> >::type
103
+ {
104
+ public:
105
+
106
+ typedef CwiseUnaryView<ViewOp, MatrixType> Derived;
107
+ typedef typename internal::dense_xpr_base< CwiseUnaryView<ViewOp, MatrixType> >::type Base;
108
+
109
+ EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
110
+ EIGEN_INHERIT_ASSIGNMENT_OPERATORS(CwiseUnaryViewImpl)
111
+
112
+ EIGEN_DEVICE_FUNC inline Scalar* data() { return &(this->coeffRef(0)); }
113
+ EIGEN_DEVICE_FUNC inline const Scalar* data() const { return &(this->coeff(0)); }
114
+
115
+ EIGEN_DEVICE_FUNC inline Index innerStride() const
116
+ {
117
+ return derived().nestedExpression().innerStride() * sizeof(typename internal::traits<MatrixType>::Scalar) / sizeof(Scalar);
118
+ }
119
+
120
+ EIGEN_DEVICE_FUNC inline Index outerStride() const
121
+ {
122
+ return derived().nestedExpression().outerStride() * sizeof(typename internal::traits<MatrixType>::Scalar) / sizeof(Scalar);
123
+ }
124
+ };
125
+
126
+ } // end namespace Eigen
127
+
128
+ #endif // EIGEN_CWISE_UNARY_VIEW_H
@@ -0,0 +1,611 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2007-2010 Benoit Jacob <jacob.benoit.1@gmail.com>
5
+ // Copyright (C) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
6
+ //
7
+ // This Source Code Form is subject to the terms of the Mozilla
8
+ // Public License v. 2.0. If a copy of the MPL was not distributed
9
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
+
11
+ #ifndef EIGEN_DENSEBASE_H
12
+ #define EIGEN_DENSEBASE_H
13
+
14
+ namespace Eigen {
15
+
16
+ namespace internal {
17
+
18
+ // The index type defined by EIGEN_DEFAULT_DENSE_INDEX_TYPE must be a signed type.
19
+ // This dummy function simply aims at checking that at compile time.
20
+ static inline void check_DenseIndex_is_signed() {
21
+ EIGEN_STATIC_ASSERT(NumTraits<DenseIndex>::IsSigned,THE_INDEX_TYPE_MUST_BE_A_SIGNED_TYPE);
22
+ }
23
+
24
+ } // end namespace internal
25
+
26
+ /** \class DenseBase
27
+ * \ingroup Core_Module
28
+ *
29
+ * \brief Base class for all dense matrices, vectors, and arrays
30
+ *
31
+ * This class is the base that is inherited by all dense objects (matrix, vector, arrays,
32
+ * and related expression types). The common Eigen API for dense objects is contained in this class.
33
+ *
34
+ * \tparam Derived is the derived type, e.g., a matrix type or an expression.
35
+ *
36
+ * This class can be extended with the help of the plugin mechanism described on the page
37
+ * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_DENSEBASE_PLUGIN.
38
+ *
39
+ * \sa \blank \ref TopicClassHierarchy
40
+ */
41
+ template<typename Derived> class DenseBase
42
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
43
+ : public DenseCoeffsBase<Derived>
44
+ #else
45
+ : public DenseCoeffsBase<Derived,DirectWriteAccessors>
46
+ #endif // not EIGEN_PARSED_BY_DOXYGEN
47
+ {
48
+ public:
49
+
50
+ /** Inner iterator type to iterate over the coefficients of a row or column.
51
+ * \sa class InnerIterator
52
+ */
53
+ typedef Eigen::InnerIterator<Derived> InnerIterator;
54
+
55
+ typedef typename internal::traits<Derived>::StorageKind StorageKind;
56
+
57
+ /**
58
+ * \brief The type used to store indices
59
+ * \details This typedef is relevant for types that store multiple indices such as
60
+ * PermutationMatrix or Transpositions, otherwise it defaults to Eigen::Index
61
+ * \sa \blank \ref TopicPreprocessorDirectives, Eigen::Index, SparseMatrixBase.
62
+ */
63
+ typedef typename internal::traits<Derived>::StorageIndex StorageIndex;
64
+
65
+ /** The numeric type of the expression' coefficients, e.g. float, double, int or std::complex<float>, etc. */
66
+ typedef typename internal::traits<Derived>::Scalar Scalar;
67
+
68
+ /** The numeric type of the expression' coefficients, e.g. float, double, int or std::complex<float>, etc.
69
+ *
70
+ * It is an alias for the Scalar type */
71
+ typedef Scalar value_type;
72
+
73
+ typedef typename NumTraits<Scalar>::Real RealScalar;
74
+ typedef DenseCoeffsBase<Derived> Base;
75
+
76
+ using Base::derived;
77
+ using Base::const_cast_derived;
78
+ using Base::rows;
79
+ using Base::cols;
80
+ using Base::size;
81
+ using Base::rowIndexByOuterInner;
82
+ using Base::colIndexByOuterInner;
83
+ using Base::coeff;
84
+ using Base::coeffByOuterInner;
85
+ using Base::operator();
86
+ using Base::operator[];
87
+ using Base::x;
88
+ using Base::y;
89
+ using Base::z;
90
+ using Base::w;
91
+ using Base::stride;
92
+ using Base::innerStride;
93
+ using Base::outerStride;
94
+ using Base::rowStride;
95
+ using Base::colStride;
96
+ typedef typename Base::CoeffReturnType CoeffReturnType;
97
+
98
+ enum {
99
+
100
+ RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
101
+ /**< The number of rows at compile-time. This is just a copy of the value provided
102
+ * by the \a Derived type. If a value is not known at compile-time,
103
+ * it is set to the \a Dynamic constant.
104
+ * \sa MatrixBase::rows(), MatrixBase::cols(), ColsAtCompileTime, SizeAtCompileTime */
105
+
106
+ ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
107
+ /**< The number of columns at compile-time. This is just a copy of the value provided
108
+ * by the \a Derived type. If a value is not known at compile-time,
109
+ * it is set to the \a Dynamic constant.
110
+ * \sa MatrixBase::rows(), MatrixBase::cols(), RowsAtCompileTime, SizeAtCompileTime */
111
+
112
+
113
+ SizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::RowsAtCompileTime,
114
+ internal::traits<Derived>::ColsAtCompileTime>::ret),
115
+ /**< This is equal to the number of coefficients, i.e. the number of
116
+ * rows times the number of columns, or to \a Dynamic if this is not
117
+ * known at compile-time. \sa RowsAtCompileTime, ColsAtCompileTime */
118
+
119
+ MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
120
+ /**< This value is equal to the maximum possible number of rows that this expression
121
+ * might have. If this expression might have an arbitrarily high number of rows,
122
+ * this value is set to \a Dynamic.
123
+ *
124
+ * This value is useful to know when evaluating an expression, in order to determine
125
+ * whether it is possible to avoid doing a dynamic memory allocation.
126
+ *
127
+ * \sa RowsAtCompileTime, MaxColsAtCompileTime, MaxSizeAtCompileTime
128
+ */
129
+
130
+ MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
131
+ /**< This value is equal to the maximum possible number of columns that this expression
132
+ * might have. If this expression might have an arbitrarily high number of columns,
133
+ * this value is set to \a Dynamic.
134
+ *
135
+ * This value is useful to know when evaluating an expression, in order to determine
136
+ * whether it is possible to avoid doing a dynamic memory allocation.
137
+ *
138
+ * \sa ColsAtCompileTime, MaxRowsAtCompileTime, MaxSizeAtCompileTime
139
+ */
140
+
141
+ MaxSizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::MaxRowsAtCompileTime,
142
+ internal::traits<Derived>::MaxColsAtCompileTime>::ret),
143
+ /**< This value is equal to the maximum possible number of coefficients that this expression
144
+ * might have. If this expression might have an arbitrarily high number of coefficients,
145
+ * this value is set to \a Dynamic.
146
+ *
147
+ * This value is useful to know when evaluating an expression, in order to determine
148
+ * whether it is possible to avoid doing a dynamic memory allocation.
149
+ *
150
+ * \sa SizeAtCompileTime, MaxRowsAtCompileTime, MaxColsAtCompileTime
151
+ */
152
+
153
+ IsVectorAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime == 1
154
+ || internal::traits<Derived>::MaxColsAtCompileTime == 1,
155
+ /**< This is set to true if either the number of rows or the number of
156
+ * columns is known at compile-time to be equal to 1. Indeed, in that case,
157
+ * we are dealing with a column-vector (if there is only one column) or with
158
+ * a row-vector (if there is only one row). */
159
+
160
+ Flags = internal::traits<Derived>::Flags,
161
+ /**< This stores expression \ref flags flags which may or may not be inherited by new expressions
162
+ * constructed from this one. See the \ref flags "list of flags".
163
+ */
164
+
165
+ IsRowMajor = int(Flags) & RowMajorBit, /**< True if this expression has row-major storage order. */
166
+
167
+ InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? int(SizeAtCompileTime)
168
+ : int(IsRowMajor) ? int(ColsAtCompileTime) : int(RowsAtCompileTime),
169
+
170
+ InnerStrideAtCompileTime = internal::inner_stride_at_compile_time<Derived>::ret,
171
+ OuterStrideAtCompileTime = internal::outer_stride_at_compile_time<Derived>::ret
172
+ };
173
+
174
+ typedef typename internal::find_best_packet<Scalar,SizeAtCompileTime>::type PacketScalar;
175
+
176
+ enum { IsPlainObjectBase = 0 };
177
+
178
+ /** The plain matrix type corresponding to this expression.
179
+ * \sa PlainObject */
180
+ typedef Matrix<typename internal::traits<Derived>::Scalar,
181
+ internal::traits<Derived>::RowsAtCompileTime,
182
+ internal::traits<Derived>::ColsAtCompileTime,
183
+ AutoAlign | (internal::traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor),
184
+ internal::traits<Derived>::MaxRowsAtCompileTime,
185
+ internal::traits<Derived>::MaxColsAtCompileTime
186
+ > PlainMatrix;
187
+
188
+ /** The plain array type corresponding to this expression.
189
+ * \sa PlainObject */
190
+ typedef Array<typename internal::traits<Derived>::Scalar,
191
+ internal::traits<Derived>::RowsAtCompileTime,
192
+ internal::traits<Derived>::ColsAtCompileTime,
193
+ AutoAlign | (internal::traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor),
194
+ internal::traits<Derived>::MaxRowsAtCompileTime,
195
+ internal::traits<Derived>::MaxColsAtCompileTime
196
+ > PlainArray;
197
+
198
+ /** \brief The plain matrix or array type corresponding to this expression.
199
+ *
200
+ * This is not necessarily exactly the return type of eval(). In the case of plain matrices,
201
+ * the return type of eval() is a const reference to a matrix, not a matrix! It is however guaranteed
202
+ * that the return type of eval() is either PlainObject or const PlainObject&.
203
+ */
204
+ typedef typename internal::conditional<internal::is_same<typename internal::traits<Derived>::XprKind,MatrixXpr >::value,
205
+ PlainMatrix, PlainArray>::type PlainObject;
206
+
207
+ /** \returns the number of nonzero coefficients which is in practice the number
208
+ * of stored coefficients. */
209
+ EIGEN_DEVICE_FUNC
210
+ inline Index nonZeros() const { return size(); }
211
+
212
+ /** \returns the outer size.
213
+ *
214
+ * \note For a vector, this returns just 1. For a matrix (non-vector), this is the major dimension
215
+ * with respect to the \ref TopicStorageOrders "storage order", i.e., the number of columns for a
216
+ * column-major matrix, and the number of rows for a row-major matrix. */
217
+ EIGEN_DEVICE_FUNC
218
+ Index outerSize() const
219
+ {
220
+ return IsVectorAtCompileTime ? 1
221
+ : int(IsRowMajor) ? this->rows() : this->cols();
222
+ }
223
+
224
+ /** \returns the inner size.
225
+ *
226
+ * \note For a vector, this is just the size. For a matrix (non-vector), this is the minor dimension
227
+ * with respect to the \ref TopicStorageOrders "storage order", i.e., the number of rows for a
228
+ * column-major matrix, and the number of columns for a row-major matrix. */
229
+ EIGEN_DEVICE_FUNC
230
+ Index innerSize() const
231
+ {
232
+ return IsVectorAtCompileTime ? this->size()
233
+ : int(IsRowMajor) ? this->cols() : this->rows();
234
+ }
235
+
236
+ /** Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods are
237
+ * Matrix::resize() and Array::resize(). The present method only asserts that the new size equals the old size, and does
238
+ * nothing else.
239
+ */
240
+ EIGEN_DEVICE_FUNC
241
+ void resize(Index newSize)
242
+ {
243
+ EIGEN_ONLY_USED_FOR_DEBUG(newSize);
244
+ eigen_assert(newSize == this->size()
245
+ && "DenseBase::resize() does not actually allow to resize.");
246
+ }
247
+ /** Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods are
248
+ * Matrix::resize() and Array::resize(). The present method only asserts that the new size equals the old size, and does
249
+ * nothing else.
250
+ */
251
+ EIGEN_DEVICE_FUNC
252
+ void resize(Index rows, Index cols)
253
+ {
254
+ EIGEN_ONLY_USED_FOR_DEBUG(rows);
255
+ EIGEN_ONLY_USED_FOR_DEBUG(cols);
256
+ eigen_assert(rows == this->rows() && cols == this->cols()
257
+ && "DenseBase::resize() does not actually allow to resize.");
258
+ }
259
+
260
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
261
+ /** \internal Represents a matrix with all coefficients equal to one another*/
262
+ typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>,PlainObject> ConstantReturnType;
263
+ /** \internal \deprecated Represents a vector with linearly spaced coefficients that allows sequential access only. */
264
+ typedef CwiseNullaryOp<internal::linspaced_op<Scalar,PacketScalar>,PlainObject> SequentialLinSpacedReturnType;
265
+ /** \internal Represents a vector with linearly spaced coefficients that allows random access. */
266
+ typedef CwiseNullaryOp<internal::linspaced_op<Scalar,PacketScalar>,PlainObject> RandomAccessLinSpacedReturnType;
267
+ /** \internal the return type of MatrixBase::eigenvalues() */
268
+ typedef Matrix<typename NumTraits<typename internal::traits<Derived>::Scalar>::Real, internal::traits<Derived>::ColsAtCompileTime, 1> EigenvaluesReturnType;
269
+
270
+ #endif // not EIGEN_PARSED_BY_DOXYGEN
271
+
272
+ /** Copies \a other into *this. \returns a reference to *this. */
273
+ template<typename OtherDerived>
274
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
275
+ Derived& operator=(const DenseBase<OtherDerived>& other);
276
+
277
+ /** Special case of the template operator=, in order to prevent the compiler
278
+ * from generating a default operator= (issue hit with g++ 4.1)
279
+ */
280
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
281
+ Derived& operator=(const DenseBase& other);
282
+
283
+ template<typename OtherDerived>
284
+ EIGEN_DEVICE_FUNC
285
+ Derived& operator=(const EigenBase<OtherDerived> &other);
286
+
287
+ template<typename OtherDerived>
288
+ EIGEN_DEVICE_FUNC
289
+ Derived& operator+=(const EigenBase<OtherDerived> &other);
290
+
291
+ template<typename OtherDerived>
292
+ EIGEN_DEVICE_FUNC
293
+ Derived& operator-=(const EigenBase<OtherDerived> &other);
294
+
295
+ template<typename OtherDerived>
296
+ EIGEN_DEVICE_FUNC
297
+ Derived& operator=(const ReturnByValue<OtherDerived>& func);
298
+
299
+ /** \internal
300
+ * Copies \a other into *this without evaluating other. \returns a reference to *this.
301
+ * \deprecated */
302
+ template<typename OtherDerived>
303
+ EIGEN_DEVICE_FUNC
304
+ Derived& lazyAssign(const DenseBase<OtherDerived>& other);
305
+
306
+ EIGEN_DEVICE_FUNC
307
+ CommaInitializer<Derived> operator<< (const Scalar& s);
308
+
309
+ /** \deprecated it now returns \c *this */
310
+ template<unsigned int Added,unsigned int Removed>
311
+ EIGEN_DEPRECATED
312
+ const Derived& flagged() const
313
+ { return derived(); }
314
+
315
+ template<typename OtherDerived>
316
+ EIGEN_DEVICE_FUNC
317
+ CommaInitializer<Derived> operator<< (const DenseBase<OtherDerived>& other);
318
+
319
+ typedef Transpose<Derived> TransposeReturnType;
320
+ EIGEN_DEVICE_FUNC
321
+ TransposeReturnType transpose();
322
+ typedef typename internal::add_const<Transpose<const Derived> >::type ConstTransposeReturnType;
323
+ EIGEN_DEVICE_FUNC
324
+ ConstTransposeReturnType transpose() const;
325
+ EIGEN_DEVICE_FUNC
326
+ void transposeInPlace();
327
+
328
+ EIGEN_DEVICE_FUNC static const ConstantReturnType
329
+ Constant(Index rows, Index cols, const Scalar& value);
330
+ EIGEN_DEVICE_FUNC static const ConstantReturnType
331
+ Constant(Index size, const Scalar& value);
332
+ EIGEN_DEVICE_FUNC static const ConstantReturnType
333
+ Constant(const Scalar& value);
334
+
335
+ EIGEN_DEVICE_FUNC static const SequentialLinSpacedReturnType
336
+ LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high);
337
+ EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
338
+ LinSpaced(Index size, const Scalar& low, const Scalar& high);
339
+ EIGEN_DEVICE_FUNC static const SequentialLinSpacedReturnType
340
+ LinSpaced(Sequential_t, const Scalar& low, const Scalar& high);
341
+ EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
342
+ LinSpaced(const Scalar& low, const Scalar& high);
343
+
344
+ template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
345
+ static const CwiseNullaryOp<CustomNullaryOp, PlainObject>
346
+ NullaryExpr(Index rows, Index cols, const CustomNullaryOp& func);
347
+ template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
348
+ static const CwiseNullaryOp<CustomNullaryOp, PlainObject>
349
+ NullaryExpr(Index size, const CustomNullaryOp& func);
350
+ template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
351
+ static const CwiseNullaryOp<CustomNullaryOp, PlainObject>
352
+ NullaryExpr(const CustomNullaryOp& func);
353
+
354
+ EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index rows, Index cols);
355
+ EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index size);
356
+ EIGEN_DEVICE_FUNC static const ConstantReturnType Zero();
357
+ EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index rows, Index cols);
358
+ EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index size);
359
+ EIGEN_DEVICE_FUNC static const ConstantReturnType Ones();
360
+
361
+ EIGEN_DEVICE_FUNC void fill(const Scalar& value);
362
+ EIGEN_DEVICE_FUNC Derived& setConstant(const Scalar& value);
363
+ EIGEN_DEVICE_FUNC Derived& setLinSpaced(Index size, const Scalar& low, const Scalar& high);
364
+ EIGEN_DEVICE_FUNC Derived& setLinSpaced(const Scalar& low, const Scalar& high);
365
+ EIGEN_DEVICE_FUNC Derived& setZero();
366
+ EIGEN_DEVICE_FUNC Derived& setOnes();
367
+ EIGEN_DEVICE_FUNC Derived& setRandom();
368
+
369
+ template<typename OtherDerived> EIGEN_DEVICE_FUNC
370
+ bool isApprox(const DenseBase<OtherDerived>& other,
371
+ const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
372
+ EIGEN_DEVICE_FUNC
373
+ bool isMuchSmallerThan(const RealScalar& other,
374
+ const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
375
+ template<typename OtherDerived> EIGEN_DEVICE_FUNC
376
+ bool isMuchSmallerThan(const DenseBase<OtherDerived>& other,
377
+ const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
378
+
379
+ EIGEN_DEVICE_FUNC bool isApproxToConstant(const Scalar& value, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
380
+ EIGEN_DEVICE_FUNC bool isConstant(const Scalar& value, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
381
+ EIGEN_DEVICE_FUNC bool isZero(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
382
+ EIGEN_DEVICE_FUNC bool isOnes(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
383
+
384
+ inline bool hasNaN() const;
385
+ inline bool allFinite() const;
386
+
387
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
388
+ Derived& operator*=(const Scalar& other);
389
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
390
+ Derived& operator/=(const Scalar& other);
391
+
392
+ typedef typename internal::add_const_on_value_type<typename internal::eval<Derived>::type>::type EvalReturnType;
393
+ /** \returns the matrix or vector obtained by evaluating this expression.
394
+ *
395
+ * Notice that in the case of a plain matrix or vector (not an expression) this function just returns
396
+ * a const reference, in order to avoid a useless copy.
397
+ *
398
+ * \warning Be carefull with eval() and the auto C++ keyword, as detailed in this \link TopicPitfalls_auto_keyword page \endlink.
399
+ */
400
+ EIGEN_DEVICE_FUNC
401
+ EIGEN_STRONG_INLINE EvalReturnType eval() const
402
+ {
403
+ // Even though MSVC does not honor strong inlining when the return type
404
+ // is a dynamic matrix, we desperately need strong inlining for fixed
405
+ // size types on MSVC.
406
+ return typename internal::eval<Derived>::type(derived());
407
+ }
408
+
409
+ /** swaps *this with the expression \a other.
410
+ *
411
+ */
412
+ template<typename OtherDerived>
413
+ EIGEN_DEVICE_FUNC
414
+ void swap(const DenseBase<OtherDerived>& other)
415
+ {
416
+ EIGEN_STATIC_ASSERT(!OtherDerived::IsPlainObjectBase,THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY);
417
+ eigen_assert(rows()==other.rows() && cols()==other.cols());
418
+ call_assignment(derived(), other.const_cast_derived(), internal::swap_assign_op<Scalar>());
419
+ }
420
+
421
+ /** swaps *this with the matrix or array \a other.
422
+ *
423
+ */
424
+ template<typename OtherDerived>
425
+ EIGEN_DEVICE_FUNC
426
+ void swap(PlainObjectBase<OtherDerived>& other)
427
+ {
428
+ eigen_assert(rows()==other.rows() && cols()==other.cols());
429
+ call_assignment(derived(), other.derived(), internal::swap_assign_op<Scalar>());
430
+ }
431
+
432
+ EIGEN_DEVICE_FUNC inline const NestByValue<Derived> nestByValue() const;
433
+ EIGEN_DEVICE_FUNC inline const ForceAlignedAccess<Derived> forceAlignedAccess() const;
434
+ EIGEN_DEVICE_FUNC inline ForceAlignedAccess<Derived> forceAlignedAccess();
435
+ template<bool Enable> EIGEN_DEVICE_FUNC
436
+ inline const typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf() const;
437
+ template<bool Enable> EIGEN_DEVICE_FUNC
438
+ inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf();
439
+
440
+ EIGEN_DEVICE_FUNC Scalar sum() const;
441
+ EIGEN_DEVICE_FUNC Scalar mean() const;
442
+ EIGEN_DEVICE_FUNC Scalar trace() const;
443
+
444
+ EIGEN_DEVICE_FUNC Scalar prod() const;
445
+
446
+ EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar minCoeff() const;
447
+ EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar maxCoeff() const;
448
+
449
+ template<typename IndexType> EIGEN_DEVICE_FUNC
450
+ typename internal::traits<Derived>::Scalar minCoeff(IndexType* row, IndexType* col) const;
451
+ template<typename IndexType> EIGEN_DEVICE_FUNC
452
+ typename internal::traits<Derived>::Scalar maxCoeff(IndexType* row, IndexType* col) const;
453
+ template<typename IndexType> EIGEN_DEVICE_FUNC
454
+ typename internal::traits<Derived>::Scalar minCoeff(IndexType* index) const;
455
+ template<typename IndexType> EIGEN_DEVICE_FUNC
456
+ typename internal::traits<Derived>::Scalar maxCoeff(IndexType* index) const;
457
+
458
+ template<typename BinaryOp>
459
+ EIGEN_DEVICE_FUNC
460
+ Scalar redux(const BinaryOp& func) const;
461
+
462
+ template<typename Visitor>
463
+ EIGEN_DEVICE_FUNC
464
+ void visit(Visitor& func) const;
465
+
466
+ /** \returns a WithFormat proxy object allowing to print a matrix the with given
467
+ * format \a fmt.
468
+ *
469
+ * See class IOFormat for some examples.
470
+ *
471
+ * \sa class IOFormat, class WithFormat
472
+ */
473
+ inline const WithFormat<Derived> format(const IOFormat& fmt) const
474
+ {
475
+ return WithFormat<Derived>(derived(), fmt);
476
+ }
477
+
478
+ /** \returns the unique coefficient of a 1x1 expression */
479
+ EIGEN_DEVICE_FUNC
480
+ CoeffReturnType value() const
481
+ {
482
+ EIGEN_STATIC_ASSERT_SIZE_1x1(Derived)
483
+ eigen_assert(this->rows() == 1 && this->cols() == 1);
484
+ return derived().coeff(0,0);
485
+ }
486
+
487
+ EIGEN_DEVICE_FUNC bool all() const;
488
+ EIGEN_DEVICE_FUNC bool any() const;
489
+ EIGEN_DEVICE_FUNC Index count() const;
490
+
491
+ typedef VectorwiseOp<Derived, Horizontal> RowwiseReturnType;
492
+ typedef const VectorwiseOp<const Derived, Horizontal> ConstRowwiseReturnType;
493
+ typedef VectorwiseOp<Derived, Vertical> ColwiseReturnType;
494
+ typedef const VectorwiseOp<const Derived, Vertical> ConstColwiseReturnType;
495
+
496
+ /** \returns a VectorwiseOp wrapper of *this providing additional partial reduction operations
497
+ *
498
+ * Example: \include MatrixBase_rowwise.cpp
499
+ * Output: \verbinclude MatrixBase_rowwise.out
500
+ *
501
+ * \sa colwise(), class VectorwiseOp, \ref TutorialReductionsVisitorsBroadcasting
502
+ */
503
+ //Code moved here due to a CUDA compiler bug
504
+ EIGEN_DEVICE_FUNC inline ConstRowwiseReturnType rowwise() const {
505
+ return ConstRowwiseReturnType(derived());
506
+ }
507
+ EIGEN_DEVICE_FUNC RowwiseReturnType rowwise();
508
+
509
+ /** \returns a VectorwiseOp wrapper of *this providing additional partial reduction operations
510
+ *
511
+ * Example: \include MatrixBase_colwise.cpp
512
+ * Output: \verbinclude MatrixBase_colwise.out
513
+ *
514
+ * \sa rowwise(), class VectorwiseOp, \ref TutorialReductionsVisitorsBroadcasting
515
+ */
516
+ EIGEN_DEVICE_FUNC inline ConstColwiseReturnType colwise() const {
517
+ return ConstColwiseReturnType(derived());
518
+ }
519
+ EIGEN_DEVICE_FUNC ColwiseReturnType colwise();
520
+
521
+ typedef CwiseNullaryOp<internal::scalar_random_op<Scalar>,PlainObject> RandomReturnType;
522
+ static const RandomReturnType Random(Index rows, Index cols);
523
+ static const RandomReturnType Random(Index size);
524
+ static const RandomReturnType Random();
525
+
526
+ template<typename ThenDerived,typename ElseDerived>
527
+ const Select<Derived,ThenDerived,ElseDerived>
528
+ select(const DenseBase<ThenDerived>& thenMatrix,
529
+ const DenseBase<ElseDerived>& elseMatrix) const;
530
+
531
+ template<typename ThenDerived>
532
+ inline const Select<Derived,ThenDerived, typename ThenDerived::ConstantReturnType>
533
+ select(const DenseBase<ThenDerived>& thenMatrix, const typename ThenDerived::Scalar& elseScalar) const;
534
+
535
+ template<typename ElseDerived>
536
+ inline const Select<Derived, typename ElseDerived::ConstantReturnType, ElseDerived >
537
+ select(const typename ElseDerived::Scalar& thenScalar, const DenseBase<ElseDerived>& elseMatrix) const;
538
+
539
+ template<int p> RealScalar lpNorm() const;
540
+
541
+ template<int RowFactor, int ColFactor>
542
+ EIGEN_DEVICE_FUNC
543
+ const Replicate<Derived,RowFactor,ColFactor> replicate() const;
544
+ /**
545
+ * \return an expression of the replication of \c *this
546
+ *
547
+ * Example: \include MatrixBase_replicate_int_int.cpp
548
+ * Output: \verbinclude MatrixBase_replicate_int_int.out
549
+ *
550
+ * \sa VectorwiseOp::replicate(), DenseBase::replicate<int,int>(), class Replicate
551
+ */
552
+ //Code moved here due to a CUDA compiler bug
553
+ EIGEN_DEVICE_FUNC
554
+ const Replicate<Derived, Dynamic, Dynamic> replicate(Index rowFactor, Index colFactor) const
555
+ {
556
+ return Replicate<Derived, Dynamic, Dynamic>(derived(), rowFactor, colFactor);
557
+ }
558
+
559
+ typedef Reverse<Derived, BothDirections> ReverseReturnType;
560
+ typedef const Reverse<const Derived, BothDirections> ConstReverseReturnType;
561
+ EIGEN_DEVICE_FUNC ReverseReturnType reverse();
562
+ /** This is the const version of reverse(). */
563
+ //Code moved here due to a CUDA compiler bug
564
+ EIGEN_DEVICE_FUNC ConstReverseReturnType reverse() const
565
+ {
566
+ return ConstReverseReturnType(derived());
567
+ }
568
+ EIGEN_DEVICE_FUNC void reverseInPlace();
569
+
570
+ #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase
571
+ #define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
572
+ #define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND)
573
+ # include "../plugins/BlockMethods.h"
574
+ # ifdef EIGEN_DENSEBASE_PLUGIN
575
+ # include EIGEN_DENSEBASE_PLUGIN
576
+ # endif
577
+ #undef EIGEN_CURRENT_STORAGE_BASE_CLASS
578
+ #undef EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
579
+ #undef EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF
580
+
581
+ // disable the use of evalTo for dense objects with a nice compilation error
582
+ template<typename Dest>
583
+ EIGEN_DEVICE_FUNC
584
+ inline void evalTo(Dest& ) const
585
+ {
586
+ EIGEN_STATIC_ASSERT((internal::is_same<Dest,void>::value),THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS);
587
+ }
588
+
589
+ protected:
590
+ /** Default constructor. Do nothing. */
591
+ EIGEN_DEVICE_FUNC DenseBase()
592
+ {
593
+ /* Just checks for self-consistency of the flags.
594
+ * Only do it when debugging Eigen, as this borders on paranoiac and could slow compilation down
595
+ */
596
+ #ifdef EIGEN_INTERNAL_DEBUGGING
597
+ EIGEN_STATIC_ASSERT((EIGEN_IMPLIES(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1, int(IsRowMajor))
598
+ && EIGEN_IMPLIES(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1, int(!IsRowMajor))),
599
+ INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION)
600
+ #endif
601
+ }
602
+
603
+ private:
604
+ EIGEN_DEVICE_FUNC explicit DenseBase(int);
605
+ EIGEN_DEVICE_FUNC DenseBase(int,int);
606
+ template<typename OtherDerived> EIGEN_DEVICE_FUNC explicit DenseBase(const DenseBase<OtherDerived>&);
607
+ };
608
+
609
+ } // end namespace Eigen
610
+
611
+ #endif // EIGEN_DENSEBASE_H