forgeo-gmlib 0.6.2__cp313-cp313-musllinux_1_2_x86_64.whl

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 (554) hide show
  1. forgeo/gmlib/GeologicalModel3D.py +758 -0
  2. forgeo/gmlib/__init__.py +9 -0
  3. forgeo/gmlib/_version.py +34 -0
  4. forgeo/gmlib/architecture/__init__.py +1 -0
  5. forgeo/gmlib/architecture/core.py +130 -0
  6. forgeo/gmlib/common.abi3.so +0 -0
  7. forgeo/gmlib/fault_network.py +171 -0
  8. forgeo/gmlib/geomodeller_data.py +101 -0
  9. forgeo/gmlib/geomodeller_project.py +396 -0
  10. forgeo/gmlib/myxmltools.py +30 -0
  11. forgeo/gmlib/pypotential2D.abi3.so +0 -0
  12. forgeo/gmlib/pypotential3D.abi3.so +0 -0
  13. forgeo/gmlib/tesselate.py +236 -0
  14. forgeo/gmlib/tesselate_deprecated.py +249 -0
  15. forgeo/gmlib/topography_reader.py +198 -0
  16. forgeo/gmlib/utils/__init__.py +0 -0
  17. forgeo/gmlib/utils/append_data.py +508 -0
  18. forgeo/gmlib/utils/export.py +45 -0
  19. forgeo/gmlib/utils/normalized_gradient.py +40 -0
  20. forgeo/gmlib/utils/tools.py +35 -0
  21. forgeo_gmlib-0.6.2.dist-info/METADATA +23 -0
  22. forgeo_gmlib-0.6.2.dist-info/RECORD +554 -0
  23. forgeo_gmlib-0.6.2.dist-info/WHEEL +5 -0
  24. forgeo_gmlib-0.6.2.dist-info/licenses/LICENSE +661 -0
  25. include/eigen3/Eigen/Cholesky +45 -0
  26. include/eigen3/Eigen/CholmodSupport +48 -0
  27. include/eigen3/Eigen/Core +385 -0
  28. include/eigen3/Eigen/Dense +7 -0
  29. include/eigen3/Eigen/Eigen +2 -0
  30. include/eigen3/Eigen/Eigenvalues +60 -0
  31. include/eigen3/Eigen/Geometry +59 -0
  32. include/eigen3/Eigen/Householder +29 -0
  33. include/eigen3/Eigen/IterativeLinearSolvers +48 -0
  34. include/eigen3/Eigen/Jacobi +32 -0
  35. include/eigen3/Eigen/KLUSupport +41 -0
  36. include/eigen3/Eigen/LU +47 -0
  37. include/eigen3/Eigen/MetisSupport +35 -0
  38. include/eigen3/Eigen/OrderingMethods +70 -0
  39. include/eigen3/Eigen/PaStiXSupport +49 -0
  40. include/eigen3/Eigen/PardisoSupport +35 -0
  41. include/eigen3/Eigen/QR +50 -0
  42. include/eigen3/Eigen/QtAlignedMalloc +39 -0
  43. include/eigen3/Eigen/SPQRSupport +34 -0
  44. include/eigen3/Eigen/SVD +50 -0
  45. include/eigen3/Eigen/Sparse +34 -0
  46. include/eigen3/Eigen/SparseCholesky +37 -0
  47. include/eigen3/Eigen/SparseCore +69 -0
  48. include/eigen3/Eigen/SparseLU +48 -0
  49. include/eigen3/Eigen/SparseQR +36 -0
  50. include/eigen3/Eigen/StdDeque +27 -0
  51. include/eigen3/Eigen/StdList +26 -0
  52. include/eigen3/Eigen/StdVector +27 -0
  53. include/eigen3/Eigen/SuperLUSupport +64 -0
  54. include/eigen3/Eigen/UmfPackSupport +40 -0
  55. include/eigen3/Eigen/src/Cholesky/LDLT.h +688 -0
  56. include/eigen3/Eigen/src/Cholesky/LLT.h +558 -0
  57. include/eigen3/Eigen/src/Cholesky/LLT_LAPACKE.h +99 -0
  58. include/eigen3/Eigen/src/CholmodSupport/CholmodSupport.h +682 -0
  59. include/eigen3/Eigen/src/Core/ArithmeticSequence.h +406 -0
  60. include/eigen3/Eigen/src/Core/Array.h +425 -0
  61. include/eigen3/Eigen/src/Core/ArrayBase.h +226 -0
  62. include/eigen3/Eigen/src/Core/ArrayWrapper.h +209 -0
  63. include/eigen3/Eigen/src/Core/Assign.h +90 -0
  64. include/eigen3/Eigen/src/Core/AssignEvaluator.h +1010 -0
  65. include/eigen3/Eigen/src/Core/Assign_MKL.h +178 -0
  66. include/eigen3/Eigen/src/Core/BandMatrix.h +353 -0
  67. include/eigen3/Eigen/src/Core/Block.h +463 -0
  68. include/eigen3/Eigen/src/Core/BooleanRedux.h +164 -0
  69. include/eigen3/Eigen/src/Core/CommaInitializer.h +164 -0
  70. include/eigen3/Eigen/src/Core/ConditionEstimator.h +175 -0
  71. include/eigen3/Eigen/src/Core/CoreEvaluators.h +1741 -0
  72. include/eigen3/Eigen/src/Core/CoreIterators.h +132 -0
  73. include/eigen3/Eigen/src/Core/CwiseBinaryOp.h +183 -0
  74. include/eigen3/Eigen/src/Core/CwiseNullaryOp.h +1001 -0
  75. include/eigen3/Eigen/src/Core/CwiseTernaryOp.h +197 -0
  76. include/eigen3/Eigen/src/Core/CwiseUnaryOp.h +103 -0
  77. include/eigen3/Eigen/src/Core/CwiseUnaryView.h +132 -0
  78. include/eigen3/Eigen/src/Core/DenseBase.h +701 -0
  79. include/eigen3/Eigen/src/Core/DenseCoeffsBase.h +685 -0
  80. include/eigen3/Eigen/src/Core/DenseStorage.h +652 -0
  81. include/eigen3/Eigen/src/Core/Diagonal.h +259 -0
  82. include/eigen3/Eigen/src/Core/DiagonalMatrix.h +391 -0
  83. include/eigen3/Eigen/src/Core/DiagonalProduct.h +28 -0
  84. include/eigen3/Eigen/src/Core/Dot.h +313 -0
  85. include/eigen3/Eigen/src/Core/EigenBase.h +160 -0
  86. include/eigen3/Eigen/src/Core/ForceAlignedAccess.h +150 -0
  87. include/eigen3/Eigen/src/Core/Fuzzy.h +155 -0
  88. include/eigen3/Eigen/src/Core/GeneralProduct.h +465 -0
  89. include/eigen3/Eigen/src/Core/GenericPacketMath.h +1040 -0
  90. include/eigen3/Eigen/src/Core/GlobalFunctions.h +194 -0
  91. include/eigen3/Eigen/src/Core/IO.h +258 -0
  92. include/eigen3/Eigen/src/Core/IndexedView.h +247 -0
  93. include/eigen3/Eigen/src/Core/Inverse.h +117 -0
  94. include/eigen3/Eigen/src/Core/Map.h +171 -0
  95. include/eigen3/Eigen/src/Core/MapBase.h +310 -0
  96. include/eigen3/Eigen/src/Core/MathFunctions.h +2212 -0
  97. include/eigen3/Eigen/src/Core/MathFunctionsImpl.h +200 -0
  98. include/eigen3/Eigen/src/Core/Matrix.h +578 -0
  99. include/eigen3/Eigen/src/Core/MatrixBase.h +541 -0
  100. include/eigen3/Eigen/src/Core/NestByValue.h +85 -0
  101. include/eigen3/Eigen/src/Core/NoAlias.h +109 -0
  102. include/eigen3/Eigen/src/Core/NumTraits.h +351 -0
  103. include/eigen3/Eigen/src/Core/PartialReduxEvaluator.h +237 -0
  104. include/eigen3/Eigen/src/Core/PermutationMatrix.h +605 -0
  105. include/eigen3/Eigen/src/Core/PlainObjectBase.h +1128 -0
  106. include/eigen3/Eigen/src/Core/Product.h +191 -0
  107. include/eigen3/Eigen/src/Core/ProductEvaluators.h +1179 -0
  108. include/eigen3/Eigen/src/Core/Random.h +218 -0
  109. include/eigen3/Eigen/src/Core/Redux.h +515 -0
  110. include/eigen3/Eigen/src/Core/Ref.h +381 -0
  111. include/eigen3/Eigen/src/Core/Replicate.h +142 -0
  112. include/eigen3/Eigen/src/Core/Reshaped.h +454 -0
  113. include/eigen3/Eigen/src/Core/ReturnByValue.h +119 -0
  114. include/eigen3/Eigen/src/Core/Reverse.h +217 -0
  115. include/eigen3/Eigen/src/Core/Select.h +164 -0
  116. include/eigen3/Eigen/src/Core/SelfAdjointView.h +365 -0
  117. include/eigen3/Eigen/src/Core/SelfCwiseBinaryOp.h +47 -0
  118. include/eigen3/Eigen/src/Core/Solve.h +188 -0
  119. include/eigen3/Eigen/src/Core/SolveTriangular.h +235 -0
  120. include/eigen3/Eigen/src/Core/SolverBase.h +168 -0
  121. include/eigen3/Eigen/src/Core/StableNorm.h +251 -0
  122. include/eigen3/Eigen/src/Core/StlIterators.h +463 -0
  123. include/eigen3/Eigen/src/Core/Stride.h +120 -0
  124. include/eigen3/Eigen/src/Core/Swap.h +68 -0
  125. include/eigen3/Eigen/src/Core/Transpose.h +464 -0
  126. include/eigen3/Eigen/src/Core/Transpositions.h +386 -0
  127. include/eigen3/Eigen/src/Core/TriangularMatrix.h +994 -0
  128. include/eigen3/Eigen/src/Core/VectorBlock.h +96 -0
  129. include/eigen3/Eigen/src/Core/VectorwiseOp.h +784 -0
  130. include/eigen3/Eigen/src/Core/Visitor.h +381 -0
  131. include/eigen3/Eigen/src/Core/arch/AVX/Complex.h +368 -0
  132. include/eigen3/Eigen/src/Core/arch/AVX/MathFunctions.h +228 -0
  133. include/eigen3/Eigen/src/Core/arch/AVX/PacketMath.h +1588 -0
  134. include/eigen3/Eigen/src/Core/arch/AVX/TypeCasting.h +115 -0
  135. include/eigen3/Eigen/src/Core/arch/AVX512/Complex.h +384 -0
  136. include/eigen3/Eigen/src/Core/arch/AVX512/MathFunctions.h +361 -0
  137. include/eigen3/Eigen/src/Core/arch/AVX512/PacketMath.h +2270 -0
  138. include/eigen3/Eigen/src/Core/arch/AVX512/TypeCasting.h +89 -0
  139. include/eigen3/Eigen/src/Core/arch/AltiVec/Complex.h +415 -0
  140. include/eigen3/Eigen/src/Core/arch/AltiVec/MathFunctions.h +119 -0
  141. include/eigen3/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2776 -0
  142. include/eigen3/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +159 -0
  143. include/eigen3/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +627 -0
  144. include/eigen3/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.h +2400 -0
  145. include/eigen3/Eigen/src/Core/arch/AltiVec/PacketMath.h +2743 -0
  146. include/eigen3/Eigen/src/Core/arch/CUDA/Complex.h +269 -0
  147. include/eigen3/Eigen/src/Core/arch/Default/BFloat16.h +688 -0
  148. include/eigen3/Eigen/src/Core/arch/Default/ConjHelper.h +117 -0
  149. include/eigen3/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1662 -0
  150. include/eigen3/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +116 -0
  151. include/eigen3/Eigen/src/Core/arch/Default/Half.h +950 -0
  152. include/eigen3/Eigen/src/Core/arch/Default/Settings.h +49 -0
  153. include/eigen3/Eigen/src/Core/arch/Default/TypeCasting.h +120 -0
  154. include/eigen3/Eigen/src/Core/arch/GPU/MathFunctions.h +103 -0
  155. include/eigen3/Eigen/src/Core/arch/GPU/PacketMath.h +1646 -0
  156. include/eigen3/Eigen/src/Core/arch/GPU/TypeCasting.h +79 -0
  157. include/eigen3/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
  158. include/eigen3/Eigen/src/Core/arch/MSA/Complex.h +645 -0
  159. include/eigen3/Eigen/src/Core/arch/MSA/MathFunctions.h +387 -0
  160. include/eigen3/Eigen/src/Core/arch/MSA/PacketMath.h +1233 -0
  161. include/eigen3/Eigen/src/Core/arch/NEON/Complex.h +560 -0
  162. include/eigen3/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +183 -0
  163. include/eigen3/Eigen/src/Core/arch/NEON/MathFunctions.h +75 -0
  164. include/eigen3/Eigen/src/Core/arch/NEON/PacketMath.h +4653 -0
  165. include/eigen3/Eigen/src/Core/arch/NEON/TypeCasting.h +1424 -0
  166. include/eigen3/Eigen/src/Core/arch/SSE/Complex.h +338 -0
  167. include/eigen3/Eigen/src/Core/arch/SSE/MathFunctions.h +199 -0
  168. include/eigen3/Eigen/src/Core/arch/SSE/PacketMath.h +1505 -0
  169. include/eigen3/Eigen/src/Core/arch/SSE/TypeCasting.h +142 -0
  170. include/eigen3/Eigen/src/Core/arch/SVE/MathFunctions.h +44 -0
  171. include/eigen3/Eigen/src/Core/arch/SVE/PacketMath.h +752 -0
  172. include/eigen3/Eigen/src/Core/arch/SVE/TypeCasting.h +49 -0
  173. include/eigen3/Eigen/src/Core/arch/SYCL/InteropHeaders.h +232 -0
  174. include/eigen3/Eigen/src/Core/arch/SYCL/MathFunctions.h +301 -0
  175. include/eigen3/Eigen/src/Core/arch/SYCL/PacketMath.h +670 -0
  176. include/eigen3/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +694 -0
  177. include/eigen3/Eigen/src/Core/arch/SYCL/TypeCasting.h +85 -0
  178. include/eigen3/Eigen/src/Core/arch/ZVector/Complex.h +428 -0
  179. include/eigen3/Eigen/src/Core/arch/ZVector/MathFunctions.h +233 -0
  180. include/eigen3/Eigen/src/Core/arch/ZVector/PacketMath.h +1060 -0
  181. include/eigen3/Eigen/src/Core/functors/AssignmentFunctors.h +177 -0
  182. include/eigen3/Eigen/src/Core/functors/BinaryFunctors.h +541 -0
  183. include/eigen3/Eigen/src/Core/functors/NullaryFunctors.h +189 -0
  184. include/eigen3/Eigen/src/Core/functors/StlFunctors.h +166 -0
  185. include/eigen3/Eigen/src/Core/functors/TernaryFunctors.h +25 -0
  186. include/eigen3/Eigen/src/Core/functors/UnaryFunctors.h +1131 -0
  187. include/eigen3/Eigen/src/Core/products/GeneralBlockPanelKernel.h +2645 -0
  188. include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix.h +517 -0
  189. include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +322 -0
  190. include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +145 -0
  191. include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +124 -0
  192. include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h +523 -0
  193. include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +136 -0
  194. include/eigen3/Eigen/src/Core/products/Parallelizer.h +180 -0
  195. include/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +544 -0
  196. include/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +295 -0
  197. include/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector.h +262 -0
  198. include/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +118 -0
  199. include/eigen3/Eigen/src/Core/products/SelfadjointProduct.h +133 -0
  200. include/eigen3/Eigen/src/Core/products/SelfadjointRank2Update.h +94 -0
  201. include/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix.h +472 -0
  202. include/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +317 -0
  203. include/eigen3/Eigen/src/Core/products/TriangularMatrixVector.h +350 -0
  204. include/eigen3/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +255 -0
  205. include/eigen3/Eigen/src/Core/products/TriangularSolverMatrix.h +337 -0
  206. include/eigen3/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +167 -0
  207. include/eigen3/Eigen/src/Core/products/TriangularSolverVector.h +148 -0
  208. include/eigen3/Eigen/src/Core/util/BlasUtil.h +583 -0
  209. include/eigen3/Eigen/src/Core/util/ConfigureVectorization.h +521 -0
  210. include/eigen3/Eigen/src/Core/util/Constants.h +563 -0
  211. include/eigen3/Eigen/src/Core/util/DisableStupidWarnings.h +138 -0
  212. include/eigen3/Eigen/src/Core/util/ForwardDeclarations.h +322 -0
  213. include/eigen3/Eigen/src/Core/util/IndexedViewHelper.h +186 -0
  214. include/eigen3/Eigen/src/Core/util/IntegralConstant.h +272 -0
  215. include/eigen3/Eigen/src/Core/util/MKL_support.h +137 -0
  216. include/eigen3/Eigen/src/Core/util/Macros.h +1511 -0
  217. include/eigen3/Eigen/src/Core/util/Memory.h +1202 -0
  218. include/eigen3/Eigen/src/Core/util/Meta.h +812 -0
  219. include/eigen3/Eigen/src/Core/util/NonMPL2.h +3 -0
  220. include/eigen3/Eigen/src/Core/util/ReenableStupidWarnings.h +31 -0
  221. include/eigen3/Eigen/src/Core/util/ReshapedHelper.h +51 -0
  222. include/eigen3/Eigen/src/Core/util/StaticAssert.h +221 -0
  223. include/eigen3/Eigen/src/Core/util/SymbolicIndex.h +293 -0
  224. include/eigen3/Eigen/src/Core/util/XprHelper.h +856 -0
  225. include/eigen3/Eigen/src/Eigenvalues/ComplexEigenSolver.h +345 -0
  226. include/eigen3/Eigen/src/Eigenvalues/ComplexSchur.h +462 -0
  227. include/eigen3/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +91 -0
  228. include/eigen3/Eigen/src/Eigenvalues/EigenSolver.h +622 -0
  229. include/eigen3/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +417 -0
  230. include/eigen3/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +226 -0
  231. include/eigen3/Eigen/src/Eigenvalues/HessenbergDecomposition.h +374 -0
  232. include/eigen3/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +158 -0
  233. include/eigen3/Eigen/src/Eigenvalues/RealQZ.h +657 -0
  234. include/eigen3/Eigen/src/Eigenvalues/RealSchur.h +557 -0
  235. include/eigen3/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +77 -0
  236. include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +904 -0
  237. include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +87 -0
  238. include/eigen3/Eigen/src/Eigenvalues/Tridiagonalization.h +560 -0
  239. include/eigen3/Eigen/src/Geometry/AlignedBox.h +486 -0
  240. include/eigen3/Eigen/src/Geometry/AngleAxis.h +247 -0
  241. include/eigen3/Eigen/src/Geometry/EulerAngles.h +114 -0
  242. include/eigen3/Eigen/src/Geometry/Homogeneous.h +501 -0
  243. include/eigen3/Eigen/src/Geometry/Hyperplane.h +282 -0
  244. include/eigen3/Eigen/src/Geometry/OrthoMethods.h +235 -0
  245. include/eigen3/Eigen/src/Geometry/ParametrizedLine.h +232 -0
  246. include/eigen3/Eigen/src/Geometry/Quaternion.h +870 -0
  247. include/eigen3/Eigen/src/Geometry/Rotation2D.h +199 -0
  248. include/eigen3/Eigen/src/Geometry/RotationBase.h +206 -0
  249. include/eigen3/Eigen/src/Geometry/Scaling.h +188 -0
  250. include/eigen3/Eigen/src/Geometry/Transform.h +1566 -0
  251. include/eigen3/Eigen/src/Geometry/Translation.h +202 -0
  252. include/eigen3/Eigen/src/Geometry/Umeyama.h +168 -0
  253. include/eigen3/Eigen/src/Geometry/arch/Geometry_SIMD.h +168 -0
  254. include/eigen3/Eigen/src/Householder/BlockHouseholder.h +110 -0
  255. include/eigen3/Eigen/src/Householder/Householder.h +176 -0
  256. include/eigen3/Eigen/src/Householder/HouseholderSequence.h +553 -0
  257. include/eigen3/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +226 -0
  258. include/eigen3/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +212 -0
  259. include/eigen3/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +227 -0
  260. include/eigen3/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +394 -0
  261. include/eigen3/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +453 -0
  262. include/eigen3/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +444 -0
  263. include/eigen3/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +198 -0
  264. include/eigen3/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +117 -0
  265. include/eigen3/Eigen/src/Jacobi/Jacobi.h +483 -0
  266. include/eigen3/Eigen/src/KLUSupport/KLUSupport.h +358 -0
  267. include/eigen3/Eigen/src/LU/Determinant.h +117 -0
  268. include/eigen3/Eigen/src/LU/FullPivLU.h +877 -0
  269. include/eigen3/Eigen/src/LU/InverseImpl.h +432 -0
  270. include/eigen3/Eigen/src/LU/PartialPivLU.h +624 -0
  271. include/eigen3/Eigen/src/LU/PartialPivLU_LAPACKE.h +83 -0
  272. include/eigen3/Eigen/src/LU/arch/InverseSize4.h +363 -0
  273. include/eigen3/Eigen/src/MetisSupport/MetisSupport.h +137 -0
  274. include/eigen3/Eigen/src/OrderingMethods/Amd.h +435 -0
  275. include/eigen3/Eigen/src/OrderingMethods/Eigen_Colamd.h +1863 -0
  276. include/eigen3/Eigen/src/OrderingMethods/Ordering.h +153 -0
  277. include/eigen3/Eigen/src/PaStiXSupport/PaStiXSupport.h +678 -0
  278. include/eigen3/Eigen/src/PardisoSupport/PardisoSupport.h +545 -0
  279. include/eigen3/Eigen/src/QR/ColPivHouseholderQR.h +674 -0
  280. include/eigen3/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +97 -0
  281. include/eigen3/Eigen/src/QR/CompleteOrthogonalDecomposition.h +635 -0
  282. include/eigen3/Eigen/src/QR/FullPivHouseholderQR.h +713 -0
  283. include/eigen3/Eigen/src/QR/HouseholderQR.h +434 -0
  284. include/eigen3/Eigen/src/QR/HouseholderQR_LAPACKE.h +68 -0
  285. include/eigen3/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +335 -0
  286. include/eigen3/Eigen/src/SVD/BDCSVD.h +1377 -0
  287. include/eigen3/Eigen/src/SVD/JacobiSVD.h +813 -0
  288. include/eigen3/Eigen/src/SVD/JacobiSVD_LAPACKE.h +91 -0
  289. include/eigen3/Eigen/src/SVD/SVDBase.h +376 -0
  290. include/eigen3/Eigen/src/SVD/UpperBidiagonalization.h +415 -0
  291. include/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky.h +697 -0
  292. include/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +174 -0
  293. include/eigen3/Eigen/src/SparseCore/AmbiVector.h +378 -0
  294. include/eigen3/Eigen/src/SparseCore/CompressedStorage.h +274 -0
  295. include/eigen3/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +352 -0
  296. include/eigen3/Eigen/src/SparseCore/MappedSparseMatrix.h +67 -0
  297. include/eigen3/Eigen/src/SparseCore/SparseAssign.h +270 -0
  298. include/eigen3/Eigen/src/SparseCore/SparseBlock.h +566 -0
  299. include/eigen3/Eigen/src/SparseCore/SparseColEtree.h +206 -0
  300. include/eigen3/Eigen/src/SparseCore/SparseCompressedBase.h +370 -0
  301. include/eigen3/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +722 -0
  302. include/eigen3/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +150 -0
  303. include/eigen3/Eigen/src/SparseCore/SparseDenseProduct.h +342 -0
  304. include/eigen3/Eigen/src/SparseCore/SparseDiagonalProduct.h +138 -0
  305. include/eigen3/Eigen/src/SparseCore/SparseDot.h +98 -0
  306. include/eigen3/Eigen/src/SparseCore/SparseFuzzy.h +29 -0
  307. include/eigen3/Eigen/src/SparseCore/SparseMap.h +306 -0
  308. include/eigen3/Eigen/src/SparseCore/SparseMatrix.h +1518 -0
  309. include/eigen3/Eigen/src/SparseCore/SparseMatrixBase.h +399 -0
  310. include/eigen3/Eigen/src/SparseCore/SparsePermutation.h +178 -0
  311. include/eigen3/Eigen/src/SparseCore/SparseProduct.h +182 -0
  312. include/eigen3/Eigen/src/SparseCore/SparseRedux.h +49 -0
  313. include/eigen3/Eigen/src/SparseCore/SparseRef.h +397 -0
  314. include/eigen3/Eigen/src/SparseCore/SparseSelfAdjointView.h +659 -0
  315. include/eigen3/Eigen/src/SparseCore/SparseSolverBase.h +124 -0
  316. include/eigen3/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +198 -0
  317. include/eigen3/Eigen/src/SparseCore/SparseTranspose.h +92 -0
  318. include/eigen3/Eigen/src/SparseCore/SparseTriangularView.h +189 -0
  319. include/eigen3/Eigen/src/SparseCore/SparseUtil.h +186 -0
  320. include/eigen3/Eigen/src/SparseCore/SparseVector.h +480 -0
  321. include/eigen3/Eigen/src/SparseCore/SparseView.h +254 -0
  322. include/eigen3/Eigen/src/SparseCore/TriangularSolver.h +315 -0
  323. include/eigen3/Eigen/src/SparseLU/SparseLU.h +925 -0
  324. include/eigen3/Eigen/src/SparseLU/SparseLUImpl.h +66 -0
  325. include/eigen3/Eigen/src/SparseLU/SparseLU_Memory.h +226 -0
  326. include/eigen3/Eigen/src/SparseLU/SparseLU_Structs.h +110 -0
  327. include/eigen3/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +374 -0
  328. include/eigen3/Eigen/src/SparseLU/SparseLU_Utils.h +80 -0
  329. include/eigen3/Eigen/src/SparseLU/SparseLU_column_bmod.h +181 -0
  330. include/eigen3/Eigen/src/SparseLU/SparseLU_column_dfs.h +179 -0
  331. include/eigen3/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +107 -0
  332. include/eigen3/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +121 -0
  333. include/eigen3/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +129 -0
  334. include/eigen3/Eigen/src/SparseLU/SparseLU_panel_bmod.h +222 -0
  335. include/eigen3/Eigen/src/SparseLU/SparseLU_panel_dfs.h +258 -0
  336. include/eigen3/Eigen/src/SparseLU/SparseLU_pivotL.h +137 -0
  337. include/eigen3/Eigen/src/SparseLU/SparseLU_pruneL.h +136 -0
  338. include/eigen3/Eigen/src/SparseLU/SparseLU_relax_snode.h +83 -0
  339. include/eigen3/Eigen/src/SparseQR/SparseQR.h +758 -0
  340. include/eigen3/Eigen/src/StlSupport/StdDeque.h +116 -0
  341. include/eigen3/Eigen/src/StlSupport/StdList.h +106 -0
  342. include/eigen3/Eigen/src/StlSupport/StdVector.h +131 -0
  343. include/eigen3/Eigen/src/StlSupport/details.h +84 -0
  344. include/eigen3/Eigen/src/SuperLUSupport/SuperLUSupport.h +1025 -0
  345. include/eigen3/Eigen/src/UmfPackSupport/UmfPackSupport.h +642 -0
  346. include/eigen3/Eigen/src/misc/Image.h +82 -0
  347. include/eigen3/Eigen/src/misc/Kernel.h +79 -0
  348. include/eigen3/Eigen/src/misc/RealSvd2x2.h +55 -0
  349. include/eigen3/Eigen/src/misc/blas.h +440 -0
  350. include/eigen3/Eigen/src/misc/lapack.h +152 -0
  351. include/eigen3/Eigen/src/misc/lapacke.h +16292 -0
  352. include/eigen3/Eigen/src/misc/lapacke_mangling.h +17 -0
  353. include/eigen3/Eigen/src/plugins/ArrayCwiseBinaryOps.h +431 -0
  354. include/eigen3/Eigen/src/plugins/ArrayCwiseUnaryOps.h +696 -0
  355. include/eigen3/Eigen/src/plugins/BlockMethods.h +1442 -0
  356. include/eigen3/Eigen/src/plugins/CommonCwiseBinaryOps.h +115 -0
  357. include/eigen3/Eigen/src/plugins/CommonCwiseUnaryOps.h +177 -0
  358. include/eigen3/Eigen/src/plugins/IndexedViewMethods.h +262 -0
  359. include/eigen3/Eigen/src/plugins/MatrixCwiseBinaryOps.h +184 -0
  360. include/eigen3/Eigen/src/plugins/MatrixCwiseUnaryOps.h +95 -0
  361. include/eigen3/Eigen/src/plugins/ReshapedMethods.h +149 -0
  362. include/eigen3/signature_of_eigen3_matrix_library +1 -0
  363. include/eigen3/unsupported/Eigen/AdolcForward +159 -0
  364. include/eigen3/unsupported/Eigen/AlignedVector3 +234 -0
  365. include/eigen3/unsupported/Eigen/ArpackSupport +30 -0
  366. include/eigen3/unsupported/Eigen/AutoDiff +48 -0
  367. include/eigen3/unsupported/Eigen/BVH +95 -0
  368. include/eigen3/unsupported/Eigen/CXX11/Tensor +137 -0
  369. include/eigen3/unsupported/Eigen/CXX11/TensorSymmetry +42 -0
  370. include/eigen3/unsupported/Eigen/CXX11/ThreadPool +74 -0
  371. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/Tensor.h +554 -0
  372. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h +327 -0
  373. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h +242 -0
  374. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h +1176 -0
  375. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h +1559 -0
  376. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h +1083 -0
  377. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h +510 -0
  378. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h +373 -0
  379. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h +1019 -0
  380. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionBlocking.h +73 -0
  381. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionCuda.h +6 -0
  382. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionGpu.h +1413 -0
  383. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h +575 -0
  384. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionSycl.h +1650 -0
  385. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +1679 -0
  386. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h +455 -0
  387. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h +1126 -0
  388. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorConvolutionSycl.h +536 -0
  389. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorCostModel.h +213 -0
  390. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorCustomOp.h +342 -0
  391. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDevice.h +137 -0
  392. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceCuda.h +6 -0
  393. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceDefault.h +104 -0
  394. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceGpu.h +389 -0
  395. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h +1048 -0
  396. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +409 -0
  397. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDimensionList.h +234 -0
  398. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h +493 -0
  399. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h +229 -0
  400. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h +980 -0
  401. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h +701 -0
  402. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorExpr.h +389 -0
  403. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h +669 -0
  404. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h +377 -0
  405. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h +232 -0
  406. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorForwardDeclarations.h +191 -0
  407. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h +488 -0
  408. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h +297 -0
  409. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGlobalFunctions.h +33 -0
  410. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h +99 -0
  411. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaUndefines.h +44 -0
  412. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorIO.h +79 -0
  413. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h +602 -0
  414. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h +735 -0
  415. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorInflation.h +244 -0
  416. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorInitializer.h +82 -0
  417. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h +257 -0
  418. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorLayoutSwap.h +213 -0
  419. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h +98 -0
  420. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h +327 -0
  421. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h +311 -0
  422. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h +1098 -0
  423. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h +705 -0
  424. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h +286 -0
  425. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorRandom.h +317 -0
  426. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h +1000 -0
  427. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h +6 -0
  428. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReductionGpu.h +973 -0
  429. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReductionSycl.h +582 -0
  430. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorRef.h +454 -0
  431. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h +462 -0
  432. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h +528 -0
  433. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorScanSycl.h +513 -0
  434. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +466 -0
  435. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h +157 -0
  436. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h +341 -0
  437. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorTrace.h +299 -0
  438. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h +264 -0
  439. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorUInt128.h +249 -0
  440. include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h +628 -0
  441. include/eigen3/unsupported/Eigen/CXX11/src/TensorSymmetry/DynamicSymmetry.h +293 -0
  442. include/eigen3/unsupported/Eigen/CXX11/src/TensorSymmetry/StaticSymmetry.h +236 -0
  443. include/eigen3/unsupported/Eigen/CXX11/src/TensorSymmetry/Symmetry.h +338 -0
  444. include/eigen3/unsupported/Eigen/CXX11/src/TensorSymmetry/util/TemplateGroupTheory.h +669 -0
  445. include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/Barrier.h +67 -0
  446. include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/EventCount.h +249 -0
  447. include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h +486 -0
  448. include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/RunQueue.h +236 -0
  449. include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadCancel.h +23 -0
  450. include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadEnvironment.h +40 -0
  451. include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadLocal.h +301 -0
  452. include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadPoolInterface.h +48 -0
  453. include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadYield.h +20 -0
  454. include/eigen3/unsupported/Eigen/CXX11/src/util/CXX11Meta.h +538 -0
  455. include/eigen3/unsupported/Eigen/CXX11/src/util/CXX11Workarounds.h +88 -0
  456. include/eigen3/unsupported/Eigen/CXX11/src/util/EmulateArray.h +261 -0
  457. include/eigen3/unsupported/Eigen/CXX11/src/util/MaxSizeVector.h +158 -0
  458. include/eigen3/unsupported/Eigen/EulerAngles +43 -0
  459. include/eigen3/unsupported/Eigen/FFT +420 -0
  460. include/eigen3/unsupported/Eigen/IterativeSolvers +51 -0
  461. include/eigen3/unsupported/Eigen/KroneckerProduct +36 -0
  462. include/eigen3/unsupported/Eigen/LevenbergMarquardt +49 -0
  463. include/eigen3/unsupported/Eigen/MPRealSupport +213 -0
  464. include/eigen3/unsupported/Eigen/MatrixFunctions +504 -0
  465. include/eigen3/unsupported/Eigen/MoreVectorization +24 -0
  466. include/eigen3/unsupported/Eigen/NonLinearOptimization +140 -0
  467. include/eigen3/unsupported/Eigen/NumericalDiff +56 -0
  468. include/eigen3/unsupported/Eigen/OpenGLSupport +322 -0
  469. include/eigen3/unsupported/Eigen/Polynomials +137 -0
  470. include/eigen3/unsupported/Eigen/Skyline +39 -0
  471. include/eigen3/unsupported/Eigen/SparseExtra +54 -0
  472. include/eigen3/unsupported/Eigen/SpecialFunctions +103 -0
  473. include/eigen3/unsupported/Eigen/Splines +35 -0
  474. include/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffJacobian.h +108 -0
  475. include/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +730 -0
  476. include/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffVector.h +220 -0
  477. include/eigen3/unsupported/Eigen/src/BVH/BVAlgorithms.h +293 -0
  478. include/eigen3/unsupported/Eigen/src/BVH/KdBVH.h +223 -0
  479. include/eigen3/unsupported/Eigen/src/Eigenvalues/ArpackSelfAdjointEigenSolver.h +790 -0
  480. include/eigen3/unsupported/Eigen/src/EulerAngles/EulerAngles.h +356 -0
  481. include/eigen3/unsupported/Eigen/src/EulerAngles/EulerSystem.h +306 -0
  482. include/eigen3/unsupported/Eigen/src/FFT/ei_fftw_impl.h +261 -0
  483. include/eigen3/unsupported/Eigen/src/FFT/ei_kissfft_impl.h +449 -0
  484. include/eigen3/unsupported/Eigen/src/IterativeSolvers/ConstrainedConjGrad.h +187 -0
  485. include/eigen3/unsupported/Eigen/src/IterativeSolvers/DGMRES.h +511 -0
  486. include/eigen3/unsupported/Eigen/src/IterativeSolvers/GMRES.h +335 -0
  487. include/eigen3/unsupported/Eigen/src/IterativeSolvers/IDRS.h +436 -0
  488. include/eigen3/unsupported/Eigen/src/IterativeSolvers/IncompleteLU.h +90 -0
  489. include/eigen3/unsupported/Eigen/src/IterativeSolvers/IterationController.h +154 -0
  490. include/eigen3/unsupported/Eigen/src/IterativeSolvers/MINRES.h +267 -0
  491. include/eigen3/unsupported/Eigen/src/IterativeSolvers/Scaling.h +193 -0
  492. include/eigen3/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h +305 -0
  493. include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMcovar.h +84 -0
  494. include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMonestep.h +202 -0
  495. include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMpar.h +160 -0
  496. include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMqrsolv.h +188 -0
  497. include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LevenbergMarquardt.h +396 -0
  498. include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h +441 -0
  499. include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h +569 -0
  500. include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h +373 -0
  501. include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h +705 -0
  502. include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h +368 -0
  503. include/eigen3/unsupported/Eigen/src/MatrixFunctions/StemFunction.h +117 -0
  504. include/eigen3/unsupported/Eigen/src/MoreVectorization/MathFunctions.h +95 -0
  505. include/eigen3/unsupported/Eigen/src/NonLinearOptimization/HybridNonLinearSolver.h +601 -0
  506. include/eigen3/unsupported/Eigen/src/NonLinearOptimization/LevenbergMarquardt.h +657 -0
  507. include/eigen3/unsupported/Eigen/src/NonLinearOptimization/chkder.h +66 -0
  508. include/eigen3/unsupported/Eigen/src/NonLinearOptimization/covar.h +70 -0
  509. include/eigen3/unsupported/Eigen/src/NonLinearOptimization/dogleg.h +107 -0
  510. include/eigen3/unsupported/Eigen/src/NonLinearOptimization/fdjac1.h +79 -0
  511. include/eigen3/unsupported/Eigen/src/NonLinearOptimization/lmpar.h +298 -0
  512. include/eigen3/unsupported/Eigen/src/NonLinearOptimization/qrsolv.h +91 -0
  513. include/eigen3/unsupported/Eigen/src/NonLinearOptimization/r1mpyq.h +30 -0
  514. include/eigen3/unsupported/Eigen/src/NonLinearOptimization/r1updt.h +99 -0
  515. include/eigen3/unsupported/Eigen/src/NonLinearOptimization/rwupdt.h +49 -0
  516. include/eigen3/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h +130 -0
  517. include/eigen3/unsupported/Eigen/src/Polynomials/Companion.h +280 -0
  518. include/eigen3/unsupported/Eigen/src/Polynomials/PolynomialSolver.h +429 -0
  519. include/eigen3/unsupported/Eigen/src/Polynomials/PolynomialUtils.h +143 -0
  520. include/eigen3/unsupported/Eigen/src/Skyline/SkylineInplaceLU.h +352 -0
  521. include/eigen3/unsupported/Eigen/src/Skyline/SkylineMatrix.h +862 -0
  522. include/eigen3/unsupported/Eigen/src/Skyline/SkylineMatrixBase.h +212 -0
  523. include/eigen3/unsupported/Eigen/src/Skyline/SkylineProduct.h +295 -0
  524. include/eigen3/unsupported/Eigen/src/Skyline/SkylineStorage.h +259 -0
  525. include/eigen3/unsupported/Eigen/src/Skyline/SkylineUtil.h +89 -0
  526. include/eigen3/unsupported/Eigen/src/SparseExtra/BlockOfDynamicSparseMatrix.h +122 -0
  527. include/eigen3/unsupported/Eigen/src/SparseExtra/BlockSparseMatrix.h +1079 -0
  528. include/eigen3/unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h +404 -0
  529. include/eigen3/unsupported/Eigen/src/SparseExtra/MarketIO.h +282 -0
  530. include/eigen3/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h +247 -0
  531. include/eigen3/unsupported/Eigen/src/SparseExtra/RandomSetter.h +349 -0
  532. include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsArrayAPI.h +286 -0
  533. include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsBFloat16.h +68 -0
  534. include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsFunctors.h +357 -0
  535. include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsHalf.h +66 -0
  536. include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsImpl.h +1959 -0
  537. include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsPacketMath.h +118 -0
  538. include/eigen3/unsupported/Eigen/src/SpecialFunctions/HipVectorCompatibility.h +67 -0
  539. include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsArrayAPI.h +167 -0
  540. include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsBFloat16.h +58 -0
  541. include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsFunctors.h +330 -0
  542. include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsHalf.h +58 -0
  543. include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsImpl.h +2051 -0
  544. include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsPacketMath.h +79 -0
  545. include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/AVX/BesselFunctions.h +46 -0
  546. include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/AVX/SpecialFunctions.h +16 -0
  547. include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/AVX512/BesselFunctions.h +51 -0
  548. include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/AVX512/SpecialFunctions.h +16 -0
  549. include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/GPU/SpecialFunctions.h +369 -0
  550. include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/NEON/BesselFunctions.h +54 -0
  551. include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/NEON/SpecialFunctions.h +34 -0
  552. include/eigen3/unsupported/Eigen/src/Splines/Spline.h +507 -0
  553. include/eigen3/unsupported/Eigen/src/Splines/SplineFitting.h +431 -0
  554. include/eigen3/unsupported/Eigen/src/Splines/SplineFwd.h +93 -0
@@ -0,0 +1,2212 @@
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2006-2010 Benoit Jacob <jacob.benoit.1@gmail.com>
5
+ // Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
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_MATHFUNCTIONS_H
12
+ #define EIGEN_MATHFUNCTIONS_H
13
+
14
+ // TODO this should better be moved to NumTraits
15
+ // Source: WolframAlpha
16
+ #define EIGEN_PI 3.141592653589793238462643383279502884197169399375105820974944592307816406L
17
+ #define EIGEN_LOG2E 1.442695040888963407359924681001892137426645954152985934135449406931109219L
18
+ #define EIGEN_LN2 0.693147180559945309417232121458176568075500134360255254120680009493393621L
19
+
20
+ namespace Eigen {
21
+
22
+ // On WINCE, std::abs is defined for int only, so let's defined our own overloads:
23
+ // This issue has been confirmed with MSVC 2008 only, but the issue might exist for more recent versions too.
24
+ #if EIGEN_OS_WINCE && EIGEN_COMP_MSVC && EIGEN_COMP_MSVC<=1500
25
+ long abs(long x) { return (labs(x)); }
26
+ double abs(double x) { return (fabs(x)); }
27
+ float abs(float x) { return (fabsf(x)); }
28
+ long double abs(long double x) { return (fabsl(x)); }
29
+ #endif
30
+
31
+ namespace internal {
32
+
33
+ /** \internal \class global_math_functions_filtering_base
34
+ *
35
+ * What it does:
36
+ * Defines a typedef 'type' as follows:
37
+ * - if type T has a member typedef Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl, then
38
+ * global_math_functions_filtering_base<T>::type is a typedef for it.
39
+ * - otherwise, global_math_functions_filtering_base<T>::type is a typedef for T.
40
+ *
41
+ * How it's used:
42
+ * To allow to defined the global math functions (like sin...) in certain cases, like the Array expressions.
43
+ * When you do sin(array1+array2), the object array1+array2 has a complicated expression type, all what you want to know
44
+ * is that it inherits ArrayBase. So we implement a partial specialization of sin_impl for ArrayBase<Derived>.
45
+ * So we must make sure to use sin_impl<ArrayBase<Derived> > and not sin_impl<Derived>, otherwise our partial specialization
46
+ * won't be used. How does sin know that? That's exactly what global_math_functions_filtering_base tells it.
47
+ *
48
+ * How it's implemented:
49
+ * SFINAE in the style of enable_if. Highly susceptible of breaking compilers. With GCC, it sure does work, but if you replace
50
+ * the typename dummy by an integer template parameter, it doesn't work anymore!
51
+ */
52
+
53
+ template<typename T, typename dummy = void>
54
+ struct global_math_functions_filtering_base
55
+ {
56
+ typedef T type;
57
+ };
58
+
59
+ template<typename T> struct always_void { typedef void type; };
60
+
61
+ template<typename T>
62
+ struct global_math_functions_filtering_base
63
+ <T,
64
+ typename always_void<typename T::Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl>::type
65
+ >
66
+ {
67
+ typedef typename T::Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl type;
68
+ };
69
+
70
+ #define EIGEN_MATHFUNC_IMPL(func, scalar) Eigen::internal::func##_impl<typename Eigen::internal::global_math_functions_filtering_base<scalar>::type>
71
+ #define EIGEN_MATHFUNC_RETVAL(func, scalar) typename Eigen::internal::func##_retval<typename Eigen::internal::global_math_functions_filtering_base<scalar>::type>::type
72
+
73
+ /****************************************************************************
74
+ * Implementation of real *
75
+ ****************************************************************************/
76
+
77
+ template<typename Scalar, bool IsComplex = NumTraits<Scalar>::IsComplex>
78
+ struct real_default_impl
79
+ {
80
+ typedef typename NumTraits<Scalar>::Real RealScalar;
81
+ EIGEN_DEVICE_FUNC
82
+ static inline RealScalar run(const Scalar& x)
83
+ {
84
+ return x;
85
+ }
86
+ };
87
+
88
+ template<typename Scalar>
89
+ struct real_default_impl<Scalar,true>
90
+ {
91
+ typedef typename NumTraits<Scalar>::Real RealScalar;
92
+ EIGEN_DEVICE_FUNC
93
+ static inline RealScalar run(const Scalar& x)
94
+ {
95
+ using std::real;
96
+ return real(x);
97
+ }
98
+ };
99
+
100
+ template<typename Scalar> struct real_impl : real_default_impl<Scalar> {};
101
+
102
+ #if defined(EIGEN_GPU_COMPILE_PHASE)
103
+ template<typename T>
104
+ struct real_impl<std::complex<T> >
105
+ {
106
+ typedef T RealScalar;
107
+ EIGEN_DEVICE_FUNC
108
+ static inline T run(const std::complex<T>& x)
109
+ {
110
+ return x.real();
111
+ }
112
+ };
113
+ #endif
114
+
115
+ template<typename Scalar>
116
+ struct real_retval
117
+ {
118
+ typedef typename NumTraits<Scalar>::Real type;
119
+ };
120
+
121
+ /****************************************************************************
122
+ * Implementation of imag *
123
+ ****************************************************************************/
124
+
125
+ template<typename Scalar, bool IsComplex = NumTraits<Scalar>::IsComplex>
126
+ struct imag_default_impl
127
+ {
128
+ typedef typename NumTraits<Scalar>::Real RealScalar;
129
+ EIGEN_DEVICE_FUNC
130
+ static inline RealScalar run(const Scalar&)
131
+ {
132
+ return RealScalar(0);
133
+ }
134
+ };
135
+
136
+ template<typename Scalar>
137
+ struct imag_default_impl<Scalar,true>
138
+ {
139
+ typedef typename NumTraits<Scalar>::Real RealScalar;
140
+ EIGEN_DEVICE_FUNC
141
+ static inline RealScalar run(const Scalar& x)
142
+ {
143
+ using std::imag;
144
+ return imag(x);
145
+ }
146
+ };
147
+
148
+ template<typename Scalar> struct imag_impl : imag_default_impl<Scalar> {};
149
+
150
+ #if defined(EIGEN_GPU_COMPILE_PHASE)
151
+ template<typename T>
152
+ struct imag_impl<std::complex<T> >
153
+ {
154
+ typedef T RealScalar;
155
+ EIGEN_DEVICE_FUNC
156
+ static inline T run(const std::complex<T>& x)
157
+ {
158
+ return x.imag();
159
+ }
160
+ };
161
+ #endif
162
+
163
+ template<typename Scalar>
164
+ struct imag_retval
165
+ {
166
+ typedef typename NumTraits<Scalar>::Real type;
167
+ };
168
+
169
+ /****************************************************************************
170
+ * Implementation of real_ref *
171
+ ****************************************************************************/
172
+
173
+ template<typename Scalar>
174
+ struct real_ref_impl
175
+ {
176
+ typedef typename NumTraits<Scalar>::Real RealScalar;
177
+ EIGEN_DEVICE_FUNC
178
+ static inline RealScalar& run(Scalar& x)
179
+ {
180
+ return reinterpret_cast<RealScalar*>(&x)[0];
181
+ }
182
+ EIGEN_DEVICE_FUNC
183
+ static inline const RealScalar& run(const Scalar& x)
184
+ {
185
+ return reinterpret_cast<const RealScalar*>(&x)[0];
186
+ }
187
+ };
188
+
189
+ template<typename Scalar>
190
+ struct real_ref_retval
191
+ {
192
+ typedef typename NumTraits<Scalar>::Real & type;
193
+ };
194
+
195
+ /****************************************************************************
196
+ * Implementation of imag_ref *
197
+ ****************************************************************************/
198
+
199
+ template<typename Scalar, bool IsComplex>
200
+ struct imag_ref_default_impl
201
+ {
202
+ typedef typename NumTraits<Scalar>::Real RealScalar;
203
+ EIGEN_DEVICE_FUNC
204
+ static inline RealScalar& run(Scalar& x)
205
+ {
206
+ return reinterpret_cast<RealScalar*>(&x)[1];
207
+ }
208
+ EIGEN_DEVICE_FUNC
209
+ static inline const RealScalar& run(const Scalar& x)
210
+ {
211
+ return reinterpret_cast<RealScalar*>(&x)[1];
212
+ }
213
+ };
214
+
215
+ template<typename Scalar>
216
+ struct imag_ref_default_impl<Scalar, false>
217
+ {
218
+ EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
219
+ static inline Scalar run(Scalar&)
220
+ {
221
+ return Scalar(0);
222
+ }
223
+ EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
224
+ static inline const Scalar run(const Scalar&)
225
+ {
226
+ return Scalar(0);
227
+ }
228
+ };
229
+
230
+ template<typename Scalar>
231
+ struct imag_ref_impl : imag_ref_default_impl<Scalar, NumTraits<Scalar>::IsComplex> {};
232
+
233
+ template<typename Scalar>
234
+ struct imag_ref_retval
235
+ {
236
+ typedef typename NumTraits<Scalar>::Real & type;
237
+ };
238
+
239
+ /****************************************************************************
240
+ * Implementation of conj *
241
+ ****************************************************************************/
242
+
243
+ template<typename Scalar, bool IsComplex = NumTraits<Scalar>::IsComplex>
244
+ struct conj_default_impl
245
+ {
246
+ EIGEN_DEVICE_FUNC
247
+ static inline Scalar run(const Scalar& x)
248
+ {
249
+ return x;
250
+ }
251
+ };
252
+
253
+ template<typename Scalar>
254
+ struct conj_default_impl<Scalar,true>
255
+ {
256
+ EIGEN_DEVICE_FUNC
257
+ static inline Scalar run(const Scalar& x)
258
+ {
259
+ using std::conj;
260
+ return conj(x);
261
+ }
262
+ };
263
+
264
+ template<typename Scalar, bool IsComplex = NumTraits<Scalar>::IsComplex>
265
+ struct conj_impl : conj_default_impl<Scalar, IsComplex> {};
266
+
267
+ template<typename Scalar>
268
+ struct conj_retval
269
+ {
270
+ typedef Scalar type;
271
+ };
272
+
273
+ /****************************************************************************
274
+ * Implementation of abs2 *
275
+ ****************************************************************************/
276
+
277
+ template<typename Scalar,bool IsComplex>
278
+ struct abs2_impl_default
279
+ {
280
+ typedef typename NumTraits<Scalar>::Real RealScalar;
281
+ EIGEN_DEVICE_FUNC
282
+ static inline RealScalar run(const Scalar& x)
283
+ {
284
+ return x*x;
285
+ }
286
+ };
287
+
288
+ template<typename Scalar>
289
+ struct abs2_impl_default<Scalar, true> // IsComplex
290
+ {
291
+ typedef typename NumTraits<Scalar>::Real RealScalar;
292
+ EIGEN_DEVICE_FUNC
293
+ static inline RealScalar run(const Scalar& x)
294
+ {
295
+ return x.real()*x.real() + x.imag()*x.imag();
296
+ }
297
+ };
298
+
299
+ template<typename Scalar>
300
+ struct abs2_impl
301
+ {
302
+ typedef typename NumTraits<Scalar>::Real RealScalar;
303
+ EIGEN_DEVICE_FUNC
304
+ static inline RealScalar run(const Scalar& x)
305
+ {
306
+ return abs2_impl_default<Scalar,NumTraits<Scalar>::IsComplex>::run(x);
307
+ }
308
+ };
309
+
310
+ template<typename Scalar>
311
+ struct abs2_retval
312
+ {
313
+ typedef typename NumTraits<Scalar>::Real type;
314
+ };
315
+
316
+ /****************************************************************************
317
+ * Implementation of sqrt/rsqrt *
318
+ ****************************************************************************/
319
+
320
+ template<typename Scalar>
321
+ struct sqrt_impl
322
+ {
323
+ EIGEN_DEVICE_FUNC
324
+ static EIGEN_ALWAYS_INLINE Scalar run(const Scalar& x)
325
+ {
326
+ EIGEN_USING_STD(sqrt);
327
+ return sqrt(x);
328
+ }
329
+ };
330
+
331
+ // Complex sqrt defined in MathFunctionsImpl.h.
332
+ template<typename T> EIGEN_DEVICE_FUNC std::complex<T> complex_sqrt(const std::complex<T>& a_x);
333
+
334
+ // Custom implementation is faster than `std::sqrt`, works on
335
+ // GPU, and correctly handles special cases (unlike MSVC).
336
+ template<typename T>
337
+ struct sqrt_impl<std::complex<T> >
338
+ {
339
+ EIGEN_DEVICE_FUNC
340
+ static EIGEN_ALWAYS_INLINE std::complex<T> run(const std::complex<T>& x)
341
+ {
342
+ return complex_sqrt<T>(x);
343
+ }
344
+ };
345
+
346
+ template<typename Scalar>
347
+ struct sqrt_retval
348
+ {
349
+ typedef Scalar type;
350
+ };
351
+
352
+ // Default implementation relies on numext::sqrt, at bottom of file.
353
+ template<typename T>
354
+ struct rsqrt_impl;
355
+
356
+ // Complex rsqrt defined in MathFunctionsImpl.h.
357
+ template<typename T> EIGEN_DEVICE_FUNC std::complex<T> complex_rsqrt(const std::complex<T>& a_x);
358
+
359
+ template<typename T>
360
+ struct rsqrt_impl<std::complex<T> >
361
+ {
362
+ EIGEN_DEVICE_FUNC
363
+ static EIGEN_ALWAYS_INLINE std::complex<T> run(const std::complex<T>& x)
364
+ {
365
+ return complex_rsqrt<T>(x);
366
+ }
367
+ };
368
+
369
+ template<typename Scalar>
370
+ struct rsqrt_retval
371
+ {
372
+ typedef Scalar type;
373
+ };
374
+
375
+ /****************************************************************************
376
+ * Implementation of norm1 *
377
+ ****************************************************************************/
378
+
379
+ template<typename Scalar, bool IsComplex>
380
+ struct norm1_default_impl;
381
+
382
+ template<typename Scalar>
383
+ struct norm1_default_impl<Scalar,true>
384
+ {
385
+ typedef typename NumTraits<Scalar>::Real RealScalar;
386
+ EIGEN_DEVICE_FUNC
387
+ static inline RealScalar run(const Scalar& x)
388
+ {
389
+ EIGEN_USING_STD(abs);
390
+ return abs(x.real()) + abs(x.imag());
391
+ }
392
+ };
393
+
394
+ template<typename Scalar>
395
+ struct norm1_default_impl<Scalar, false>
396
+ {
397
+ EIGEN_DEVICE_FUNC
398
+ static inline Scalar run(const Scalar& x)
399
+ {
400
+ EIGEN_USING_STD(abs);
401
+ return abs(x);
402
+ }
403
+ };
404
+
405
+ template<typename Scalar>
406
+ struct norm1_impl : norm1_default_impl<Scalar, NumTraits<Scalar>::IsComplex> {};
407
+
408
+ template<typename Scalar>
409
+ struct norm1_retval
410
+ {
411
+ typedef typename NumTraits<Scalar>::Real type;
412
+ };
413
+
414
+ /****************************************************************************
415
+ * Implementation of hypot *
416
+ ****************************************************************************/
417
+
418
+ template<typename Scalar> struct hypot_impl;
419
+
420
+ template<typename Scalar>
421
+ struct hypot_retval
422
+ {
423
+ typedef typename NumTraits<Scalar>::Real type;
424
+ };
425
+
426
+ /****************************************************************************
427
+ * Implementation of cast *
428
+ ****************************************************************************/
429
+
430
+ template<typename OldType, typename NewType, typename EnableIf = void>
431
+ struct cast_impl
432
+ {
433
+ EIGEN_DEVICE_FUNC
434
+ static inline NewType run(const OldType& x)
435
+ {
436
+ return static_cast<NewType>(x);
437
+ }
438
+ };
439
+
440
+ // Casting from S -> Complex<T> leads to an implicit conversion from S to T,
441
+ // generating warnings on clang. Here we explicitly cast the real component.
442
+ template<typename OldType, typename NewType>
443
+ struct cast_impl<OldType, NewType,
444
+ typename internal::enable_if<
445
+ !NumTraits<OldType>::IsComplex && NumTraits<NewType>::IsComplex
446
+ >::type>
447
+ {
448
+ EIGEN_DEVICE_FUNC
449
+ static inline NewType run(const OldType& x)
450
+ {
451
+ typedef typename NumTraits<NewType>::Real NewReal;
452
+ return static_cast<NewType>(static_cast<NewReal>(x));
453
+ }
454
+ };
455
+
456
+ // here, for once, we're plainly returning NewType: we don't want cast to do weird things.
457
+
458
+ template<typename OldType, typename NewType>
459
+ EIGEN_DEVICE_FUNC
460
+ inline NewType cast(const OldType& x)
461
+ {
462
+ return cast_impl<OldType, NewType>::run(x);
463
+ }
464
+
465
+ /****************************************************************************
466
+ * Implementation of round *
467
+ ****************************************************************************/
468
+
469
+ template<typename Scalar>
470
+ struct round_impl
471
+ {
472
+ EIGEN_DEVICE_FUNC
473
+ static inline Scalar run(const Scalar& x)
474
+ {
475
+ EIGEN_STATIC_ASSERT((!NumTraits<Scalar>::IsComplex), NUMERIC_TYPE_MUST_BE_REAL)
476
+ #if EIGEN_HAS_CXX11_MATH
477
+ EIGEN_USING_STD(round);
478
+ #endif
479
+ return Scalar(round(x));
480
+ }
481
+ };
482
+
483
+ #if !EIGEN_HAS_CXX11_MATH
484
+ #if EIGEN_HAS_C99_MATH
485
+ // Use ::roundf for float.
486
+ template<>
487
+ struct round_impl<float> {
488
+ EIGEN_DEVICE_FUNC
489
+ static inline float run(const float& x)
490
+ {
491
+ return ::roundf(x);
492
+ }
493
+ };
494
+ #else
495
+ template<typename Scalar>
496
+ struct round_using_floor_ceil_impl
497
+ {
498
+ EIGEN_DEVICE_FUNC
499
+ static inline Scalar run(const Scalar& x)
500
+ {
501
+ EIGEN_STATIC_ASSERT((!NumTraits<Scalar>::IsComplex), NUMERIC_TYPE_MUST_BE_REAL)
502
+ // Without C99 round/roundf, resort to floor/ceil.
503
+ EIGEN_USING_STD(floor);
504
+ EIGEN_USING_STD(ceil);
505
+ // If not enough precision to resolve a decimal at all, return the input.
506
+ // Otherwise, adding 0.5 can trigger an increment by 1.
507
+ const Scalar limit = Scalar(1ull << (NumTraits<Scalar>::digits() - 1));
508
+ if (x >= limit || x <= -limit) {
509
+ return x;
510
+ }
511
+ return (x > Scalar(0)) ? Scalar(floor(x + Scalar(0.5))) : Scalar(ceil(x - Scalar(0.5)));
512
+ }
513
+ };
514
+
515
+ template<>
516
+ struct round_impl<float> : round_using_floor_ceil_impl<float> {};
517
+
518
+ template<>
519
+ struct round_impl<double> : round_using_floor_ceil_impl<double> {};
520
+ #endif // EIGEN_HAS_C99_MATH
521
+ #endif // !EIGEN_HAS_CXX11_MATH
522
+
523
+ template<typename Scalar>
524
+ struct round_retval
525
+ {
526
+ typedef Scalar type;
527
+ };
528
+
529
+ /****************************************************************************
530
+ * Implementation of rint *
531
+ ****************************************************************************/
532
+
533
+ template<typename Scalar>
534
+ struct rint_impl {
535
+ EIGEN_DEVICE_FUNC
536
+ static inline Scalar run(const Scalar& x)
537
+ {
538
+ EIGEN_STATIC_ASSERT((!NumTraits<Scalar>::IsComplex), NUMERIC_TYPE_MUST_BE_REAL)
539
+ #if EIGEN_HAS_CXX11_MATH
540
+ EIGEN_USING_STD(rint);
541
+ #endif
542
+ return rint(x);
543
+ }
544
+ };
545
+
546
+ #if !EIGEN_HAS_CXX11_MATH
547
+ template<>
548
+ struct rint_impl<double> {
549
+ EIGEN_DEVICE_FUNC
550
+ static inline double run(const double& x)
551
+ {
552
+ return ::rint(x);
553
+ }
554
+ };
555
+ template<>
556
+ struct rint_impl<float> {
557
+ EIGEN_DEVICE_FUNC
558
+ static inline float run(const float& x)
559
+ {
560
+ return ::rintf(x);
561
+ }
562
+ };
563
+ #endif
564
+
565
+ template<typename Scalar>
566
+ struct rint_retval
567
+ {
568
+ typedef Scalar type;
569
+ };
570
+
571
+ /****************************************************************************
572
+ * Implementation of arg *
573
+ ****************************************************************************/
574
+
575
+ // Visual Studio 2017 has a bug where arg(float) returns 0 for negative inputs.
576
+ // This seems to be fixed in VS 2019.
577
+ #if EIGEN_HAS_CXX11_MATH && (!EIGEN_COMP_MSVC || EIGEN_COMP_MSVC >= 1920)
578
+ // std::arg is only defined for types of std::complex, or integer types or float/double/long double
579
+ template<typename Scalar,
580
+ bool HasStdImpl = NumTraits<Scalar>::IsComplex || is_integral<Scalar>::value
581
+ || is_same<Scalar, float>::value || is_same<Scalar, double>::value
582
+ || is_same<Scalar, long double>::value >
583
+ struct arg_default_impl;
584
+
585
+ template<typename Scalar>
586
+ struct arg_default_impl<Scalar, true> {
587
+ typedef typename NumTraits<Scalar>::Real RealScalar;
588
+ EIGEN_DEVICE_FUNC
589
+ static inline RealScalar run(const Scalar& x)
590
+ {
591
+ // There is no official ::arg on device in CUDA/HIP, so we always need to use std::arg.
592
+ using std::arg;
593
+ return static_cast<RealScalar>(arg(x));
594
+ }
595
+ };
596
+
597
+ // Must be non-complex floating-point type (e.g. half/bfloat16).
598
+ template<typename Scalar>
599
+ struct arg_default_impl<Scalar, false> {
600
+ typedef typename NumTraits<Scalar>::Real RealScalar;
601
+ EIGEN_DEVICE_FUNC
602
+ static inline RealScalar run(const Scalar& x)
603
+ {
604
+ return (x < Scalar(0)) ? RealScalar(EIGEN_PI) : RealScalar(0);
605
+ }
606
+ };
607
+ #else
608
+ template<typename Scalar, bool IsComplex = NumTraits<Scalar>::IsComplex>
609
+ struct arg_default_impl
610
+ {
611
+ typedef typename NumTraits<Scalar>::Real RealScalar;
612
+ EIGEN_DEVICE_FUNC
613
+ static inline RealScalar run(const Scalar& x)
614
+ {
615
+ return (x < RealScalar(0)) ? RealScalar(EIGEN_PI) : RealScalar(0);
616
+ }
617
+ };
618
+
619
+ template<typename Scalar>
620
+ struct arg_default_impl<Scalar,true>
621
+ {
622
+ typedef typename NumTraits<Scalar>::Real RealScalar;
623
+ EIGEN_DEVICE_FUNC
624
+ static inline RealScalar run(const Scalar& x)
625
+ {
626
+ EIGEN_USING_STD(arg);
627
+ return arg(x);
628
+ }
629
+ };
630
+ #endif
631
+ template<typename Scalar> struct arg_impl : arg_default_impl<Scalar> {};
632
+
633
+ template<typename Scalar>
634
+ struct arg_retval
635
+ {
636
+ typedef typename NumTraits<Scalar>::Real type;
637
+ };
638
+
639
+ /****************************************************************************
640
+ * Implementation of expm1 *
641
+ ****************************************************************************/
642
+
643
+ // This implementation is based on GSL Math's expm1.
644
+ namespace std_fallback {
645
+ // fallback expm1 implementation in case there is no expm1(Scalar) function in namespace of Scalar,
646
+ // or that there is no suitable std::expm1 function available. Implementation
647
+ // attributed to Kahan. See: http://www.plunk.org/~hatch/rightway.php.
648
+ template<typename Scalar>
649
+ EIGEN_DEVICE_FUNC inline Scalar expm1(const Scalar& x) {
650
+ EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar)
651
+ typedef typename NumTraits<Scalar>::Real RealScalar;
652
+
653
+ EIGEN_USING_STD(exp);
654
+ Scalar u = exp(x);
655
+ if (numext::equal_strict(u, Scalar(1))) {
656
+ return x;
657
+ }
658
+ Scalar um1 = u - RealScalar(1);
659
+ if (numext::equal_strict(um1, Scalar(-1))) {
660
+ return RealScalar(-1);
661
+ }
662
+
663
+ EIGEN_USING_STD(log);
664
+ Scalar logu = log(u);
665
+ return numext::equal_strict(u, logu) ? u : (u - RealScalar(1)) * x / logu;
666
+ }
667
+ }
668
+
669
+ template<typename Scalar>
670
+ struct expm1_impl {
671
+ EIGEN_DEVICE_FUNC static inline Scalar run(const Scalar& x)
672
+ {
673
+ EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar)
674
+ #if EIGEN_HAS_CXX11_MATH
675
+ using std::expm1;
676
+ #else
677
+ using std_fallback::expm1;
678
+ #endif
679
+ return expm1(x);
680
+ }
681
+ };
682
+
683
+ template<typename Scalar>
684
+ struct expm1_retval
685
+ {
686
+ typedef Scalar type;
687
+ };
688
+
689
+ /****************************************************************************
690
+ * Implementation of log *
691
+ ****************************************************************************/
692
+
693
+ // Complex log defined in MathFunctionsImpl.h.
694
+ template<typename T> EIGEN_DEVICE_FUNC std::complex<T> complex_log(const std::complex<T>& z);
695
+
696
+ template<typename Scalar>
697
+ struct log_impl {
698
+ EIGEN_DEVICE_FUNC static inline Scalar run(const Scalar& x)
699
+ {
700
+ EIGEN_USING_STD(log);
701
+ return static_cast<Scalar>(log(x));
702
+ }
703
+ };
704
+
705
+ template<typename Scalar>
706
+ struct log_impl<std::complex<Scalar> > {
707
+ EIGEN_DEVICE_FUNC static inline std::complex<Scalar> run(const std::complex<Scalar>& z)
708
+ {
709
+ return complex_log(z);
710
+ }
711
+ };
712
+
713
+ /****************************************************************************
714
+ * Implementation of log1p *
715
+ ****************************************************************************/
716
+
717
+ namespace std_fallback {
718
+ // fallback log1p implementation in case there is no log1p(Scalar) function in namespace of Scalar,
719
+ // or that there is no suitable std::log1p function available
720
+ template<typename Scalar>
721
+ EIGEN_DEVICE_FUNC inline Scalar log1p(const Scalar& x) {
722
+ EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar)
723
+ typedef typename NumTraits<Scalar>::Real RealScalar;
724
+ EIGEN_USING_STD(log);
725
+ Scalar x1p = RealScalar(1) + x;
726
+ Scalar log_1p = log_impl<Scalar>::run(x1p);
727
+ const bool is_small = numext::equal_strict(x1p, Scalar(1));
728
+ const bool is_inf = numext::equal_strict(x1p, log_1p);
729
+ return (is_small || is_inf) ? x : x * (log_1p / (x1p - RealScalar(1)));
730
+ }
731
+ }
732
+
733
+ template<typename Scalar>
734
+ struct log1p_impl {
735
+ EIGEN_DEVICE_FUNC static inline Scalar run(const Scalar& x)
736
+ {
737
+ EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar)
738
+ #if EIGEN_HAS_CXX11_MATH
739
+ using std::log1p;
740
+ #else
741
+ using std_fallback::log1p;
742
+ #endif
743
+ return log1p(x);
744
+ }
745
+ };
746
+
747
+ // Specialization for complex types that are not supported by std::log1p.
748
+ template <typename RealScalar>
749
+ struct log1p_impl<std::complex<RealScalar> > {
750
+ EIGEN_DEVICE_FUNC static inline std::complex<RealScalar> run(
751
+ const std::complex<RealScalar>& x) {
752
+ EIGEN_STATIC_ASSERT_NON_INTEGER(RealScalar)
753
+ return std_fallback::log1p(x);
754
+ }
755
+ };
756
+
757
+ template<typename Scalar>
758
+ struct log1p_retval
759
+ {
760
+ typedef Scalar type;
761
+ };
762
+
763
+ /****************************************************************************
764
+ * Implementation of pow *
765
+ ****************************************************************************/
766
+
767
+ template<typename ScalarX,typename ScalarY, bool IsInteger = NumTraits<ScalarX>::IsInteger&&NumTraits<ScalarY>::IsInteger>
768
+ struct pow_impl
769
+ {
770
+ //typedef Scalar retval;
771
+ typedef typename ScalarBinaryOpTraits<ScalarX,ScalarY,internal::scalar_pow_op<ScalarX,ScalarY> >::ReturnType result_type;
772
+ static EIGEN_DEVICE_FUNC inline result_type run(const ScalarX& x, const ScalarY& y)
773
+ {
774
+ EIGEN_USING_STD(pow);
775
+ return pow(x, y);
776
+ }
777
+ };
778
+
779
+ template<typename ScalarX,typename ScalarY>
780
+ struct pow_impl<ScalarX,ScalarY, true>
781
+ {
782
+ typedef ScalarX result_type;
783
+ static EIGEN_DEVICE_FUNC inline ScalarX run(ScalarX x, ScalarY y)
784
+ {
785
+ ScalarX res(1);
786
+ eigen_assert(!NumTraits<ScalarY>::IsSigned || y >= 0);
787
+ if(y & 1) res *= x;
788
+ y >>= 1;
789
+ while(y)
790
+ {
791
+ x *= x;
792
+ if(y&1) res *= x;
793
+ y >>= 1;
794
+ }
795
+ return res;
796
+ }
797
+ };
798
+
799
+ /****************************************************************************
800
+ * Implementation of random *
801
+ ****************************************************************************/
802
+
803
+ template<typename Scalar,
804
+ bool IsComplex,
805
+ bool IsInteger>
806
+ struct random_default_impl {};
807
+
808
+ template<typename Scalar>
809
+ struct random_impl : random_default_impl<Scalar, NumTraits<Scalar>::IsComplex, NumTraits<Scalar>::IsInteger> {};
810
+
811
+ template<typename Scalar>
812
+ struct random_retval
813
+ {
814
+ typedef Scalar type;
815
+ };
816
+
817
+ template<typename Scalar> inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random(const Scalar& x, const Scalar& y);
818
+ template<typename Scalar> inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random();
819
+
820
+ template<typename Scalar>
821
+ struct random_default_impl<Scalar, false, false>
822
+ {
823
+ static inline Scalar run(const Scalar& x, const Scalar& y)
824
+ {
825
+ return x + (y-x) * Scalar(std::rand()) / Scalar(RAND_MAX);
826
+ }
827
+ static inline Scalar run()
828
+ {
829
+ return run(Scalar(NumTraits<Scalar>::IsSigned ? -1 : 0), Scalar(1));
830
+ }
831
+ };
832
+
833
+ enum {
834
+ meta_floor_log2_terminate,
835
+ meta_floor_log2_move_up,
836
+ meta_floor_log2_move_down,
837
+ meta_floor_log2_bogus
838
+ };
839
+
840
+ template<unsigned int n, int lower, int upper> struct meta_floor_log2_selector
841
+ {
842
+ enum { middle = (lower + upper) / 2,
843
+ value = (upper <= lower + 1) ? int(meta_floor_log2_terminate)
844
+ : (n < (1 << middle)) ? int(meta_floor_log2_move_down)
845
+ : (n==0) ? int(meta_floor_log2_bogus)
846
+ : int(meta_floor_log2_move_up)
847
+ };
848
+ };
849
+
850
+ template<unsigned int n,
851
+ int lower = 0,
852
+ int upper = sizeof(unsigned int) * CHAR_BIT - 1,
853
+ int selector = meta_floor_log2_selector<n, lower, upper>::value>
854
+ struct meta_floor_log2 {};
855
+
856
+ template<unsigned int n, int lower, int upper>
857
+ struct meta_floor_log2<n, lower, upper, meta_floor_log2_move_down>
858
+ {
859
+ enum { value = meta_floor_log2<n, lower, meta_floor_log2_selector<n, lower, upper>::middle>::value };
860
+ };
861
+
862
+ template<unsigned int n, int lower, int upper>
863
+ struct meta_floor_log2<n, lower, upper, meta_floor_log2_move_up>
864
+ {
865
+ enum { value = meta_floor_log2<n, meta_floor_log2_selector<n, lower, upper>::middle, upper>::value };
866
+ };
867
+
868
+ template<unsigned int n, int lower, int upper>
869
+ struct meta_floor_log2<n, lower, upper, meta_floor_log2_terminate>
870
+ {
871
+ enum { value = (n >= ((unsigned int)(1) << (lower+1))) ? lower+1 : lower };
872
+ };
873
+
874
+ template<unsigned int n, int lower, int upper>
875
+ struct meta_floor_log2<n, lower, upper, meta_floor_log2_bogus>
876
+ {
877
+ // no value, error at compile time
878
+ };
879
+
880
+ template <typename BitsType, typename EnableIf = void>
881
+ struct count_bits_impl {
882
+ static EIGEN_DEVICE_FUNC inline int clz(BitsType bits) {
883
+ EIGEN_STATIC_ASSERT(
884
+ is_integral<BitsType>::value && !NumTraits<BitsType>::IsSigned,
885
+ THIS_TYPE_IS_NOT_SUPPORTED);
886
+ int n = CHAR_BIT * sizeof(BitsType);
887
+ int shift = n / 2;
888
+ while (bits > 0 && shift > 0) {
889
+ BitsType y = bits >> shift;
890
+ if (y > 0) {
891
+ n -= shift;
892
+ bits = y;
893
+ }
894
+ shift /= 2;
895
+ }
896
+ if (shift == 0) {
897
+ --n;
898
+ }
899
+ return n;
900
+ }
901
+
902
+ static EIGEN_DEVICE_FUNC inline int ctz(BitsType bits) {
903
+ EIGEN_STATIC_ASSERT(
904
+ is_integral<BitsType>::value && !NumTraits<BitsType>::IsSigned,
905
+ THIS_TYPE_IS_NOT_SUPPORTED);
906
+ int n = CHAR_BIT * sizeof(BitsType);
907
+ int shift = n / 2;
908
+ while (bits > 0 && shift > 0) {
909
+ BitsType y = bits << shift;
910
+ if (y > 0) {
911
+ n -= shift;
912
+ bits = y;
913
+ }
914
+ shift /= 2;
915
+ }
916
+ if (shift == 0) {
917
+ --n;
918
+ }
919
+ return n;
920
+ }
921
+ };
922
+
923
+ // Count leading zeros.
924
+ template <typename BitsType>
925
+ EIGEN_DEVICE_FUNC inline int clz(BitsType bits) {
926
+ return count_bits_impl<BitsType>::clz(bits);
927
+ }
928
+
929
+ // Count trailing zeros.
930
+ template <typename BitsType>
931
+ EIGEN_DEVICE_FUNC inline int ctz(BitsType bits) {
932
+ return count_bits_impl<BitsType>::ctz(bits);
933
+ }
934
+
935
+ #if EIGEN_COMP_GNUC || EIGEN_COMP_CLANG
936
+
937
+ template <typename BitsType>
938
+ struct count_bits_impl<BitsType, typename enable_if<sizeof(BitsType) <= sizeof(unsigned int)>::type> {
939
+ static const int kNumBits = static_cast<int>(sizeof(BitsType) * CHAR_BIT);
940
+ static EIGEN_DEVICE_FUNC inline int clz(BitsType bits) {
941
+ EIGEN_STATIC_ASSERT(is_integral<BitsType>::value, THIS_TYPE_IS_NOT_SUPPORTED);
942
+ static const int kLeadingBitsOffset = (sizeof(unsigned int) - sizeof(BitsType)) * CHAR_BIT;
943
+ return bits == 0 ? kNumBits : __builtin_clz(static_cast<unsigned int>(bits)) - kLeadingBitsOffset;
944
+ }
945
+
946
+ static EIGEN_DEVICE_FUNC inline int ctz(BitsType bits) {
947
+ EIGEN_STATIC_ASSERT(is_integral<BitsType>::value, THIS_TYPE_IS_NOT_SUPPORTED);
948
+ return bits == 0 ? kNumBits : __builtin_ctz(static_cast<unsigned int>(bits));
949
+ }
950
+ };
951
+
952
+ template <typename BitsType>
953
+ struct count_bits_impl<
954
+ BitsType, typename enable_if<sizeof(unsigned int) < sizeof(BitsType) && sizeof(BitsType) <= sizeof(unsigned long)>::type> {
955
+ static const int kNumBits = static_cast<int>(sizeof(BitsType) * CHAR_BIT);
956
+ static EIGEN_DEVICE_FUNC inline int clz(BitsType bits) {
957
+ EIGEN_STATIC_ASSERT(is_integral<BitsType>::value, THIS_TYPE_IS_NOT_SUPPORTED);
958
+ static const int kLeadingBitsOffset = (sizeof(unsigned long) - sizeof(BitsType)) * CHAR_BIT;
959
+ return bits == 0 ? kNumBits : __builtin_clzl(static_cast<unsigned long>(bits)) - kLeadingBitsOffset;
960
+ }
961
+
962
+ static EIGEN_DEVICE_FUNC inline int ctz(BitsType bits) {
963
+ EIGEN_STATIC_ASSERT(is_integral<BitsType>::value, THIS_TYPE_IS_NOT_SUPPORTED);
964
+ return bits == 0 ? kNumBits : __builtin_ctzl(static_cast<unsigned long>(bits));
965
+ }
966
+ };
967
+
968
+ template <typename BitsType>
969
+ struct count_bits_impl<BitsType, typename enable_if<sizeof(unsigned long) < sizeof(BitsType) &&
970
+ sizeof(BitsType) <= sizeof(unsigned long long)>::type> {
971
+ static const int kNumBits = static_cast<int>(sizeof(BitsType) * CHAR_BIT);
972
+ static EIGEN_DEVICE_FUNC inline int clz(BitsType bits) {
973
+ EIGEN_STATIC_ASSERT(is_integral<BitsType>::value, THIS_TYPE_IS_NOT_SUPPORTED);
974
+ static const int kLeadingBitsOffset = (sizeof(unsigned long long) - sizeof(BitsType)) * CHAR_BIT;
975
+ return bits == 0 ? kNumBits : __builtin_clzll(static_cast<unsigned long long>(bits)) - kLeadingBitsOffset;
976
+ }
977
+
978
+ static EIGEN_DEVICE_FUNC inline int ctz(BitsType bits) {
979
+ EIGEN_STATIC_ASSERT(is_integral<BitsType>::value, THIS_TYPE_IS_NOT_SUPPORTED);
980
+ return bits == 0 ? kNumBits : __builtin_ctzll(static_cast<unsigned long long>(bits));
981
+ }
982
+ };
983
+
984
+ #elif EIGEN_COMP_MSVC
985
+
986
+ template <typename BitsType>
987
+ struct count_bits_impl<BitsType, typename enable_if<sizeof(BitsType) <= sizeof(unsigned long)>::type> {
988
+ static const int kNumBits = static_cast<int>(sizeof(BitsType) * CHAR_BIT);
989
+ static EIGEN_DEVICE_FUNC inline int clz(BitsType bits) {
990
+ EIGEN_STATIC_ASSERT(is_integral<BitsType>::value, THIS_TYPE_IS_NOT_SUPPORTED);
991
+ unsigned long out;
992
+ _BitScanReverse(&out, static_cast<unsigned long>(bits));
993
+ return bits == 0 ? kNumBits : (kNumBits - 1) - static_cast<int>(out);
994
+ }
995
+
996
+ static EIGEN_DEVICE_FUNC inline int ctz(BitsType bits) {
997
+ EIGEN_STATIC_ASSERT(is_integral<BitsType>::value, THIS_TYPE_IS_NOT_SUPPORTED);
998
+ unsigned long out;
999
+ _BitScanForward(&out, static_cast<unsigned long>(bits));
1000
+ return bits == 0 ? kNumBits : static_cast<int>(out);
1001
+ }
1002
+ };
1003
+
1004
+ #ifdef _WIN64
1005
+
1006
+ template <typename BitsType>
1007
+ struct count_bits_impl<
1008
+ BitsType, typename enable_if<sizeof(unsigned long) < sizeof(BitsType) && sizeof(BitsType) <= sizeof(__int64)>::type> {
1009
+ static const int kNumBits = static_cast<int>(sizeof(BitsType) * CHAR_BIT);
1010
+ static EIGEN_DEVICE_FUNC inline int clz(BitsType bits) {
1011
+ EIGEN_STATIC_ASSERT(is_integral<BitsType>::value, THIS_TYPE_IS_NOT_SUPPORTED);
1012
+ unsigned long out;
1013
+ _BitScanReverse64(&out, static_cast<unsigned __int64>(bits));
1014
+ return bits == 0 ? kNumBits : (kNumBits - 1) - static_cast<int>(out);
1015
+ }
1016
+
1017
+ static EIGEN_DEVICE_FUNC inline int ctz(BitsType bits) {
1018
+ EIGEN_STATIC_ASSERT(is_integral<BitsType>::value, THIS_TYPE_IS_NOT_SUPPORTED);
1019
+ unsigned long out;
1020
+ _BitScanForward64(&out, static_cast<unsigned __int64>(bits));
1021
+ return bits == 0 ? kNumBits : static_cast<int>(out);
1022
+ }
1023
+ };
1024
+
1025
+ #endif // _WIN64
1026
+
1027
+ #endif // EIGEN_COMP_GNUC || EIGEN_COMP_CLANG
1028
+
1029
+ template <typename Scalar>
1030
+ struct random_default_impl<Scalar, false, true> {
1031
+ static inline Scalar run(const Scalar& x, const Scalar& y) {
1032
+ if (y <= x) return x;
1033
+ // ScalarU is the unsigned counterpart of Scalar, possibly Scalar itself.
1034
+ typedef typename make_unsigned<Scalar>::type ScalarU;
1035
+ // ScalarX is the widest of ScalarU and unsigned int.
1036
+ // We'll deal only with ScalarX and unsigned int below thus avoiding signed
1037
+ // types and arithmetic and signed overflows (which are undefined behavior).
1038
+ typedef typename conditional<(ScalarU(-1) > unsigned(-1)), ScalarU, unsigned>::type ScalarX;
1039
+ // The following difference doesn't overflow, provided our integer types are two's
1040
+ // complement and have the same number of padding bits in signed and unsigned variants.
1041
+ // This is the case in most modern implementations of C++.
1042
+ ScalarX range = ScalarX(y) - ScalarX(x);
1043
+ ScalarX offset = 0;
1044
+ ScalarX divisor = 1;
1045
+ ScalarX multiplier = 1;
1046
+ const unsigned rand_max = RAND_MAX;
1047
+ if (range <= rand_max) divisor = (rand_max + 1) / (range + 1);
1048
+ else multiplier = 1 + range / (rand_max + 1);
1049
+ // Rejection sampling.
1050
+ do {
1051
+ offset = (unsigned(std::rand()) * multiplier) / divisor;
1052
+ } while (offset > range);
1053
+ return Scalar(ScalarX(x) + offset);
1054
+ }
1055
+
1056
+ static inline Scalar run()
1057
+ {
1058
+ #ifdef EIGEN_MAKING_DOCS
1059
+ return run(Scalar(NumTraits<Scalar>::IsSigned ? -10 : 0), Scalar(10));
1060
+ #else
1061
+ enum { rand_bits = meta_floor_log2<(unsigned int)(RAND_MAX)+1>::value,
1062
+ scalar_bits = sizeof(Scalar) * CHAR_BIT,
1063
+ shift = EIGEN_PLAIN_ENUM_MAX(0, int(rand_bits) - int(scalar_bits)),
1064
+ offset = NumTraits<Scalar>::IsSigned ? (1 << (EIGEN_PLAIN_ENUM_MIN(rand_bits,scalar_bits)-1)) : 0
1065
+ };
1066
+ return Scalar((std::rand() >> shift) - offset);
1067
+ #endif
1068
+ }
1069
+ };
1070
+
1071
+ template<typename Scalar>
1072
+ struct random_default_impl<Scalar, true, false>
1073
+ {
1074
+ static inline Scalar run(const Scalar& x, const Scalar& y)
1075
+ {
1076
+ return Scalar(random(x.real(), y.real()),
1077
+ random(x.imag(), y.imag()));
1078
+ }
1079
+ static inline Scalar run()
1080
+ {
1081
+ typedef typename NumTraits<Scalar>::Real RealScalar;
1082
+ return Scalar(random<RealScalar>(), random<RealScalar>());
1083
+ }
1084
+ };
1085
+
1086
+ template<typename Scalar>
1087
+ inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random(const Scalar& x, const Scalar& y)
1088
+ {
1089
+ return EIGEN_MATHFUNC_IMPL(random, Scalar)::run(x, y);
1090
+ }
1091
+
1092
+ template<typename Scalar>
1093
+ inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random()
1094
+ {
1095
+ return EIGEN_MATHFUNC_IMPL(random, Scalar)::run();
1096
+ }
1097
+
1098
+ // Implementation of is* functions
1099
+
1100
+ // std::is* do not work with fast-math and gcc, std::is* are available on MSVC 2013 and newer, as well as in clang.
1101
+ #if (EIGEN_HAS_CXX11_MATH && !(EIGEN_COMP_GNUC_STRICT && __FINITE_MATH_ONLY__)) || (EIGEN_COMP_MSVC>=1800) || (EIGEN_COMP_CLANG)
1102
+ #define EIGEN_USE_STD_FPCLASSIFY 1
1103
+ #else
1104
+ #define EIGEN_USE_STD_FPCLASSIFY 0
1105
+ #endif
1106
+
1107
+ template<typename T>
1108
+ EIGEN_DEVICE_FUNC
1109
+ typename internal::enable_if<internal::is_integral<T>::value,bool>::type
1110
+ isnan_impl(const T&) { return false; }
1111
+
1112
+ template<typename T>
1113
+ EIGEN_DEVICE_FUNC
1114
+ typename internal::enable_if<internal::is_integral<T>::value,bool>::type
1115
+ isinf_impl(const T&) { return false; }
1116
+
1117
+ template<typename T>
1118
+ EIGEN_DEVICE_FUNC
1119
+ typename internal::enable_if<internal::is_integral<T>::value,bool>::type
1120
+ isfinite_impl(const T&) { return true; }
1121
+
1122
+ template<typename T>
1123
+ EIGEN_DEVICE_FUNC
1124
+ typename internal::enable_if<(!internal::is_integral<T>::value)&&(!NumTraits<T>::IsComplex),bool>::type
1125
+ isfinite_impl(const T& x)
1126
+ {
1127
+ #if defined(EIGEN_GPU_COMPILE_PHASE)
1128
+ return (::isfinite)(x);
1129
+ #elif EIGEN_USE_STD_FPCLASSIFY
1130
+ using std::isfinite;
1131
+ return isfinite EIGEN_NOT_A_MACRO (x);
1132
+ #else
1133
+ return x<=NumTraits<T>::highest() && x>=NumTraits<T>::lowest();
1134
+ #endif
1135
+ }
1136
+
1137
+ template<typename T>
1138
+ EIGEN_DEVICE_FUNC
1139
+ typename internal::enable_if<(!internal::is_integral<T>::value)&&(!NumTraits<T>::IsComplex),bool>::type
1140
+ isinf_impl(const T& x)
1141
+ {
1142
+ #if defined(EIGEN_GPU_COMPILE_PHASE)
1143
+ return (::isinf)(x);
1144
+ #elif EIGEN_USE_STD_FPCLASSIFY
1145
+ using std::isinf;
1146
+ return isinf EIGEN_NOT_A_MACRO (x);
1147
+ #else
1148
+ return x>NumTraits<T>::highest() || x<NumTraits<T>::lowest();
1149
+ #endif
1150
+ }
1151
+
1152
+ template<typename T>
1153
+ EIGEN_DEVICE_FUNC
1154
+ typename internal::enable_if<(!internal::is_integral<T>::value)&&(!NumTraits<T>::IsComplex),bool>::type
1155
+ isnan_impl(const T& x)
1156
+ {
1157
+ #if defined(EIGEN_GPU_COMPILE_PHASE)
1158
+ return (::isnan)(x);
1159
+ #elif EIGEN_USE_STD_FPCLASSIFY
1160
+ using std::isnan;
1161
+ return isnan EIGEN_NOT_A_MACRO (x);
1162
+ #else
1163
+ return x != x;
1164
+ #endif
1165
+ }
1166
+
1167
+ #if (!EIGEN_USE_STD_FPCLASSIFY)
1168
+
1169
+ #if EIGEN_COMP_MSVC
1170
+
1171
+ template<typename T> EIGEN_DEVICE_FUNC bool isinf_msvc_helper(T x)
1172
+ {
1173
+ return _fpclass(x)==_FPCLASS_NINF || _fpclass(x)==_FPCLASS_PINF;
1174
+ }
1175
+
1176
+ //MSVC defines a _isnan builtin function, but for double only
1177
+ #ifndef EIGEN_GPU_COMPILE_PHASE
1178
+ EIGEN_DEVICE_FUNC inline bool isnan_impl(const long double& x) { return _isnan(x)!=0; }
1179
+ #endif
1180
+ EIGEN_DEVICE_FUNC inline bool isnan_impl(const double& x) { return _isnan(x)!=0; }
1181
+ EIGEN_DEVICE_FUNC inline bool isnan_impl(const float& x) { return _isnan(x)!=0; }
1182
+
1183
+ #ifndef EIGEN_GPU_COMPILE_PHASE
1184
+ EIGEN_DEVICE_FUNC inline bool isinf_impl(const long double& x) { return isinf_msvc_helper(x); }
1185
+ #endif
1186
+ EIGEN_DEVICE_FUNC inline bool isinf_impl(const double& x) { return isinf_msvc_helper(x); }
1187
+ EIGEN_DEVICE_FUNC inline bool isinf_impl(const float& x) { return isinf_msvc_helper(x); }
1188
+
1189
+ #elif (defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ && EIGEN_COMP_GNUC)
1190
+
1191
+ #if EIGEN_GNUC_AT_LEAST(5,0)
1192
+ #define EIGEN_TMP_NOOPT_ATTRIB EIGEN_DEVICE_FUNC inline __attribute__((optimize("no-finite-math-only")))
1193
+ #else
1194
+ // NOTE the inline qualifier and noinline attribute are both needed: the former is to avoid linking issue (duplicate symbol),
1195
+ // while the second prevent too aggressive optimizations in fast-math mode:
1196
+ #define EIGEN_TMP_NOOPT_ATTRIB EIGEN_DEVICE_FUNC inline __attribute__((noinline,optimize("no-finite-math-only")))
1197
+ #endif
1198
+
1199
+ #ifndef EIGEN_GPU_COMPILE_PHASE
1200
+ template<> EIGEN_TMP_NOOPT_ATTRIB bool isnan_impl(const long double& x) { return __builtin_isnan(x); }
1201
+ #endif
1202
+ template<> EIGEN_TMP_NOOPT_ATTRIB bool isnan_impl(const double& x) { return __builtin_isnan(x); }
1203
+ template<> EIGEN_TMP_NOOPT_ATTRIB bool isnan_impl(const float& x) { return __builtin_isnan(x); }
1204
+ template<> EIGEN_TMP_NOOPT_ATTRIB bool isinf_impl(const double& x) { return __builtin_isinf(x); }
1205
+ template<> EIGEN_TMP_NOOPT_ATTRIB bool isinf_impl(const float& x) { return __builtin_isinf(x); }
1206
+ #ifndef EIGEN_GPU_COMPILE_PHASE
1207
+ template<> EIGEN_TMP_NOOPT_ATTRIB bool isinf_impl(const long double& x) { return __builtin_isinf(x); }
1208
+ #endif
1209
+
1210
+ #undef EIGEN_TMP_NOOPT_ATTRIB
1211
+
1212
+ #endif
1213
+
1214
+ #endif
1215
+
1216
+ // The following overload are defined at the end of this file
1217
+ template<typename T> EIGEN_DEVICE_FUNC bool isfinite_impl(const std::complex<T>& x);
1218
+ template<typename T> EIGEN_DEVICE_FUNC bool isnan_impl(const std::complex<T>& x);
1219
+ template<typename T> EIGEN_DEVICE_FUNC bool isinf_impl(const std::complex<T>& x);
1220
+
1221
+ template<typename T> T generic_fast_tanh_float(const T& a_x);
1222
+ } // end namespace internal
1223
+
1224
+ /****************************************************************************
1225
+ * Generic math functions *
1226
+ ****************************************************************************/
1227
+
1228
+ namespace numext {
1229
+
1230
+ #if (!defined(EIGEN_GPUCC) || defined(EIGEN_CONSTEXPR_ARE_DEVICE_FUNC))
1231
+ template<typename T>
1232
+ EIGEN_DEVICE_FUNC
1233
+ EIGEN_ALWAYS_INLINE T mini(const T& x, const T& y)
1234
+ {
1235
+ EIGEN_USING_STD(min)
1236
+ return min EIGEN_NOT_A_MACRO (x,y);
1237
+ }
1238
+
1239
+ template<typename T>
1240
+ EIGEN_DEVICE_FUNC
1241
+ EIGEN_ALWAYS_INLINE T maxi(const T& x, const T& y)
1242
+ {
1243
+ EIGEN_USING_STD(max)
1244
+ return max EIGEN_NOT_A_MACRO (x,y);
1245
+ }
1246
+ #else
1247
+ template<typename T>
1248
+ EIGEN_DEVICE_FUNC
1249
+ EIGEN_ALWAYS_INLINE T mini(const T& x, const T& y)
1250
+ {
1251
+ return y < x ? y : x;
1252
+ }
1253
+ template<>
1254
+ EIGEN_DEVICE_FUNC
1255
+ EIGEN_ALWAYS_INLINE float mini(const float& x, const float& y)
1256
+ {
1257
+ return fminf(x, y);
1258
+ }
1259
+ template<>
1260
+ EIGEN_DEVICE_FUNC
1261
+ EIGEN_ALWAYS_INLINE double mini(const double& x, const double& y)
1262
+ {
1263
+ return fmin(x, y);
1264
+ }
1265
+
1266
+ #ifndef EIGEN_GPU_COMPILE_PHASE
1267
+ template<>
1268
+ EIGEN_DEVICE_FUNC
1269
+ EIGEN_ALWAYS_INLINE long double mini(const long double& x, const long double& y)
1270
+ {
1271
+ #if defined(EIGEN_HIPCC)
1272
+ // no "fminl" on HIP yet
1273
+ return (x < y) ? x : y;
1274
+ #else
1275
+ return fminl(x, y);
1276
+ #endif
1277
+ }
1278
+ #endif
1279
+
1280
+ template<typename T>
1281
+ EIGEN_DEVICE_FUNC
1282
+ EIGEN_ALWAYS_INLINE T maxi(const T& x, const T& y)
1283
+ {
1284
+ return x < y ? y : x;
1285
+ }
1286
+ template<>
1287
+ EIGEN_DEVICE_FUNC
1288
+ EIGEN_ALWAYS_INLINE float maxi(const float& x, const float& y)
1289
+ {
1290
+ return fmaxf(x, y);
1291
+ }
1292
+ template<>
1293
+ EIGEN_DEVICE_FUNC
1294
+ EIGEN_ALWAYS_INLINE double maxi(const double& x, const double& y)
1295
+ {
1296
+ return fmax(x, y);
1297
+ }
1298
+ #ifndef EIGEN_GPU_COMPILE_PHASE
1299
+ template<>
1300
+ EIGEN_DEVICE_FUNC
1301
+ EIGEN_ALWAYS_INLINE long double maxi(const long double& x, const long double& y)
1302
+ {
1303
+ #if defined(EIGEN_HIPCC)
1304
+ // no "fmaxl" on HIP yet
1305
+ return (x > y) ? x : y;
1306
+ #else
1307
+ return fmaxl(x, y);
1308
+ #endif
1309
+ }
1310
+ #endif
1311
+ #endif
1312
+
1313
+ #if defined(SYCL_DEVICE_ONLY)
1314
+
1315
+
1316
+ #define SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
1317
+ SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_char) \
1318
+ SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_short) \
1319
+ SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_int) \
1320
+ SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_long)
1321
+ #define SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_UNARY(NAME, FUNC) \
1322
+ SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_char) \
1323
+ SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_short) \
1324
+ SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_int) \
1325
+ SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_long)
1326
+ #define SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
1327
+ SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_uchar) \
1328
+ SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_ushort) \
1329
+ SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_uint) \
1330
+ SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_ulong)
1331
+ #define SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_UNARY(NAME, FUNC) \
1332
+ SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_uchar) \
1333
+ SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_ushort) \
1334
+ SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_uint) \
1335
+ SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_ulong)
1336
+ #define SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(NAME, FUNC) \
1337
+ SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
1338
+ SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_BINARY(NAME, FUNC)
1339
+ #define SYCL_SPECIALIZE_INTEGER_TYPES_UNARY(NAME, FUNC) \
1340
+ SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_UNARY(NAME, FUNC) \
1341
+ SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_UNARY(NAME, FUNC)
1342
+ #define SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(NAME, FUNC) \
1343
+ SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_float) \
1344
+ SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC,cl::sycl::cl_double)
1345
+ #define SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(NAME, FUNC) \
1346
+ SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_float) \
1347
+ SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC,cl::sycl::cl_double)
1348
+ #define SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE(NAME, FUNC, RET_TYPE) \
1349
+ SYCL_SPECIALIZE_GEN_UNARY_FUNC(NAME, FUNC, RET_TYPE, cl::sycl::cl_float) \
1350
+ SYCL_SPECIALIZE_GEN_UNARY_FUNC(NAME, FUNC, RET_TYPE, cl::sycl::cl_double)
1351
+
1352
+ #define SYCL_SPECIALIZE_GEN_UNARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE) \
1353
+ template<> \
1354
+ EIGEN_DEVICE_FUNC \
1355
+ EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE& x) { \
1356
+ return cl::sycl::FUNC(x); \
1357
+ }
1358
+
1359
+ #define SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, TYPE) \
1360
+ SYCL_SPECIALIZE_GEN_UNARY_FUNC(NAME, FUNC, TYPE, TYPE)
1361
+
1362
+ #define SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE1, ARG_TYPE2) \
1363
+ template<> \
1364
+ EIGEN_DEVICE_FUNC \
1365
+ EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \
1366
+ return cl::sycl::FUNC(x, y); \
1367
+ }
1368
+
1369
+ #define SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE) \
1370
+ SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE)
1371
+
1372
+ #define SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, TYPE) \
1373
+ SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE)
1374
+
1375
+ SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min)
1376
+ SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(mini, fmin)
1377
+ SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(maxi, max)
1378
+ SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(maxi, fmax)
1379
+
1380
+ #endif
1381
+
1382
+
1383
+ template<typename Scalar>
1384
+ EIGEN_DEVICE_FUNC
1385
+ inline EIGEN_MATHFUNC_RETVAL(real, Scalar) real(const Scalar& x)
1386
+ {
1387
+ return EIGEN_MATHFUNC_IMPL(real, Scalar)::run(x);
1388
+ }
1389
+
1390
+ template<typename Scalar>
1391
+ EIGEN_DEVICE_FUNC
1392
+ inline typename internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar& x)
1393
+ {
1394
+ return internal::real_ref_impl<Scalar>::run(x);
1395
+ }
1396
+
1397
+ template<typename Scalar>
1398
+ EIGEN_DEVICE_FUNC
1399
+ inline EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) real_ref(Scalar& x)
1400
+ {
1401
+ return EIGEN_MATHFUNC_IMPL(real_ref, Scalar)::run(x);
1402
+ }
1403
+
1404
+ template<typename Scalar>
1405
+ EIGEN_DEVICE_FUNC
1406
+ inline EIGEN_MATHFUNC_RETVAL(imag, Scalar) imag(const Scalar& x)
1407
+ {
1408
+ return EIGEN_MATHFUNC_IMPL(imag, Scalar)::run(x);
1409
+ }
1410
+
1411
+ template<typename Scalar>
1412
+ EIGEN_DEVICE_FUNC
1413
+ inline EIGEN_MATHFUNC_RETVAL(arg, Scalar) arg(const Scalar& x)
1414
+ {
1415
+ return EIGEN_MATHFUNC_IMPL(arg, Scalar)::run(x);
1416
+ }
1417
+
1418
+ template<typename Scalar>
1419
+ EIGEN_DEVICE_FUNC
1420
+ inline typename internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) >::type imag_ref(const Scalar& x)
1421
+ {
1422
+ return internal::imag_ref_impl<Scalar>::run(x);
1423
+ }
1424
+
1425
+ template<typename Scalar>
1426
+ EIGEN_DEVICE_FUNC
1427
+ inline EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) imag_ref(Scalar& x)
1428
+ {
1429
+ return EIGEN_MATHFUNC_IMPL(imag_ref, Scalar)::run(x);
1430
+ }
1431
+
1432
+ template<typename Scalar>
1433
+ EIGEN_DEVICE_FUNC
1434
+ inline EIGEN_MATHFUNC_RETVAL(conj, Scalar) conj(const Scalar& x)
1435
+ {
1436
+ return EIGEN_MATHFUNC_IMPL(conj, Scalar)::run(x);
1437
+ }
1438
+
1439
+ template<typename Scalar>
1440
+ EIGEN_DEVICE_FUNC
1441
+ inline EIGEN_MATHFUNC_RETVAL(abs2, Scalar) abs2(const Scalar& x)
1442
+ {
1443
+ return EIGEN_MATHFUNC_IMPL(abs2, Scalar)::run(x);
1444
+ }
1445
+
1446
+ EIGEN_DEVICE_FUNC
1447
+ inline bool abs2(bool x) { return x; }
1448
+
1449
+ template<typename T>
1450
+ EIGEN_DEVICE_FUNC
1451
+ EIGEN_ALWAYS_INLINE T absdiff(const T& x, const T& y)
1452
+ {
1453
+ return x > y ? x - y : y - x;
1454
+ }
1455
+ template<>
1456
+ EIGEN_DEVICE_FUNC
1457
+ EIGEN_ALWAYS_INLINE float absdiff(const float& x, const float& y)
1458
+ {
1459
+ return fabsf(x - y);
1460
+ }
1461
+ template<>
1462
+ EIGEN_DEVICE_FUNC
1463
+ EIGEN_ALWAYS_INLINE double absdiff(const double& x, const double& y)
1464
+ {
1465
+ return fabs(x - y);
1466
+ }
1467
+
1468
+ // HIP and CUDA do not support long double.
1469
+ #ifndef EIGEN_GPU_COMPILE_PHASE
1470
+ template<>
1471
+ EIGEN_DEVICE_FUNC
1472
+ EIGEN_ALWAYS_INLINE long double absdiff(const long double& x, const long double& y) {
1473
+ return fabsl(x - y);
1474
+ }
1475
+ #endif
1476
+
1477
+ template<typename Scalar>
1478
+ EIGEN_DEVICE_FUNC
1479
+ inline EIGEN_MATHFUNC_RETVAL(norm1, Scalar) norm1(const Scalar& x)
1480
+ {
1481
+ return EIGEN_MATHFUNC_IMPL(norm1, Scalar)::run(x);
1482
+ }
1483
+
1484
+ template<typename Scalar>
1485
+ EIGEN_DEVICE_FUNC
1486
+ inline EIGEN_MATHFUNC_RETVAL(hypot, Scalar) hypot(const Scalar& x, const Scalar& y)
1487
+ {
1488
+ return EIGEN_MATHFUNC_IMPL(hypot, Scalar)::run(x, y);
1489
+ }
1490
+
1491
+ #if defined(SYCL_DEVICE_ONLY)
1492
+ SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(hypot, hypot)
1493
+ #endif
1494
+
1495
+ template<typename Scalar>
1496
+ EIGEN_DEVICE_FUNC
1497
+ inline EIGEN_MATHFUNC_RETVAL(log1p, Scalar) log1p(const Scalar& x)
1498
+ {
1499
+ return EIGEN_MATHFUNC_IMPL(log1p, Scalar)::run(x);
1500
+ }
1501
+
1502
+ #if defined(SYCL_DEVICE_ONLY)
1503
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(log1p, log1p)
1504
+ #endif
1505
+
1506
+ #if defined(EIGEN_GPUCC)
1507
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1508
+ float log1p(const float &x) { return ::log1pf(x); }
1509
+
1510
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1511
+ double log1p(const double &x) { return ::log1p(x); }
1512
+ #endif
1513
+
1514
+ template<typename ScalarX,typename ScalarY>
1515
+ EIGEN_DEVICE_FUNC
1516
+ inline typename internal::pow_impl<ScalarX,ScalarY>::result_type pow(const ScalarX& x, const ScalarY& y)
1517
+ {
1518
+ return internal::pow_impl<ScalarX,ScalarY>::run(x, y);
1519
+ }
1520
+
1521
+ #if defined(SYCL_DEVICE_ONLY)
1522
+ SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(pow, pow)
1523
+ #endif
1524
+
1525
+ template<typename T> EIGEN_DEVICE_FUNC bool (isnan) (const T &x) { return internal::isnan_impl(x); }
1526
+ template<typename T> EIGEN_DEVICE_FUNC bool (isinf) (const T &x) { return internal::isinf_impl(x); }
1527
+ template<typename T> EIGEN_DEVICE_FUNC bool (isfinite)(const T &x) { return internal::isfinite_impl(x); }
1528
+
1529
+ #if defined(SYCL_DEVICE_ONLY)
1530
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE(isnan, isnan, bool)
1531
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE(isinf, isinf, bool)
1532
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE(isfinite, isfinite, bool)
1533
+ #endif
1534
+
1535
+ template<typename Scalar>
1536
+ EIGEN_DEVICE_FUNC
1537
+ inline EIGEN_MATHFUNC_RETVAL(rint, Scalar) rint(const Scalar& x)
1538
+ {
1539
+ return EIGEN_MATHFUNC_IMPL(rint, Scalar)::run(x);
1540
+ }
1541
+
1542
+ template<typename Scalar>
1543
+ EIGEN_DEVICE_FUNC
1544
+ inline EIGEN_MATHFUNC_RETVAL(round, Scalar) round(const Scalar& x)
1545
+ {
1546
+ return EIGEN_MATHFUNC_IMPL(round, Scalar)::run(x);
1547
+ }
1548
+
1549
+ #if defined(SYCL_DEVICE_ONLY)
1550
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(round, round)
1551
+ #endif
1552
+
1553
+ template<typename T>
1554
+ EIGEN_DEVICE_FUNC
1555
+ T (floor)(const T& x)
1556
+ {
1557
+ EIGEN_USING_STD(floor)
1558
+ return floor(x);
1559
+ }
1560
+
1561
+ #if defined(SYCL_DEVICE_ONLY)
1562
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(floor, floor)
1563
+ #endif
1564
+
1565
+ #if defined(EIGEN_GPUCC)
1566
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1567
+ float floor(const float &x) { return ::floorf(x); }
1568
+
1569
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1570
+ double floor(const double &x) { return ::floor(x); }
1571
+ #endif
1572
+
1573
+ template<typename T>
1574
+ EIGEN_DEVICE_FUNC
1575
+ T (ceil)(const T& x)
1576
+ {
1577
+ EIGEN_USING_STD(ceil);
1578
+ return ceil(x);
1579
+ }
1580
+
1581
+ #if defined(SYCL_DEVICE_ONLY)
1582
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(ceil, ceil)
1583
+ #endif
1584
+
1585
+ #if defined(EIGEN_GPUCC)
1586
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1587
+ float ceil(const float &x) { return ::ceilf(x); }
1588
+
1589
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1590
+ double ceil(const double &x) { return ::ceil(x); }
1591
+ #endif
1592
+
1593
+
1594
+ /** Log base 2 for 32 bits positive integers.
1595
+ * Conveniently returns 0 for x==0. */
1596
+ inline int log2(int x)
1597
+ {
1598
+ eigen_assert(x>=0);
1599
+ unsigned int v(x);
1600
+ static const int table[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 };
1601
+ v |= v >> 1;
1602
+ v |= v >> 2;
1603
+ v |= v >> 4;
1604
+ v |= v >> 8;
1605
+ v |= v >> 16;
1606
+ return table[(v * 0x07C4ACDDU) >> 27];
1607
+ }
1608
+
1609
+ /** \returns the square root of \a x.
1610
+ *
1611
+ * It is essentially equivalent to
1612
+ * \code using std::sqrt; return sqrt(x); \endcode
1613
+ * but slightly faster for float/double and some compilers (e.g., gcc), thanks to
1614
+ * specializations when SSE is enabled.
1615
+ *
1616
+ * It's usage is justified in performance critical functions, like norm/normalize.
1617
+ */
1618
+ template<typename Scalar>
1619
+ EIGEN_DEVICE_FUNC
1620
+ EIGEN_ALWAYS_INLINE EIGEN_MATHFUNC_RETVAL(sqrt, Scalar) sqrt(const Scalar& x)
1621
+ {
1622
+ return EIGEN_MATHFUNC_IMPL(sqrt, Scalar)::run(x);
1623
+ }
1624
+
1625
+ // Boolean specialization, avoids implicit float to bool conversion (-Wimplicit-conversion-floating-point-to-bool).
1626
+ template<>
1627
+ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_DEVICE_FUNC
1628
+ bool sqrt<bool>(const bool &x) { return x; }
1629
+
1630
+ #if defined(SYCL_DEVICE_ONLY)
1631
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(sqrt, sqrt)
1632
+ #endif
1633
+
1634
+ /** \returns the reciprocal square root of \a x. **/
1635
+ template<typename T>
1636
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1637
+ T rsqrt(const T& x)
1638
+ {
1639
+ return internal::rsqrt_impl<T>::run(x);
1640
+ }
1641
+
1642
+ template<typename T>
1643
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1644
+ T log(const T &x) {
1645
+ return internal::log_impl<T>::run(x);
1646
+ }
1647
+
1648
+ #if defined(SYCL_DEVICE_ONLY)
1649
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(log, log)
1650
+ #endif
1651
+
1652
+
1653
+ #if defined(EIGEN_GPUCC)
1654
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1655
+ float log(const float &x) { return ::logf(x); }
1656
+
1657
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1658
+ double log(const double &x) { return ::log(x); }
1659
+ #endif
1660
+
1661
+ template<typename T>
1662
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1663
+ typename internal::enable_if<NumTraits<T>::IsSigned || NumTraits<T>::IsComplex,typename NumTraits<T>::Real>::type
1664
+ abs(const T &x) {
1665
+ EIGEN_USING_STD(abs);
1666
+ return abs(x);
1667
+ }
1668
+
1669
+ template<typename T>
1670
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1671
+ typename internal::enable_if<!(NumTraits<T>::IsSigned || NumTraits<T>::IsComplex),typename NumTraits<T>::Real>::type
1672
+ abs(const T &x) {
1673
+ return x;
1674
+ }
1675
+
1676
+ #if defined(SYCL_DEVICE_ONLY)
1677
+ SYCL_SPECIALIZE_INTEGER_TYPES_UNARY(abs, abs)
1678
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(abs, fabs)
1679
+ #endif
1680
+
1681
+ #if defined(EIGEN_GPUCC)
1682
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1683
+ float abs(const float &x) { return ::fabsf(x); }
1684
+
1685
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1686
+ double abs(const double &x) { return ::fabs(x); }
1687
+
1688
+ template <> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1689
+ float abs(const std::complex<float>& x) {
1690
+ return ::hypotf(x.real(), x.imag());
1691
+ }
1692
+
1693
+ template <> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1694
+ double abs(const std::complex<double>& x) {
1695
+ return ::hypot(x.real(), x.imag());
1696
+ }
1697
+ #endif
1698
+
1699
+ template<typename T>
1700
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1701
+ T exp(const T &x) {
1702
+ EIGEN_USING_STD(exp);
1703
+ return exp(x);
1704
+ }
1705
+
1706
+ #if defined(SYCL_DEVICE_ONLY)
1707
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(exp, exp)
1708
+ #endif
1709
+
1710
+ #if defined(EIGEN_GPUCC)
1711
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1712
+ float exp(const float &x) { return ::expf(x); }
1713
+
1714
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1715
+ double exp(const double &x) { return ::exp(x); }
1716
+
1717
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1718
+ std::complex<float> exp(const std::complex<float>& x) {
1719
+ float com = ::expf(x.real());
1720
+ float res_real = com * ::cosf(x.imag());
1721
+ float res_imag = com * ::sinf(x.imag());
1722
+ return std::complex<float>(res_real, res_imag);
1723
+ }
1724
+
1725
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1726
+ std::complex<double> exp(const std::complex<double>& x) {
1727
+ double com = ::exp(x.real());
1728
+ double res_real = com * ::cos(x.imag());
1729
+ double res_imag = com * ::sin(x.imag());
1730
+ return std::complex<double>(res_real, res_imag);
1731
+ }
1732
+ #endif
1733
+
1734
+ template<typename Scalar>
1735
+ EIGEN_DEVICE_FUNC
1736
+ inline EIGEN_MATHFUNC_RETVAL(expm1, Scalar) expm1(const Scalar& x)
1737
+ {
1738
+ return EIGEN_MATHFUNC_IMPL(expm1, Scalar)::run(x);
1739
+ }
1740
+
1741
+ #if defined(SYCL_DEVICE_ONLY)
1742
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(expm1, expm1)
1743
+ #endif
1744
+
1745
+ #if defined(EIGEN_GPUCC)
1746
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1747
+ float expm1(const float &x) { return ::expm1f(x); }
1748
+
1749
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1750
+ double expm1(const double &x) { return ::expm1(x); }
1751
+ #endif
1752
+
1753
+ template<typename T>
1754
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1755
+ T cos(const T &x) {
1756
+ EIGEN_USING_STD(cos);
1757
+ return cos(x);
1758
+ }
1759
+
1760
+ #if defined(SYCL_DEVICE_ONLY)
1761
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(cos,cos)
1762
+ #endif
1763
+
1764
+ #if defined(EIGEN_GPUCC)
1765
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1766
+ float cos(const float &x) { return ::cosf(x); }
1767
+
1768
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1769
+ double cos(const double &x) { return ::cos(x); }
1770
+ #endif
1771
+
1772
+ template<typename T>
1773
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1774
+ T sin(const T &x) {
1775
+ EIGEN_USING_STD(sin);
1776
+ return sin(x);
1777
+ }
1778
+
1779
+ #if defined(SYCL_DEVICE_ONLY)
1780
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(sin, sin)
1781
+ #endif
1782
+
1783
+ #if defined(EIGEN_GPUCC)
1784
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1785
+ float sin(const float &x) { return ::sinf(x); }
1786
+
1787
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1788
+ double sin(const double &x) { return ::sin(x); }
1789
+ #endif
1790
+
1791
+ template<typename T>
1792
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1793
+ T tan(const T &x) {
1794
+ EIGEN_USING_STD(tan);
1795
+ return tan(x);
1796
+ }
1797
+
1798
+ #if defined(SYCL_DEVICE_ONLY)
1799
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(tan, tan)
1800
+ #endif
1801
+
1802
+ #if defined(EIGEN_GPUCC)
1803
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1804
+ float tan(const float &x) { return ::tanf(x); }
1805
+
1806
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1807
+ double tan(const double &x) { return ::tan(x); }
1808
+ #endif
1809
+
1810
+ template<typename T>
1811
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1812
+ T acos(const T &x) {
1813
+ EIGEN_USING_STD(acos);
1814
+ return acos(x);
1815
+ }
1816
+
1817
+ #if EIGEN_HAS_CXX11_MATH
1818
+ template<typename T>
1819
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1820
+ T acosh(const T &x) {
1821
+ EIGEN_USING_STD(acosh);
1822
+ return static_cast<T>(acosh(x));
1823
+ }
1824
+ #endif
1825
+
1826
+ #if defined(SYCL_DEVICE_ONLY)
1827
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(acos, acos)
1828
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(acosh, acosh)
1829
+ #endif
1830
+
1831
+ #if defined(EIGEN_GPUCC)
1832
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1833
+ float acos(const float &x) { return ::acosf(x); }
1834
+
1835
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1836
+ double acos(const double &x) { return ::acos(x); }
1837
+ #endif
1838
+
1839
+ template<typename T>
1840
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1841
+ T asin(const T &x) {
1842
+ EIGEN_USING_STD(asin);
1843
+ return asin(x);
1844
+ }
1845
+
1846
+ #if EIGEN_HAS_CXX11_MATH
1847
+ template<typename T>
1848
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1849
+ T asinh(const T &x) {
1850
+ EIGEN_USING_STD(asinh);
1851
+ return static_cast<T>(asinh(x));
1852
+ }
1853
+ #endif
1854
+
1855
+ #if defined(SYCL_DEVICE_ONLY)
1856
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(asin, asin)
1857
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(asinh, asinh)
1858
+ #endif
1859
+
1860
+ #if defined(EIGEN_GPUCC)
1861
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1862
+ float asin(const float &x) { return ::asinf(x); }
1863
+
1864
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1865
+ double asin(const double &x) { return ::asin(x); }
1866
+ #endif
1867
+
1868
+ template<typename T>
1869
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1870
+ T atan(const T &x) {
1871
+ EIGEN_USING_STD(atan);
1872
+ return static_cast<T>(atan(x));
1873
+ }
1874
+
1875
+ #if EIGEN_HAS_CXX11_MATH
1876
+ template<typename T>
1877
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1878
+ T atanh(const T &x) {
1879
+ EIGEN_USING_STD(atanh);
1880
+ return static_cast<T>(atanh(x));
1881
+ }
1882
+ #endif
1883
+
1884
+ #if defined(SYCL_DEVICE_ONLY)
1885
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(atan, atan)
1886
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(atanh, atanh)
1887
+ #endif
1888
+
1889
+ #if defined(EIGEN_GPUCC)
1890
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1891
+ float atan(const float &x) { return ::atanf(x); }
1892
+
1893
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1894
+ double atan(const double &x) { return ::atan(x); }
1895
+ #endif
1896
+
1897
+
1898
+ template<typename T>
1899
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1900
+ T cosh(const T &x) {
1901
+ EIGEN_USING_STD(cosh);
1902
+ return static_cast<T>(cosh(x));
1903
+ }
1904
+
1905
+ #if defined(SYCL_DEVICE_ONLY)
1906
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(cosh, cosh)
1907
+ #endif
1908
+
1909
+ #if defined(EIGEN_GPUCC)
1910
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1911
+ float cosh(const float &x) { return ::coshf(x); }
1912
+
1913
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1914
+ double cosh(const double &x) { return ::cosh(x); }
1915
+ #endif
1916
+
1917
+ template<typename T>
1918
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1919
+ T sinh(const T &x) {
1920
+ EIGEN_USING_STD(sinh);
1921
+ return static_cast<T>(sinh(x));
1922
+ }
1923
+
1924
+ #if defined(SYCL_DEVICE_ONLY)
1925
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(sinh, sinh)
1926
+ #endif
1927
+
1928
+ #if defined(EIGEN_GPUCC)
1929
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1930
+ float sinh(const float &x) { return ::sinhf(x); }
1931
+
1932
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1933
+ double sinh(const double &x) { return ::sinh(x); }
1934
+ #endif
1935
+
1936
+ template<typename T>
1937
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1938
+ T tanh(const T &x) {
1939
+ EIGEN_USING_STD(tanh);
1940
+ return tanh(x);
1941
+ }
1942
+
1943
+ #if (!defined(EIGEN_GPUCC)) && EIGEN_FAST_MATH && !defined(SYCL_DEVICE_ONLY)
1944
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1945
+ float tanh(float x) { return internal::generic_fast_tanh_float(x); }
1946
+ #endif
1947
+
1948
+ #if defined(SYCL_DEVICE_ONLY)
1949
+ SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(tanh, tanh)
1950
+ #endif
1951
+
1952
+ #if defined(EIGEN_GPUCC)
1953
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1954
+ float tanh(const float &x) { return ::tanhf(x); }
1955
+
1956
+ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1957
+ double tanh(const double &x) { return ::tanh(x); }
1958
+ #endif
1959
+
1960
+ template <typename T>
1961
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1962
+ T fmod(const T& a, const T& b) {
1963
+ EIGEN_USING_STD(fmod);
1964
+ return fmod(a, b);
1965
+ }
1966
+
1967
+ #if defined(SYCL_DEVICE_ONLY)
1968
+ SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(fmod, fmod)
1969
+ #endif
1970
+
1971
+ #if defined(EIGEN_GPUCC)
1972
+ template <>
1973
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1974
+ float fmod(const float& a, const float& b) {
1975
+ return ::fmodf(a, b);
1976
+ }
1977
+
1978
+ template <>
1979
+ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
1980
+ double fmod(const double& a, const double& b) {
1981
+ return ::fmod(a, b);
1982
+ }
1983
+ #endif
1984
+
1985
+ #if defined(SYCL_DEVICE_ONLY)
1986
+ #undef SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY
1987
+ #undef SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_UNARY
1988
+ #undef SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_BINARY
1989
+ #undef SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_UNARY
1990
+ #undef SYCL_SPECIALIZE_INTEGER_TYPES_BINARY
1991
+ #undef SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_UNARY
1992
+ #undef SYCL_SPECIALIZE_FLOATING_TYPES_BINARY
1993
+ #undef SYCL_SPECIALIZE_FLOATING_TYPES_UNARY
1994
+ #undef SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE
1995
+ #undef SYCL_SPECIALIZE_GEN_UNARY_FUNC
1996
+ #undef SYCL_SPECIALIZE_UNARY_FUNC
1997
+ #undef SYCL_SPECIALIZE_GEN1_BINARY_FUNC
1998
+ #undef SYCL_SPECIALIZE_GEN2_BINARY_FUNC
1999
+ #undef SYCL_SPECIALIZE_BINARY_FUNC
2000
+ #endif
2001
+
2002
+ } // end namespace numext
2003
+
2004
+ namespace internal {
2005
+
2006
+ template<typename T>
2007
+ EIGEN_DEVICE_FUNC bool isfinite_impl(const std::complex<T>& x)
2008
+ {
2009
+ return (numext::isfinite)(numext::real(x)) && (numext::isfinite)(numext::imag(x));
2010
+ }
2011
+
2012
+ template<typename T>
2013
+ EIGEN_DEVICE_FUNC bool isnan_impl(const std::complex<T>& x)
2014
+ {
2015
+ return (numext::isnan)(numext::real(x)) || (numext::isnan)(numext::imag(x));
2016
+ }
2017
+
2018
+ template<typename T>
2019
+ EIGEN_DEVICE_FUNC bool isinf_impl(const std::complex<T>& x)
2020
+ {
2021
+ return ((numext::isinf)(numext::real(x)) || (numext::isinf)(numext::imag(x))) && (!(numext::isnan)(x));
2022
+ }
2023
+
2024
+ /****************************************************************************
2025
+ * Implementation of fuzzy comparisons *
2026
+ ****************************************************************************/
2027
+
2028
+ template<typename Scalar,
2029
+ bool IsComplex,
2030
+ bool IsInteger>
2031
+ struct scalar_fuzzy_default_impl {};
2032
+
2033
+ template<typename Scalar>
2034
+ struct scalar_fuzzy_default_impl<Scalar, false, false>
2035
+ {
2036
+ typedef typename NumTraits<Scalar>::Real RealScalar;
2037
+ template<typename OtherScalar> EIGEN_DEVICE_FUNC
2038
+ static inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y, const RealScalar& prec)
2039
+ {
2040
+ return numext::abs(x) <= numext::abs(y) * prec;
2041
+ }
2042
+ EIGEN_DEVICE_FUNC
2043
+ static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar& prec)
2044
+ {
2045
+ return numext::abs(x - y) <= numext::mini(numext::abs(x), numext::abs(y)) * prec;
2046
+ }
2047
+ EIGEN_DEVICE_FUNC
2048
+ static inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, const RealScalar& prec)
2049
+ {
2050
+ return x <= y || isApprox(x, y, prec);
2051
+ }
2052
+ };
2053
+
2054
+ template<typename Scalar>
2055
+ struct scalar_fuzzy_default_impl<Scalar, false, true>
2056
+ {
2057
+ typedef typename NumTraits<Scalar>::Real RealScalar;
2058
+ template<typename OtherScalar> EIGEN_DEVICE_FUNC
2059
+ static inline bool isMuchSmallerThan(const Scalar& x, const Scalar&, const RealScalar&)
2060
+ {
2061
+ return x == Scalar(0);
2062
+ }
2063
+ EIGEN_DEVICE_FUNC
2064
+ static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar&)
2065
+ {
2066
+ return x == y;
2067
+ }
2068
+ EIGEN_DEVICE_FUNC
2069
+ static inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, const RealScalar&)
2070
+ {
2071
+ return x <= y;
2072
+ }
2073
+ };
2074
+
2075
+ template<typename Scalar>
2076
+ struct scalar_fuzzy_default_impl<Scalar, true, false>
2077
+ {
2078
+ typedef typename NumTraits<Scalar>::Real RealScalar;
2079
+ template<typename OtherScalar> EIGEN_DEVICE_FUNC
2080
+ static inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y, const RealScalar& prec)
2081
+ {
2082
+ return numext::abs2(x) <= numext::abs2(y) * prec * prec;
2083
+ }
2084
+ EIGEN_DEVICE_FUNC
2085
+ static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar& prec)
2086
+ {
2087
+ return numext::abs2(x - y) <= numext::mini(numext::abs2(x), numext::abs2(y)) * prec * prec;
2088
+ }
2089
+ };
2090
+
2091
+ template<typename Scalar>
2092
+ struct scalar_fuzzy_impl : scalar_fuzzy_default_impl<Scalar, NumTraits<Scalar>::IsComplex, NumTraits<Scalar>::IsInteger> {};
2093
+
2094
+ template<typename Scalar, typename OtherScalar> EIGEN_DEVICE_FUNC
2095
+ inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y,
2096
+ const typename NumTraits<Scalar>::Real &precision = NumTraits<Scalar>::dummy_precision())
2097
+ {
2098
+ return scalar_fuzzy_impl<Scalar>::template isMuchSmallerThan<OtherScalar>(x, y, precision);
2099
+ }
2100
+
2101
+ template<typename Scalar> EIGEN_DEVICE_FUNC
2102
+ inline bool isApprox(const Scalar& x, const Scalar& y,
2103
+ const typename NumTraits<Scalar>::Real &precision = NumTraits<Scalar>::dummy_precision())
2104
+ {
2105
+ return scalar_fuzzy_impl<Scalar>::isApprox(x, y, precision);
2106
+ }
2107
+
2108
+ template<typename Scalar> EIGEN_DEVICE_FUNC
2109
+ inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y,
2110
+ const typename NumTraits<Scalar>::Real &precision = NumTraits<Scalar>::dummy_precision())
2111
+ {
2112
+ return scalar_fuzzy_impl<Scalar>::isApproxOrLessThan(x, y, precision);
2113
+ }
2114
+
2115
+ /******************************************
2116
+ *** The special case of the bool type ***
2117
+ ******************************************/
2118
+
2119
+ template<> struct random_impl<bool>
2120
+ {
2121
+ static inline bool run()
2122
+ {
2123
+ return random<int>(0,1)==0 ? false : true;
2124
+ }
2125
+
2126
+ static inline bool run(const bool& a, const bool& b)
2127
+ {
2128
+ return random<int>(a, b)==0 ? false : true;
2129
+ }
2130
+ };
2131
+
2132
+ template<> struct scalar_fuzzy_impl<bool>
2133
+ {
2134
+ typedef bool RealScalar;
2135
+
2136
+ template<typename OtherScalar> EIGEN_DEVICE_FUNC
2137
+ static inline bool isMuchSmallerThan(const bool& x, const bool&, const bool&)
2138
+ {
2139
+ return !x;
2140
+ }
2141
+
2142
+ EIGEN_DEVICE_FUNC
2143
+ static inline bool isApprox(bool x, bool y, bool)
2144
+ {
2145
+ return x == y;
2146
+ }
2147
+
2148
+ EIGEN_DEVICE_FUNC
2149
+ static inline bool isApproxOrLessThan(const bool& x, const bool& y, const bool&)
2150
+ {
2151
+ return (!x) || y;
2152
+ }
2153
+
2154
+ };
2155
+
2156
+ } // end namespace internal
2157
+
2158
+ // Default implementations that rely on other numext implementations
2159
+ namespace internal {
2160
+
2161
+ // Specialization for complex types that are not supported by std::expm1.
2162
+ template <typename RealScalar>
2163
+ struct expm1_impl<std::complex<RealScalar> > {
2164
+ EIGEN_DEVICE_FUNC static inline std::complex<RealScalar> run(
2165
+ const std::complex<RealScalar>& x) {
2166
+ EIGEN_STATIC_ASSERT_NON_INTEGER(RealScalar)
2167
+ RealScalar xr = x.real();
2168
+ RealScalar xi = x.imag();
2169
+ // expm1(z) = exp(z) - 1
2170
+ // = exp(x + i * y) - 1
2171
+ // = exp(x) * (cos(y) + i * sin(y)) - 1
2172
+ // = exp(x) * cos(y) - 1 + i * exp(x) * sin(y)
2173
+ // Imag(expm1(z)) = exp(x) * sin(y)
2174
+ // Real(expm1(z)) = exp(x) * cos(y) - 1
2175
+ // = exp(x) * cos(y) - 1.
2176
+ // = expm1(x) + exp(x) * (cos(y) - 1)
2177
+ // = expm1(x) + exp(x) * (2 * sin(y / 2) ** 2)
2178
+ RealScalar erm1 = numext::expm1<RealScalar>(xr);
2179
+ RealScalar er = erm1 + RealScalar(1.);
2180
+ RealScalar sin2 = numext::sin(xi / RealScalar(2.));
2181
+ sin2 = sin2 * sin2;
2182
+ RealScalar s = numext::sin(xi);
2183
+ RealScalar real_part = erm1 - RealScalar(2.) * er * sin2;
2184
+ return std::complex<RealScalar>(real_part, er * s);
2185
+ }
2186
+ };
2187
+
2188
+ template<typename T>
2189
+ struct rsqrt_impl {
2190
+ EIGEN_DEVICE_FUNC
2191
+ static EIGEN_ALWAYS_INLINE T run(const T& x) {
2192
+ return T(1)/numext::sqrt(x);
2193
+ }
2194
+ };
2195
+
2196
+ #if defined(EIGEN_GPU_COMPILE_PHASE)
2197
+ template<typename T>
2198
+ struct conj_impl<std::complex<T>, true>
2199
+ {
2200
+ EIGEN_DEVICE_FUNC
2201
+ static inline std::complex<T> run(const std::complex<T>& x)
2202
+ {
2203
+ return std::complex<T>(numext::real(x), -numext::imag(x));
2204
+ }
2205
+ };
2206
+ #endif
2207
+
2208
+ } // end namespace internal
2209
+
2210
+ } // end namespace Eigen
2211
+
2212
+ #endif // EIGEN_MATHFUNCTIONS_H