@smake/eigen 1.1.0 → 1.1.1

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 (431) hide show
  1. package/README.md +1 -1
  2. package/eigen/Eigen/AccelerateSupport +52 -0
  3. package/eigen/Eigen/Cholesky +18 -20
  4. package/eigen/Eigen/CholmodSupport +28 -28
  5. package/eigen/Eigen/Core +187 -120
  6. package/eigen/Eigen/Eigenvalues +16 -13
  7. package/eigen/Eigen/Geometry +18 -18
  8. package/eigen/Eigen/Householder +9 -7
  9. package/eigen/Eigen/IterativeLinearSolvers +8 -4
  10. package/eigen/Eigen/Jacobi +14 -13
  11. package/eigen/Eigen/KLUSupport +23 -21
  12. package/eigen/Eigen/LU +15 -16
  13. package/eigen/Eigen/MetisSupport +12 -12
  14. package/eigen/Eigen/OrderingMethods +54 -51
  15. package/eigen/Eigen/PaStiXSupport +23 -21
  16. package/eigen/Eigen/PardisoSupport +17 -14
  17. package/eigen/Eigen/QR +18 -20
  18. package/eigen/Eigen/QtAlignedMalloc +5 -12
  19. package/eigen/Eigen/SPQRSupport +21 -14
  20. package/eigen/Eigen/SVD +23 -17
  21. package/eigen/Eigen/Sparse +1 -2
  22. package/eigen/Eigen/SparseCholesky +18 -15
  23. package/eigen/Eigen/SparseCore +18 -17
  24. package/eigen/Eigen/SparseLU +9 -9
  25. package/eigen/Eigen/SparseQR +16 -14
  26. package/eigen/Eigen/StdDeque +5 -2
  27. package/eigen/Eigen/StdList +5 -2
  28. package/eigen/Eigen/StdVector +5 -2
  29. package/eigen/Eigen/SuperLUSupport +30 -24
  30. package/eigen/Eigen/ThreadPool +80 -0
  31. package/eigen/Eigen/UmfPackSupport +19 -17
  32. package/eigen/Eigen/Version +14 -0
  33. package/eigen/Eigen/src/AccelerateSupport/AccelerateSupport.h +423 -0
  34. package/eigen/Eigen/src/AccelerateSupport/InternalHeaderCheck.h +3 -0
  35. package/eigen/Eigen/src/Cholesky/InternalHeaderCheck.h +3 -0
  36. package/eigen/Eigen/src/Cholesky/LDLT.h +366 -405
  37. package/eigen/Eigen/src/Cholesky/LLT.h +323 -367
  38. package/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h +81 -56
  39. package/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +585 -529
  40. package/eigen/Eigen/src/CholmodSupport/InternalHeaderCheck.h +3 -0
  41. package/eigen/Eigen/src/Core/ArithmeticSequence.h +143 -317
  42. package/eigen/Eigen/src/Core/Array.h +329 -370
  43. package/eigen/Eigen/src/Core/ArrayBase.h +190 -203
  44. package/eigen/Eigen/src/Core/ArrayWrapper.h +126 -170
  45. package/eigen/Eigen/src/Core/Assign.h +30 -40
  46. package/eigen/Eigen/src/Core/AssignEvaluator.h +651 -604
  47. package/eigen/Eigen/src/Core/Assign_MKL.h +125 -120
  48. package/eigen/Eigen/src/Core/BandMatrix.h +267 -282
  49. package/eigen/Eigen/src/Core/Block.h +371 -390
  50. package/eigen/Eigen/src/Core/CommaInitializer.h +85 -100
  51. package/eigen/Eigen/src/Core/ConditionEstimator.h +51 -53
  52. package/eigen/Eigen/src/Core/CoreEvaluators.h +1214 -937
  53. package/eigen/Eigen/src/Core/CoreIterators.h +72 -63
  54. package/eigen/Eigen/src/Core/CwiseBinaryOp.h +112 -129
  55. package/eigen/Eigen/src/Core/CwiseNullaryOp.h +676 -702
  56. package/eigen/Eigen/src/Core/CwiseTernaryOp.h +77 -103
  57. package/eigen/Eigen/src/Core/CwiseUnaryOp.h +55 -67
  58. package/eigen/Eigen/src/Core/CwiseUnaryView.h +127 -92
  59. package/eigen/Eigen/src/Core/DenseBase.h +630 -658
  60. package/eigen/Eigen/src/Core/DenseCoeffsBase.h +511 -628
  61. package/eigen/Eigen/src/Core/DenseStorage.h +511 -590
  62. package/eigen/Eigen/src/Core/DeviceWrapper.h +153 -0
  63. package/eigen/Eigen/src/Core/Diagonal.h +168 -207
  64. package/eigen/Eigen/src/Core/DiagonalMatrix.h +346 -317
  65. package/eigen/Eigen/src/Core/DiagonalProduct.h +12 -10
  66. package/eigen/Eigen/src/Core/Dot.h +167 -217
  67. package/eigen/Eigen/src/Core/EigenBase.h +74 -85
  68. package/eigen/Eigen/src/Core/Fill.h +138 -0
  69. package/eigen/Eigen/src/Core/FindCoeff.h +464 -0
  70. package/eigen/Eigen/src/Core/ForceAlignedAccess.h +90 -113
  71. package/eigen/Eigen/src/Core/Fuzzy.h +82 -105
  72. package/eigen/Eigen/src/Core/GeneralProduct.h +315 -261
  73. package/eigen/Eigen/src/Core/GenericPacketMath.h +1182 -520
  74. package/eigen/Eigen/src/Core/GlobalFunctions.h +193 -157
  75. package/eigen/Eigen/src/Core/IO.h +131 -156
  76. package/eigen/Eigen/src/Core/IndexedView.h +209 -125
  77. package/eigen/Eigen/src/Core/InnerProduct.h +260 -0
  78. package/eigen/Eigen/src/Core/InternalHeaderCheck.h +3 -0
  79. package/eigen/Eigen/src/Core/Inverse.h +50 -59
  80. package/eigen/Eigen/src/Core/Map.h +123 -141
  81. package/eigen/Eigen/src/Core/MapBase.h +255 -282
  82. package/eigen/Eigen/src/Core/MathFunctions.h +1247 -1201
  83. package/eigen/Eigen/src/Core/MathFunctionsImpl.h +162 -99
  84. package/eigen/Eigen/src/Core/Matrix.h +463 -494
  85. package/eigen/Eigen/src/Core/MatrixBase.h +468 -470
  86. package/eigen/Eigen/src/Core/NestByValue.h +58 -52
  87. package/eigen/Eigen/src/Core/NoAlias.h +79 -86
  88. package/eigen/Eigen/src/Core/NumTraits.h +206 -206
  89. package/eigen/Eigen/src/Core/PartialReduxEvaluator.h +163 -142
  90. package/eigen/Eigen/src/Core/PermutationMatrix.h +461 -511
  91. package/eigen/Eigen/src/Core/PlainObjectBase.h +858 -972
  92. package/eigen/Eigen/src/Core/Product.h +246 -130
  93. package/eigen/Eigen/src/Core/ProductEvaluators.h +779 -671
  94. package/eigen/Eigen/src/Core/Random.h +153 -164
  95. package/eigen/Eigen/src/Core/RandomImpl.h +262 -0
  96. package/eigen/Eigen/src/Core/RealView.h +250 -0
  97. package/eigen/Eigen/src/Core/Redux.h +334 -314
  98. package/eigen/Eigen/src/Core/Ref.h +259 -257
  99. package/eigen/Eigen/src/Core/Replicate.h +92 -104
  100. package/eigen/Eigen/src/Core/Reshaped.h +215 -271
  101. package/eigen/Eigen/src/Core/ReturnByValue.h +47 -55
  102. package/eigen/Eigen/src/Core/Reverse.h +133 -148
  103. package/eigen/Eigen/src/Core/Select.h +68 -140
  104. package/eigen/Eigen/src/Core/SelfAdjointView.h +254 -290
  105. package/eigen/Eigen/src/Core/SelfCwiseBinaryOp.h +23 -20
  106. package/eigen/Eigen/src/Core/SkewSymmetricMatrix3.h +382 -0
  107. package/eigen/Eigen/src/Core/Solve.h +88 -102
  108. package/eigen/Eigen/src/Core/SolveTriangular.h +126 -124
  109. package/eigen/Eigen/src/Core/SolverBase.h +132 -133
  110. package/eigen/Eigen/src/Core/StableNorm.h +113 -147
  111. package/eigen/Eigen/src/Core/StlIterators.h +404 -248
  112. package/eigen/Eigen/src/Core/Stride.h +90 -92
  113. package/eigen/Eigen/src/Core/Swap.h +70 -39
  114. package/eigen/Eigen/src/Core/Transpose.h +258 -295
  115. package/eigen/Eigen/src/Core/Transpositions.h +270 -333
  116. package/eigen/Eigen/src/Core/TriangularMatrix.h +642 -743
  117. package/eigen/Eigen/src/Core/VectorBlock.h +59 -72
  118. package/eigen/Eigen/src/Core/VectorwiseOp.h +653 -704
  119. package/eigen/Eigen/src/Core/Visitor.h +464 -308
  120. package/eigen/Eigen/src/Core/arch/AVX/Complex.h +380 -187
  121. package/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +65 -163
  122. package/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +2145 -638
  123. package/eigen/Eigen/src/Core/arch/AVX/Reductions.h +353 -0
  124. package/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +253 -60
  125. package/eigen/Eigen/src/Core/arch/AVX512/Complex.h +278 -228
  126. package/eigen/Eigen/src/Core/arch/AVX512/GemmKernel.h +1245 -0
  127. package/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +48 -269
  128. package/eigen/Eigen/src/Core/arch/AVX512/MathFunctionsFP16.h +75 -0
  129. package/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1597 -754
  130. package/eigen/Eigen/src/Core/arch/AVX512/PacketMathFP16.h +1413 -0
  131. package/eigen/Eigen/src/Core/arch/AVX512/Reductions.h +297 -0
  132. package/eigen/Eigen/src/Core/arch/AVX512/TrsmKernel.h +1167 -0
  133. package/eigen/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc +1219 -0
  134. package/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +229 -41
  135. package/eigen/Eigen/src/Core/arch/AVX512/TypeCastingFP16.h +130 -0
  136. package/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +420 -184
  137. package/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +40 -49
  138. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2962 -2213
  139. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +196 -212
  140. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +713 -441
  141. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h +742 -0
  142. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.inc +2818 -0
  143. package/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +2380 -1362
  144. package/eigen/Eigen/src/Core/arch/AltiVec/TypeCasting.h +153 -0
  145. package/eigen/Eigen/src/Core/arch/Default/BFloat16.h +390 -224
  146. package/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +78 -67
  147. package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1784 -799
  148. package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +167 -50
  149. package/eigen/Eigen/src/Core/arch/Default/Half.h +528 -379
  150. package/eigen/Eigen/src/Core/arch/Default/Settings.h +10 -12
  151. package/eigen/Eigen/src/Core/arch/GPU/Complex.h +244 -0
  152. package/eigen/Eigen/src/Core/arch/GPU/MathFunctions.h +41 -40
  153. package/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +550 -523
  154. package/eigen/Eigen/src/Core/arch/GPU/Tuple.h +268 -0
  155. package/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +27 -30
  156. package/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +8 -8
  157. package/eigen/Eigen/src/Core/arch/HVX/PacketMath.h +1088 -0
  158. package/eigen/Eigen/src/Core/arch/LSX/Complex.h +520 -0
  159. package/eigen/Eigen/src/Core/arch/LSX/GeneralBlockPanelKernel.h +23 -0
  160. package/eigen/Eigen/src/Core/arch/LSX/MathFunctions.h +43 -0
  161. package/eigen/Eigen/src/Core/arch/LSX/PacketMath.h +2866 -0
  162. package/eigen/Eigen/src/Core/arch/LSX/TypeCasting.h +526 -0
  163. package/eigen/Eigen/src/Core/arch/MSA/Complex.h +54 -82
  164. package/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +84 -92
  165. package/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +51 -47
  166. package/eigen/Eigen/src/Core/arch/NEON/Complex.h +454 -306
  167. package/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +175 -115
  168. package/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +23 -30
  169. package/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +4366 -2857
  170. package/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +616 -393
  171. package/eigen/Eigen/src/Core/arch/NEON/UnaryFunctors.h +57 -0
  172. package/eigen/Eigen/src/Core/arch/SSE/Complex.h +350 -198
  173. package/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +38 -149
  174. package/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +1791 -912
  175. package/eigen/Eigen/src/Core/arch/SSE/Reductions.h +324 -0
  176. package/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +128 -40
  177. package/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +10 -6
  178. package/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +156 -234
  179. package/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +6 -3
  180. package/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +27 -32
  181. package/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +119 -117
  182. package/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +325 -419
  183. package/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +15 -17
  184. package/eigen/Eigen/src/Core/arch/ZVector/Complex.h +325 -181
  185. package/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +94 -83
  186. package/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +811 -458
  187. package/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +121 -124
  188. package/eigen/Eigen/src/Core/functors/BinaryFunctors.h +576 -370
  189. package/eigen/Eigen/src/Core/functors/NullaryFunctors.h +194 -109
  190. package/eigen/Eigen/src/Core/functors/StlFunctors.h +95 -112
  191. package/eigen/Eigen/src/Core/functors/TernaryFunctors.h +34 -7
  192. package/eigen/Eigen/src/Core/functors/UnaryFunctors.h +1038 -749
  193. package/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1883 -1375
  194. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +312 -370
  195. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +189 -176
  196. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +84 -81
  197. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +154 -73
  198. package/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +292 -337
  199. package/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +80 -77
  200. package/eigen/Eigen/src/Core/products/Parallelizer.h +207 -105
  201. package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +327 -388
  202. package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +206 -224
  203. package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +138 -147
  204. package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +58 -61
  205. package/eigen/Eigen/src/Core/products/SelfadjointProduct.h +71 -71
  206. package/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +48 -47
  207. package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +294 -369
  208. package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +246 -238
  209. package/eigen/Eigen/src/Core/products/TriangularMatrixVector.h +244 -247
  210. package/eigen/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +212 -192
  211. package/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +328 -277
  212. package/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +108 -109
  213. package/eigen/Eigen/src/Core/products/TriangularSolverVector.h +68 -94
  214. package/eigen/Eigen/src/Core/util/Assert.h +158 -0
  215. package/eigen/Eigen/src/Core/util/BlasUtil.h +342 -303
  216. package/eigen/Eigen/src/Core/util/ConfigureVectorization.h +348 -317
  217. package/eigen/Eigen/src/Core/util/Constants.h +297 -262
  218. package/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +130 -90
  219. package/eigen/Eigen/src/Core/util/EmulateArray.h +270 -0
  220. package/eigen/Eigen/src/Core/util/ForwardDeclarations.h +449 -247
  221. package/eigen/Eigen/src/Core/util/GpuHipCudaDefines.inc +101 -0
  222. package/eigen/Eigen/src/Core/util/GpuHipCudaUndefines.inc +45 -0
  223. package/eigen/Eigen/src/Core/util/IndexedViewHelper.h +417 -116
  224. package/eigen/Eigen/src/Core/util/IntegralConstant.h +211 -204
  225. package/eigen/Eigen/src/Core/util/MKL_support.h +39 -37
  226. package/eigen/Eigen/src/Core/util/Macros.h +655 -773
  227. package/eigen/Eigen/src/Core/util/MaxSizeVector.h +139 -0
  228. package/eigen/Eigen/src/Core/util/Memory.h +970 -748
  229. package/eigen/Eigen/src/Core/util/Meta.h +581 -633
  230. package/eigen/Eigen/src/Core/util/MoreMeta.h +638 -0
  231. package/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +32 -19
  232. package/eigen/Eigen/src/Core/util/ReshapedHelper.h +17 -17
  233. package/eigen/Eigen/src/Core/util/Serializer.h +209 -0
  234. package/eigen/Eigen/src/Core/util/StaticAssert.h +50 -166
  235. package/eigen/Eigen/src/Core/util/SymbolicIndex.h +377 -225
  236. package/eigen/Eigen/src/Core/util/XprHelper.h +784 -547
  237. package/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +246 -277
  238. package/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +299 -319
  239. package/eigen/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +52 -48
  240. package/eigen/Eigen/src/Eigenvalues/EigenSolver.h +413 -456
  241. package/eigen/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +309 -325
  242. package/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +157 -171
  243. package/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +292 -310
  244. package/eigen/Eigen/src/Eigenvalues/InternalHeaderCheck.h +3 -0
  245. package/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +89 -105
  246. package/eigen/Eigen/src/Eigenvalues/RealQZ.h +537 -607
  247. package/eigen/Eigen/src/Eigenvalues/RealSchur.h +342 -381
  248. package/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +41 -35
  249. package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +541 -595
  250. package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +47 -44
  251. package/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +430 -462
  252. package/eigen/Eigen/src/Geometry/AlignedBox.h +226 -227
  253. package/eigen/Eigen/src/Geometry/AngleAxis.h +131 -133
  254. package/eigen/Eigen/src/Geometry/EulerAngles.h +163 -74
  255. package/eigen/Eigen/src/Geometry/Homogeneous.h +285 -333
  256. package/eigen/Eigen/src/Geometry/Hyperplane.h +151 -160
  257. package/eigen/Eigen/src/Geometry/InternalHeaderCheck.h +3 -0
  258. package/eigen/Eigen/src/Geometry/OrthoMethods.h +168 -146
  259. package/eigen/Eigen/src/Geometry/ParametrizedLine.h +127 -127
  260. package/eigen/Eigen/src/Geometry/Quaternion.h +566 -506
  261. package/eigen/Eigen/src/Geometry/Rotation2D.h +107 -105
  262. package/eigen/Eigen/src/Geometry/RotationBase.h +148 -145
  263. package/eigen/Eigen/src/Geometry/Scaling.h +113 -106
  264. package/eigen/Eigen/src/Geometry/Transform.h +858 -936
  265. package/eigen/Eigen/src/Geometry/Translation.h +94 -92
  266. package/eigen/Eigen/src/Geometry/Umeyama.h +79 -84
  267. package/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +90 -104
  268. package/eigen/Eigen/src/Householder/BlockHouseholder.h +51 -46
  269. package/eigen/Eigen/src/Householder/Householder.h +102 -124
  270. package/eigen/Eigen/src/Householder/HouseholderSequence.h +412 -453
  271. package/eigen/Eigen/src/Householder/InternalHeaderCheck.h +3 -0
  272. package/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +149 -162
  273. package/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +124 -119
  274. package/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +92 -104
  275. package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +251 -243
  276. package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +224 -228
  277. package/eigen/Eigen/src/IterativeLinearSolvers/InternalHeaderCheck.h +3 -0
  278. package/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +178 -227
  279. package/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +79 -84
  280. package/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +54 -60
  281. package/eigen/Eigen/src/Jacobi/InternalHeaderCheck.h +3 -0
  282. package/eigen/Eigen/src/Jacobi/Jacobi.h +252 -308
  283. package/eigen/Eigen/src/KLUSupport/InternalHeaderCheck.h +3 -0
  284. package/eigen/Eigen/src/KLUSupport/KLUSupport.h +208 -227
  285. package/eigen/Eigen/src/LU/Determinant.h +50 -69
  286. package/eigen/Eigen/src/LU/FullPivLU.h +545 -596
  287. package/eigen/Eigen/src/LU/InternalHeaderCheck.h +3 -0
  288. package/eigen/Eigen/src/LU/InverseImpl.h +206 -285
  289. package/eigen/Eigen/src/LU/PartialPivLU.h +390 -428
  290. package/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h +54 -40
  291. package/eigen/Eigen/src/LU/arch/InverseSize4.h +72 -70
  292. package/eigen/Eigen/src/MetisSupport/InternalHeaderCheck.h +3 -0
  293. package/eigen/Eigen/src/MetisSupport/MetisSupport.h +81 -93
  294. package/eigen/Eigen/src/OrderingMethods/Amd.h +243 -265
  295. package/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +831 -1004
  296. package/eigen/Eigen/src/OrderingMethods/InternalHeaderCheck.h +3 -0
  297. package/eigen/Eigen/src/OrderingMethods/Ordering.h +112 -119
  298. package/eigen/Eigen/src/PaStiXSupport/InternalHeaderCheck.h +3 -0
  299. package/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +524 -570
  300. package/eigen/Eigen/src/PardisoSupport/InternalHeaderCheck.h +3 -0
  301. package/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +385 -430
  302. package/eigen/Eigen/src/QR/ColPivHouseholderQR.h +479 -479
  303. package/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +120 -56
  304. package/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +166 -153
  305. package/eigen/Eigen/src/QR/FullPivHouseholderQR.h +495 -475
  306. package/eigen/Eigen/src/QR/HouseholderQR.h +394 -285
  307. package/eigen/Eigen/src/QR/HouseholderQR_LAPACKE.h +32 -23
  308. package/eigen/Eigen/src/QR/InternalHeaderCheck.h +3 -0
  309. package/eigen/Eigen/src/SPQRSupport/InternalHeaderCheck.h +3 -0
  310. package/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +244 -264
  311. package/eigen/Eigen/src/SVD/BDCSVD.h +817 -713
  312. package/eigen/Eigen/src/SVD/BDCSVD_LAPACKE.h +174 -0
  313. package/eigen/Eigen/src/SVD/InternalHeaderCheck.h +3 -0
  314. package/eigen/Eigen/src/SVD/JacobiSVD.h +577 -543
  315. package/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h +85 -49
  316. package/eigen/Eigen/src/SVD/SVDBase.h +242 -182
  317. package/eigen/Eigen/src/SVD/UpperBidiagonalization.h +200 -235
  318. package/eigen/Eigen/src/SparseCholesky/InternalHeaderCheck.h +3 -0
  319. package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +765 -594
  320. package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +308 -94
  321. package/eigen/Eigen/src/SparseCore/AmbiVector.h +202 -251
  322. package/eigen/Eigen/src/SparseCore/CompressedStorage.h +184 -252
  323. package/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +134 -178
  324. package/eigen/Eigen/src/SparseCore/InternalHeaderCheck.h +3 -0
  325. package/eigen/Eigen/src/SparseCore/SparseAssign.h +149 -140
  326. package/eigen/Eigen/src/SparseCore/SparseBlock.h +403 -440
  327. package/eigen/Eigen/src/SparseCore/SparseColEtree.h +100 -112
  328. package/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +525 -303
  329. package/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +555 -339
  330. package/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +100 -108
  331. package/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +169 -197
  332. package/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h +71 -71
  333. package/eigen/Eigen/src/SparseCore/SparseDot.h +49 -47
  334. package/eigen/Eigen/src/SparseCore/SparseFuzzy.h +13 -11
  335. package/eigen/Eigen/src/SparseCore/SparseMap.h +243 -253
  336. package/eigen/Eigen/src/SparseCore/SparseMatrix.h +1603 -1245
  337. package/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +403 -350
  338. package/eigen/Eigen/src/SparseCore/SparsePermutation.h +186 -115
  339. package/eigen/Eigen/src/SparseCore/SparseProduct.h +94 -97
  340. package/eigen/Eigen/src/SparseCore/SparseRedux.h +22 -24
  341. package/eigen/Eigen/src/SparseCore/SparseRef.h +268 -295
  342. package/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +370 -416
  343. package/eigen/Eigen/src/SparseCore/SparseSolverBase.h +78 -87
  344. package/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +81 -95
  345. package/eigen/Eigen/src/SparseCore/SparseTranspose.h +62 -71
  346. package/eigen/Eigen/src/SparseCore/SparseTriangularView.h +132 -144
  347. package/eigen/Eigen/src/SparseCore/SparseUtil.h +138 -115
  348. package/eigen/Eigen/src/SparseCore/SparseVector.h +426 -372
  349. package/eigen/Eigen/src/SparseCore/SparseView.h +164 -193
  350. package/eigen/Eigen/src/SparseCore/TriangularSolver.h +129 -170
  351. package/eigen/Eigen/src/SparseLU/InternalHeaderCheck.h +3 -0
  352. package/eigen/Eigen/src/SparseLU/SparseLU.h +756 -710
  353. package/eigen/Eigen/src/SparseLU/SparseLUImpl.h +61 -48
  354. package/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +102 -118
  355. package/eigen/Eigen/src/SparseLU/SparseLU_Structs.h +38 -35
  356. package/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +245 -301
  357. package/eigen/Eigen/src/SparseLU/SparseLU_Utils.h +44 -49
  358. package/eigen/Eigen/src/SparseLU/SparseLU_column_bmod.h +104 -108
  359. package/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +89 -100
  360. package/eigen/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +57 -58
  361. package/eigen/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +43 -55
  362. package/eigen/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +74 -71
  363. package/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +124 -132
  364. package/eigen/Eigen/src/SparseLU/SparseLU_panel_dfs.h +136 -159
  365. package/eigen/Eigen/src/SparseLU/SparseLU_pivotL.h +51 -52
  366. package/eigen/Eigen/src/SparseLU/SparseLU_pruneL.h +67 -73
  367. package/eigen/Eigen/src/SparseLU/SparseLU_relax_snode.h +24 -26
  368. package/eigen/Eigen/src/SparseQR/InternalHeaderCheck.h +3 -0
  369. package/eigen/Eigen/src/SparseQR/SparseQR.h +450 -502
  370. package/eigen/Eigen/src/StlSupport/StdDeque.h +28 -93
  371. package/eigen/Eigen/src/StlSupport/StdList.h +28 -84
  372. package/eigen/Eigen/src/StlSupport/StdVector.h +28 -108
  373. package/eigen/Eigen/src/StlSupport/details.h +48 -50
  374. package/eigen/Eigen/src/SuperLUSupport/InternalHeaderCheck.h +3 -0
  375. package/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +634 -730
  376. package/eigen/Eigen/src/ThreadPool/Barrier.h +70 -0
  377. package/eigen/Eigen/src/ThreadPool/CoreThreadPoolDevice.h +336 -0
  378. package/eigen/Eigen/src/ThreadPool/EventCount.h +241 -0
  379. package/eigen/Eigen/src/ThreadPool/ForkJoin.h +140 -0
  380. package/eigen/Eigen/src/ThreadPool/InternalHeaderCheck.h +4 -0
  381. package/eigen/Eigen/src/ThreadPool/NonBlockingThreadPool.h +587 -0
  382. package/eigen/Eigen/src/ThreadPool/RunQueue.h +230 -0
  383. package/eigen/Eigen/src/ThreadPool/ThreadCancel.h +21 -0
  384. package/eigen/Eigen/src/ThreadPool/ThreadEnvironment.h +43 -0
  385. package/eigen/Eigen/src/ThreadPool/ThreadLocal.h +289 -0
  386. package/eigen/Eigen/src/ThreadPool/ThreadPoolInterface.h +50 -0
  387. package/eigen/Eigen/src/ThreadPool/ThreadYield.h +16 -0
  388. package/eigen/Eigen/src/UmfPackSupport/InternalHeaderCheck.h +3 -0
  389. package/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +428 -464
  390. package/eigen/Eigen/src/misc/Image.h +41 -43
  391. package/eigen/Eigen/src/misc/InternalHeaderCheck.h +3 -0
  392. package/eigen/Eigen/src/misc/Kernel.h +39 -41
  393. package/eigen/Eigen/src/misc/RealSvd2x2.h +19 -21
  394. package/eigen/Eigen/src/misc/blas.h +83 -426
  395. package/eigen/Eigen/src/misc/lapacke.h +9972 -16179
  396. package/eigen/Eigen/src/misc/lapacke_helpers.h +163 -0
  397. package/eigen/Eigen/src/misc/lapacke_mangling.h +4 -5
  398. package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.inc +344 -0
  399. package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.inc +544 -0
  400. package/eigen/Eigen/src/plugins/{BlockMethods.h → BlockMethods.inc} +434 -506
  401. package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.inc +116 -0
  402. package/eigen/Eigen/src/plugins/{CommonCwiseUnaryOps.h → CommonCwiseUnaryOps.inc} +58 -68
  403. package/eigen/Eigen/src/plugins/IndexedViewMethods.inc +192 -0
  404. package/eigen/Eigen/src/plugins/InternalHeaderCheck.inc +3 -0
  405. package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.inc +331 -0
  406. package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.inc +118 -0
  407. package/eigen/Eigen/src/plugins/ReshapedMethods.inc +133 -0
  408. package/package.json +1 -1
  409. package/eigen/COPYING.APACHE +0 -203
  410. package/eigen/COPYING.BSD +0 -26
  411. package/eigen/COPYING.GPL +0 -674
  412. package/eigen/COPYING.LGPL +0 -502
  413. package/eigen/COPYING.MINPACK +0 -51
  414. package/eigen/COPYING.MPL2 +0 -373
  415. package/eigen/COPYING.README +0 -18
  416. package/eigen/Eigen/src/Core/BooleanRedux.h +0 -162
  417. package/eigen/Eigen/src/Core/arch/CUDA/Complex.h +0 -258
  418. package/eigen/Eigen/src/Core/arch/Default/TypeCasting.h +0 -120
  419. package/eigen/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +0 -694
  420. package/eigen/Eigen/src/Core/util/NonMPL2.h +0 -3
  421. package/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h +0 -67
  422. package/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +0 -280
  423. package/eigen/Eigen/src/misc/lapack.h +0 -152
  424. package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +0 -358
  425. package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +0 -696
  426. package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.h +0 -115
  427. package/eigen/Eigen/src/plugins/IndexedViewMethods.h +0 -262
  428. package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +0 -152
  429. package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +0 -95
  430. package/eigen/Eigen/src/plugins/ReshapedMethods.h +0 -149
  431. package/eigen/README.md +0 -5
@@ -12,66 +12,53 @@
12
12
  #ifndef EIGEN_TRANSFORM_H
13
13
  #define EIGEN_TRANSFORM_H
14
14
 
15
+ // IWYU pragma: private
16
+ #include "./InternalHeaderCheck.h"
17
+
15
18
  namespace Eigen {
16
19
 
17
20
  namespace internal {
18
21
 
19
- template<typename Transform>
20
- struct transform_traits
21
- {
22
- enum
23
- {
22
+ template <typename Transform>
23
+ struct transform_traits {
24
+ enum {
24
25
  Dim = Transform::Dim,
25
26
  HDim = Transform::HDim,
26
27
  Mode = Transform::Mode,
27
- IsProjective = (int(Mode)==int(Projective))
28
+ IsProjective = (int(Mode) == int(Projective))
28
29
  };
29
30
  };
30
31
 
31
- template< typename TransformType,
32
- typename MatrixType,
33
- int Case = transform_traits<TransformType>::IsProjective ? 0
34
- : int(MatrixType::RowsAtCompileTime) == int(transform_traits<TransformType>::HDim) ? 1
35
- : 2,
32
+ template <typename TransformType, typename MatrixType,
33
+ int Case = transform_traits<TransformType>::IsProjective ? 0
34
+ : int(MatrixType::RowsAtCompileTime) == int(transform_traits<TransformType>::HDim) ? 1
35
+ : 2,
36
36
  int RhsCols = MatrixType::ColsAtCompileTime>
37
37
  struct transform_right_product_impl;
38
38
 
39
- template< typename Other,
40
- int Mode,
41
- int Options,
42
- int Dim,
43
- int HDim,
44
- int OtherRows=Other::RowsAtCompileTime,
45
- int OtherCols=Other::ColsAtCompileTime>
39
+ template <typename Other, int Mode, int Options, int Dim, int HDim, int OtherRows = Other::RowsAtCompileTime,
40
+ int OtherCols = Other::ColsAtCompileTime>
46
41
  struct transform_left_product_impl;
47
42
 
48
- template< typename Lhs,
49
- typename Rhs,
50
- bool AnyProjective =
51
- transform_traits<Lhs>::IsProjective ||
52
- transform_traits<Rhs>::IsProjective>
43
+ template <typename Lhs, typename Rhs,
44
+ bool AnyProjective = transform_traits<Lhs>::IsProjective || transform_traits<Rhs>::IsProjective>
53
45
  struct transform_transform_product_impl;
54
46
 
55
- template< typename Other,
56
- int Mode,
57
- int Options,
58
- int Dim,
59
- int HDim,
60
- int OtherRows=Other::RowsAtCompileTime,
61
- int OtherCols=Other::ColsAtCompileTime>
47
+ template <typename Other, int Mode, int Options, int Dim, int HDim, int OtherRows = Other::RowsAtCompileTime,
48
+ int OtherCols = Other::ColsAtCompileTime>
62
49
  struct transform_construct_from_matrix;
63
50
 
64
- template<typename TransformType> struct transform_take_affine_part;
51
+ template <typename TransformType>
52
+ struct transform_take_affine_part;
65
53
 
66
- template<typename _Scalar, int _Dim, int _Mode, int _Options>
67
- struct traits<Transform<_Scalar,_Dim,_Mode,_Options> >
68
- {
69
- typedef _Scalar Scalar;
54
+ template <typename Scalar_, int Dim_, int Mode_, int Options_>
55
+ struct traits<Transform<Scalar_, Dim_, Mode_, Options_> > {
56
+ typedef Scalar_ Scalar;
70
57
  typedef Eigen::Index StorageIndex;
71
58
  typedef Dense StorageKind;
72
59
  enum {
73
- Dim1 = _Dim==Dynamic ? _Dim : _Dim + 1,
74
- RowsAtCompileTime = _Mode==Projective ? Dim1 : _Dim,
60
+ Dim1 = Dim_ == Dynamic ? Dim_ : Dim_ + 1,
61
+ RowsAtCompileTime = Mode_ == Projective ? Dim1 : Dim_,
75
62
  ColsAtCompileTime = Dim1,
76
63
  MaxRowsAtCompileTime = RowsAtCompileTime,
77
64
  MaxColsAtCompileTime = ColsAtCompileTime,
@@ -79,202 +66,198 @@ struct traits<Transform<_Scalar,_Dim,_Mode,_Options> >
79
66
  };
80
67
  };
81
68
 
82
- template<int Mode> struct transform_make_affine;
69
+ template <int Mode>
70
+ struct transform_make_affine;
83
71
 
84
- } // end namespace internal
72
+ } // end namespace internal
85
73
 
86
74
  /** \geometry_module \ingroup Geometry_Module
87
- *
88
- * \class Transform
89
- *
90
- * \brief Represents an homogeneous transformation in a N dimensional space
91
- *
92
- * \tparam _Scalar the scalar type, i.e., the type of the coefficients
93
- * \tparam _Dim the dimension of the space
94
- * \tparam _Mode the type of the transformation. Can be:
95
- * - #Affine: the transformation is stored as a (Dim+1)^2 matrix,
96
- * where the last row is assumed to be [0 ... 0 1].
97
- * - #AffineCompact: the transformation is stored as a (Dim)x(Dim+1) matrix.
98
- * - #Projective: the transformation is stored as a (Dim+1)^2 matrix
99
- * without any assumption.
100
- * - #Isometry: same as #Affine with the additional assumption that
101
- * the linear part represents a rotation. This assumption is exploited
102
- * to speed up some functions such as inverse() and rotation().
103
- * \tparam _Options has the same meaning as in class Matrix. It allows to specify DontAlign and/or RowMajor.
104
- * These Options are passed directly to the underlying matrix type.
105
- *
106
- * The homography is internally represented and stored by a matrix which
107
- * is available through the matrix() method. To understand the behavior of
108
- * this class you have to think a Transform object as its internal
109
- * matrix representation. The chosen convention is right multiply:
110
- *
111
- * \code v' = T * v \endcode
112
- *
113
- * Therefore, an affine transformation matrix M is shaped like this:
114
- *
115
- * \f$ \left( \begin{array}{cc}
116
- * linear & translation\\
117
- * 0 ... 0 & 1
118
- * \end{array} \right) \f$
119
- *
120
- * Note that for a projective transformation the last row can be anything,
121
- * and then the interpretation of different parts might be slightly different.
122
- *
123
- * However, unlike a plain matrix, the Transform class provides many features
124
- * simplifying both its assembly and usage. In particular, it can be composed
125
- * with any other transformations (Transform,Translation,RotationBase,DiagonalMatrix)
126
- * and can be directly used to transform implicit homogeneous vectors. All these
127
- * operations are handled via the operator*. For the composition of transformations,
128
- * its principle consists to first convert the right/left hand sides of the product
129
- * to a compatible (Dim+1)^2 matrix and then perform a pure matrix product.
130
- * Of course, internally, operator* tries to perform the minimal number of operations
131
- * according to the nature of each terms. Likewise, when applying the transform
132
- * to points, the latters are automatically promoted to homogeneous vectors
133
- * before doing the matrix product. The conventions to homogeneous representations
134
- * are performed as follow:
135
- *
136
- * \b Translation t (Dim)x(1):
137
- * \f$ \left( \begin{array}{cc}
138
- * I & t \\
139
- * 0\,...\,0 & 1
140
- * \end{array} \right) \f$
141
- *
142
- * \b Rotation R (Dim)x(Dim):
143
- * \f$ \left( \begin{array}{cc}
144
- * R & 0\\
145
- * 0\,...\,0 & 1
146
- * \end{array} \right) \f$
147
- *<!--
148
- * \b Linear \b Matrix L (Dim)x(Dim):
149
- * \f$ \left( \begin{array}{cc}
150
- * L & 0\\
151
- * 0\,...\,0 & 1
152
- * \end{array} \right) \f$
153
- *
154
- * \b Affine \b Matrix A (Dim)x(Dim+1):
155
- * \f$ \left( \begin{array}{c}
156
- * A\\
157
- * 0\,...\,0\,1
158
- * \end{array} \right) \f$
159
- *-->
160
- * \b Scaling \b DiagonalMatrix S (Dim)x(Dim):
161
- * \f$ \left( \begin{array}{cc}
162
- * S & 0\\
163
- * 0\,...\,0 & 1
164
- * \end{array} \right) \f$
165
- *
166
- * \b Column \b point v (Dim)x(1):
167
- * \f$ \left( \begin{array}{c}
168
- * v\\
169
- * 1
170
- * \end{array} \right) \f$
171
- *
172
- * \b Set \b of \b column \b points V1...Vn (Dim)x(n):
173
- * \f$ \left( \begin{array}{ccc}
174
- * v_1 & ... & v_n\\
175
- * 1 & ... & 1
176
- * \end{array} \right) \f$
177
- *
178
- * The concatenation of a Transform object with any kind of other transformation
179
- * always returns a Transform object.
180
- *
181
- * A little exception to the "as pure matrix product" rule is the case of the
182
- * transformation of non homogeneous vectors by an affine transformation. In
183
- * that case the last matrix row can be ignored, and the product returns non
184
- * homogeneous vectors.
185
- *
186
- * Since, for instance, a Dim x Dim matrix is interpreted as a linear transformation,
187
- * it is not possible to directly transform Dim vectors stored in a Dim x Dim matrix.
188
- * The solution is either to use a Dim x Dynamic matrix or explicitly request a
189
- * vector transformation by making the vector homogeneous:
190
- * \code
191
- * m' = T * m.colwise().homogeneous();
192
- * \endcode
193
- * Note that there is zero overhead.
194
- *
195
- * Conversion methods from/to Qt's QMatrix and QTransform are available if the
196
- * preprocessor token EIGEN_QT_SUPPORT is defined.
197
- *
198
- * This class can be extended with the help of the plugin mechanism described on the page
199
- * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_TRANSFORM_PLUGIN.
200
- *
201
- * \sa class Matrix, class Quaternion
202
- */
203
- template<typename _Scalar, int _Dim, int _Mode, int _Options>
204
- class Transform
205
- {
206
- public:
207
- EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_Dim==Dynamic ? Dynamic : (_Dim+1)*(_Dim+1))
75
+ *
76
+ * \class Transform
77
+ *
78
+ * \brief Represents an homogeneous transformation in a N dimensional space
79
+ *
80
+ * \tparam Scalar_ the scalar type, i.e., the type of the coefficients
81
+ * \tparam Dim_ the dimension of the space
82
+ * \tparam Mode_ the type of the transformation. Can be:
83
+ * - #Affine: the transformation is stored as a (Dim+1)^2 matrix,
84
+ * where the last row is assumed to be [0 ... 0 1].
85
+ * - #AffineCompact: the transformation is stored as a (Dim)x(Dim+1) matrix.
86
+ * - #Projective: the transformation is stored as a (Dim+1)^2 matrix
87
+ * without any assumption.
88
+ * - #Isometry: same as #Affine with the additional assumption that
89
+ * the linear part represents a rotation. This assumption is exploited
90
+ * to speed up some functions such as inverse() and rotation().
91
+ * \tparam Options_ has the same meaning as in class Matrix. It allows to specify DontAlign and/or RowMajor.
92
+ * These Options are passed directly to the underlying matrix type.
93
+ *
94
+ * The homography is internally represented and stored by a matrix which
95
+ * is available through the matrix() method. To understand the behavior of
96
+ * this class you have to think a Transform object as its internal
97
+ * matrix representation. The chosen convention is right multiply:
98
+ *
99
+ * \code v' = T * v \endcode
100
+ *
101
+ * Therefore, an affine transformation matrix M is shaped like this:
102
+ *
103
+ * \f$ \left( \begin{array}{cc}
104
+ * linear & translation\\
105
+ * 0 ... 0 & 1
106
+ * \end{array} \right) \f$
107
+ *
108
+ * Note that for a projective transformation the last row can be anything,
109
+ * and then the interpretation of different parts might be slightly different.
110
+ *
111
+ * However, unlike a plain matrix, the Transform class provides many features
112
+ * simplifying both its assembly and usage. In particular, it can be composed
113
+ * with any other transformations (Transform,Translation,RotationBase,DiagonalMatrix)
114
+ * and can be directly used to transform implicit homogeneous vectors. All these
115
+ * operations are handled via the operator*. For the composition of transformations,
116
+ * its principle consists to first convert the right/left hand sides of the product
117
+ * to a compatible (Dim+1)^2 matrix and then perform a pure matrix product.
118
+ * Of course, internally, operator* tries to perform the minimal number of operations
119
+ * according to the nature of each terms. Likewise, when applying the transform
120
+ * to points, the latters are automatically promoted to homogeneous vectors
121
+ * before doing the matrix product. The conventions to homogeneous representations
122
+ * are performed as follow:
123
+ *
124
+ * \b Translation t (Dim)x(1):
125
+ * \f$ \left( \begin{array}{cc}
126
+ * I & t \\
127
+ * 0\,...\,0 & 1
128
+ * \end{array} \right) \f$
129
+ *
130
+ * \b Rotation R (Dim)x(Dim):
131
+ * \f$ \left( \begin{array}{cc}
132
+ * R & 0\\
133
+ * 0\,...\,0 & 1
134
+ * \end{array} \right) \f$
135
+ *<!--
136
+ * \b Linear \b Matrix L (Dim)x(Dim):
137
+ * \f$ \left( \begin{array}{cc}
138
+ * L & 0\\
139
+ * 0\,...\,0 & 1
140
+ * \end{array} \right) \f$
141
+ *
142
+ * \b Affine \b Matrix A (Dim)x(Dim+1):
143
+ * \f$ \left( \begin{array}{c}
144
+ * A\\
145
+ * 0\,...\,0\,1
146
+ * \end{array} \right) \f$
147
+ *-->
148
+ * \b Scaling \b DiagonalMatrix S (Dim)x(Dim):
149
+ * \f$ \left( \begin{array}{cc}
150
+ * S & 0\\
151
+ * 0\,...\,0 & 1
152
+ * \end{array} \right) \f$
153
+ *
154
+ * \b Column \b point v (Dim)x(1):
155
+ * \f$ \left( \begin{array}{c}
156
+ * v\\
157
+ * 1
158
+ * \end{array} \right) \f$
159
+ *
160
+ * \b Set \b of \b column \b points V1...Vn (Dim)x(n):
161
+ * \f$ \left( \begin{array}{ccc}
162
+ * v_1 & ... & v_n\\
163
+ * 1 & ... & 1
164
+ * \end{array} \right) \f$
165
+ *
166
+ * The concatenation of a Transform object with any kind of other transformation
167
+ * always returns a Transform object.
168
+ *
169
+ * A little exception to the "as pure matrix product" rule is the case of the
170
+ * transformation of non homogeneous vectors by an affine transformation. In
171
+ * that case the last matrix row can be ignored, and the product returns non
172
+ * homogeneous vectors.
173
+ *
174
+ * Since, for instance, a Dim x Dim matrix is interpreted as a linear transformation,
175
+ * it is not possible to directly transform Dim vectors stored in a Dim x Dim matrix.
176
+ * The solution is either to use a Dim x Dynamic matrix or explicitly request a
177
+ * vector transformation by making the vector homogeneous:
178
+ * \code
179
+ * m' = T * m.colwise().homogeneous();
180
+ * \endcode
181
+ * Note that there is zero overhead.
182
+ *
183
+ * Conversion methods from/to Qt's QMatrix and QTransform are available if the
184
+ * preprocessor token EIGEN_QT_SUPPORT is defined.
185
+ *
186
+ * This class can be extended with the help of the plugin mechanism described on the page
187
+ * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_TRANSFORM_PLUGIN.
188
+ *
189
+ * \sa class Matrix, class Quaternion
190
+ */
191
+ template <typename Scalar_, int Dim_, int Mode_, int Options_>
192
+ class Transform {
193
+ public:
194
+ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar_,
195
+ Dim_ == Dynamic ? Dynamic : (Dim_ + 1) * (Dim_ + 1))
208
196
  enum {
209
- Mode = _Mode,
210
- Options = _Options,
211
- Dim = _Dim, ///< space dimension in which the transformation holds
212
- HDim = _Dim+1, ///< size of a respective homogeneous vector
213
- Rows = int(Mode)==(AffineCompact) ? Dim : HDim
197
+ Mode = Mode_,
198
+ Options = Options_,
199
+ Dim = Dim_, ///< space dimension in which the transformation holds
200
+ HDim = Dim_ + 1, ///< size of a respective homogeneous vector
201
+ Rows = int(Mode) == (AffineCompact) ? Dim : HDim
214
202
  };
215
203
  /** the scalar type of the coefficients */
216
- typedef _Scalar Scalar;
204
+ typedef Scalar_ Scalar;
217
205
  typedef Eigen::Index StorageIndex;
218
- typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3
206
+ typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3
219
207
  /** type of the matrix used to represent the transformation */
220
- typedef typename internal::make_proper_matrix_type<Scalar,Rows,HDim,Options>::type MatrixType;
208
+ typedef typename internal::make_proper_matrix_type<Scalar, Rows, HDim, Options>::type MatrixType;
221
209
  /** constified MatrixType */
222
210
  typedef const MatrixType ConstMatrixType;
223
211
  /** type of the matrix used to represent the linear part of the transformation */
224
- typedef Matrix<Scalar,Dim,Dim,Options> LinearMatrixType;
212
+ typedef Matrix<Scalar, Dim, Dim, Options> LinearMatrixType;
225
213
  /** type of read/write reference to the linear part of the transformation */
226
- typedef Block<MatrixType,Dim,Dim,int(Mode)==(AffineCompact) && (int(Options)&RowMajor)==0> LinearPart;
214
+ typedef Block<MatrixType, Dim, Dim, int(Mode) == (AffineCompact) && (int(Options) & RowMajor) == 0> LinearPart;
227
215
  /** type of read reference to the linear part of the transformation */
228
- typedef const Block<ConstMatrixType,Dim,Dim,int(Mode)==(AffineCompact) && (int(Options)&RowMajor)==0> ConstLinearPart;
216
+ typedef const Block<ConstMatrixType, Dim, Dim, int(Mode) == (AffineCompact) && (int(Options) & RowMajor) == 0>
217
+ ConstLinearPart;
229
218
  /** type of read/write reference to the affine part of the transformation */
230
- typedef typename internal::conditional<int(Mode)==int(AffineCompact),
231
- MatrixType&,
232
- Block<MatrixType,Dim,HDim> >::type AffinePart;
219
+ typedef std::conditional_t<int(Mode) == int(AffineCompact), MatrixType&, Block<MatrixType, Dim, HDim> > AffinePart;
233
220
  /** type of read reference to the affine part of the transformation */
234
- typedef typename internal::conditional<int(Mode)==int(AffineCompact),
235
- const MatrixType&,
236
- const Block<const MatrixType,Dim,HDim> >::type ConstAffinePart;
221
+ typedef std::conditional_t<int(Mode) == int(AffineCompact), const MatrixType&,
222
+ const Block<const MatrixType, Dim, HDim> >
223
+ ConstAffinePart;
237
224
  /** type of a vector */
238
- typedef Matrix<Scalar,Dim,1> VectorType;
225
+ typedef Matrix<Scalar, Dim, 1> VectorType;
239
226
  /** type of a read/write reference to the translation part of the rotation */
240
- typedef Block<MatrixType,Dim,1,!(internal::traits<MatrixType>::Flags & RowMajorBit)> TranslationPart;
227
+ typedef Block<MatrixType, Dim, 1, !(internal::traits<MatrixType>::Flags & RowMajorBit)> TranslationPart;
241
228
  /** type of a read reference to the translation part of the rotation */
242
- typedef const Block<ConstMatrixType,Dim,1,!(internal::traits<MatrixType>::Flags & RowMajorBit)> ConstTranslationPart;
229
+ typedef const Block<ConstMatrixType, Dim, 1, !(internal::traits<MatrixType>::Flags & RowMajorBit)>
230
+ ConstTranslationPart;
243
231
  /** corresponding translation type */
244
- typedef Translation<Scalar,Dim> TranslationType;
232
+ typedef Translation<Scalar, Dim> TranslationType;
245
233
 
246
234
  // this intermediate enum is needed to avoid an ICE with gcc 3.4 and 4.0
247
- enum { TransformTimeDiagonalMode = ((Mode==int(Isometry))?Affine:int(Mode)) };
235
+ enum { TransformTimeDiagonalMode = ((Mode == int(Isometry)) ? Affine : int(Mode)) };
248
236
  /** The return type of the product between a diagonal matrix and a transform */
249
- typedef Transform<Scalar,Dim,TransformTimeDiagonalMode> TransformTimeDiagonalReturnType;
250
-
251
- protected:
237
+ typedef Transform<Scalar, Dim, TransformTimeDiagonalMode> TransformTimeDiagonalReturnType;
252
238
 
239
+ protected:
253
240
  MatrixType m_matrix;
254
241
 
255
- public:
256
-
242
+ public:
257
243
  /** Default constructor without initialization of the meaningful coefficients.
258
- * If Mode==Affine or Mode==Isometry, then the last row is set to [0 ... 0 1] */
259
- EIGEN_DEVICE_FUNC inline Transform()
260
- {
244
+ * If Mode==Affine or Mode==Isometry, then the last row is set to [0 ... 0 1] */
245
+ EIGEN_DEVICE_FUNC inline Transform() {
261
246
  check_template_params();
262
- internal::transform_make_affine<(int(Mode)==Affine || int(Mode)==Isometry) ? Affine : AffineCompact>::run(m_matrix);
247
+ internal::transform_make_affine<(int(Mode) == Affine || int(Mode) == Isometry) ? Affine : AffineCompact>::run(
248
+ m_matrix);
263
249
  }
264
250
 
265
- EIGEN_DEVICE_FUNC inline explicit Transform(const TranslationType& t)
266
- {
251
+ EIGEN_DEVICE_FUNC inline explicit Transform(const TranslationType& t) {
267
252
  check_template_params();
268
253
  *this = t;
269
254
  }
270
- EIGEN_DEVICE_FUNC inline explicit Transform(const UniformScaling<Scalar>& s)
271
- {
255
+ EIGEN_DEVICE_FUNC inline explicit Transform(const UniformScaling<Scalar>& s) {
272
256
  check_template_params();
273
257
  *this = s;
274
258
  }
275
- template<typename Derived>
276
- EIGEN_DEVICE_FUNC inline explicit Transform(const RotationBase<Derived, Dim>& r)
277
- {
259
+ template <typename Derived>
260
+ EIGEN_DEVICE_FUNC inline explicit Transform(const RotationBase<Derived, Dim>& r) {
278
261
  check_template_params();
279
262
  *this = r;
280
263
  }
@@ -282,68 +265,63 @@ public:
282
265
  typedef internal::transform_take_affine_part<Transform> take_affine_part;
283
266
 
284
267
  /** Constructs and initializes a transformation from a Dim^2 or a (Dim+1)^2 matrix. */
285
- template<typename OtherDerived>
286
- EIGEN_DEVICE_FUNC inline explicit Transform(const EigenBase<OtherDerived>& other)
287
- {
288
- EIGEN_STATIC_ASSERT((internal::is_same<Scalar,typename OtherDerived::Scalar>::value),
289
- YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY);
268
+ template <typename OtherDerived>
269
+ EIGEN_DEVICE_FUNC inline explicit Transform(const EigenBase<OtherDerived>& other) {
270
+ EIGEN_STATIC_ASSERT(
271
+ (internal::is_same<Scalar, typename OtherDerived::Scalar>::value),
272
+ YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY);
290
273
 
291
274
  check_template_params();
292
- internal::transform_construct_from_matrix<OtherDerived,Mode,Options,Dim,HDim>::run(this, other.derived());
275
+ internal::transform_construct_from_matrix<OtherDerived, Mode, Options, Dim, HDim>::run(this, other.derived());
293
276
  }
294
277
 
295
278
  /** Set \c *this from a Dim^2 or (Dim+1)^2 matrix. */
296
- template<typename OtherDerived>
297
- EIGEN_DEVICE_FUNC inline Transform& operator=(const EigenBase<OtherDerived>& other)
298
- {
299
- EIGEN_STATIC_ASSERT((internal::is_same<Scalar,typename OtherDerived::Scalar>::value),
300
- YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY);
279
+ template <typename OtherDerived>
280
+ EIGEN_DEVICE_FUNC inline Transform& operator=(const EigenBase<OtherDerived>& other) {
281
+ EIGEN_STATIC_ASSERT(
282
+ (internal::is_same<Scalar, typename OtherDerived::Scalar>::value),
283
+ YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY);
301
284
 
302
- internal::transform_construct_from_matrix<OtherDerived,Mode,Options,Dim,HDim>::run(this, other.derived());
285
+ internal::transform_construct_from_matrix<OtherDerived, Mode, Options, Dim, HDim>::run(this, other.derived());
303
286
  return *this;
304
287
  }
305
288
 
306
- template<int OtherOptions>
307
- EIGEN_DEVICE_FUNC inline Transform(const Transform<Scalar,Dim,Mode,OtherOptions>& other)
308
- {
289
+ template <int OtherOptions>
290
+ EIGEN_DEVICE_FUNC inline Transform(const Transform<Scalar, Dim, Mode, OtherOptions>& other) {
309
291
  check_template_params();
310
292
  // only the options change, we can directly copy the matrices
311
293
  m_matrix = other.matrix();
312
294
  }
313
295
 
314
- template<int OtherMode,int OtherOptions>
315
- EIGEN_DEVICE_FUNC inline Transform(const Transform<Scalar,Dim,OtherMode,OtherOptions>& other)
316
- {
296
+ template <int OtherMode, int OtherOptions>
297
+ EIGEN_DEVICE_FUNC inline Transform(const Transform<Scalar, Dim, OtherMode, OtherOptions>& other) {
317
298
  check_template_params();
318
299
  // prevent conversions as:
319
300
  // Affine | AffineCompact | Isometry = Projective
320
- EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(OtherMode==int(Projective), Mode==int(Projective)),
301
+ EIGEN_STATIC_ASSERT(internal::check_implication(OtherMode == int(Projective), Mode == int(Projective)),
321
302
  YOU_PERFORMED_AN_INVALID_TRANSFORMATION_CONVERSION)
322
303
 
323
304
  // prevent conversions as:
324
305
  // Isometry = Affine | AffineCompact
325
- EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(OtherMode==int(Affine)||OtherMode==int(AffineCompact), Mode!=int(Isometry)),
326
- YOU_PERFORMED_AN_INVALID_TRANSFORMATION_CONVERSION)
306
+ EIGEN_STATIC_ASSERT(
307
+ internal::check_implication(OtherMode == int(Affine) || OtherMode == int(AffineCompact), Mode != int(Isometry)),
308
+ YOU_PERFORMED_AN_INVALID_TRANSFORMATION_CONVERSION)
327
309
 
328
- enum { ModeIsAffineCompact = Mode == int(AffineCompact),
329
- OtherModeIsAffineCompact = OtherMode == int(AffineCompact)
310
+ enum {
311
+ ModeIsAffineCompact = Mode == int(AffineCompact),
312
+ OtherModeIsAffineCompact = OtherMode == int(AffineCompact)
330
313
  };
331
314
 
332
- if(EIGEN_CONST_CONDITIONAL(ModeIsAffineCompact == OtherModeIsAffineCompact))
333
- {
315
+ if (EIGEN_CONST_CONDITIONAL(ModeIsAffineCompact == OtherModeIsAffineCompact)) {
334
316
  // We need the block expression because the code is compiled for all
335
317
  // combinations of transformations and will trigger a compile time error
336
318
  // if one tries to assign the matrices directly
337
- m_matrix.template block<Dim,Dim+1>(0,0) = other.matrix().template block<Dim,Dim+1>(0,0);
319
+ m_matrix.template block<Dim, Dim + 1>(0, 0) = other.matrix().template block<Dim, Dim + 1>(0, 0);
338
320
  makeAffine();
339
- }
340
- else if(EIGEN_CONST_CONDITIONAL(OtherModeIsAffineCompact))
341
- {
342
- typedef typename Transform<Scalar,Dim,OtherMode,OtherOptions>::MatrixType OtherMatrixType;
343
- internal::transform_construct_from_matrix<OtherMatrixType,Mode,Options,Dim,HDim>::run(this, other.matrix());
344
- }
345
- else
346
- {
321
+ } else if (EIGEN_CONST_CONDITIONAL(OtherModeIsAffineCompact)) {
322
+ typedef typename Transform<Scalar, Dim, OtherMode, OtherOptions>::MatrixType OtherMatrixType;
323
+ internal::transform_construct_from_matrix<OtherMatrixType, Mode, Options, Dim, HDim>::run(this, other.matrix());
324
+ } else {
347
325
  // here we know that Mode == AffineCompact and OtherMode != AffineCompact.
348
326
  // if OtherMode were Projective, the static assert above would already have caught it.
349
327
  // So the only possibility is that OtherMode == Affine
@@ -352,38 +330,40 @@ public:
352
330
  }
353
331
  }
354
332
 
355
- template<typename OtherDerived>
356
- EIGEN_DEVICE_FUNC Transform(const ReturnByValue<OtherDerived>& other)
357
- {
333
+ template <typename OtherDerived>
334
+ EIGEN_DEVICE_FUNC Transform(const ReturnByValue<OtherDerived>& other) {
358
335
  check_template_params();
359
336
  other.evalTo(*this);
360
337
  }
361
338
 
362
- template<typename OtherDerived>
363
- EIGEN_DEVICE_FUNC Transform& operator=(const ReturnByValue<OtherDerived>& other)
364
- {
339
+ template <typename OtherDerived>
340
+ EIGEN_DEVICE_FUNC Transform& operator=(const ReturnByValue<OtherDerived>& other) {
365
341
  other.evalTo(*this);
366
342
  return *this;
367
343
  }
368
344
 
369
- #ifdef EIGEN_QT_SUPPORT
345
+ #ifdef EIGEN_QT_SUPPORT
346
+ #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
370
347
  inline Transform(const QMatrix& other);
371
348
  inline Transform& operator=(const QMatrix& other);
372
349
  inline QMatrix toQMatrix(void) const;
350
+ #endif
373
351
  inline Transform(const QTransform& other);
374
352
  inline Transform& operator=(const QTransform& other);
375
353
  inline QTransform toQTransform(void) const;
376
- #endif
354
+ #endif
377
355
 
378
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return int(Mode)==int(Projective) ? m_matrix.cols() : (m_matrix.cols()-1); }
379
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
356
+ EIGEN_DEVICE_FUNC constexpr Index rows() const noexcept {
357
+ return int(Mode) == int(Projective) ? m_matrix.cols() : (m_matrix.cols() - 1);
358
+ }
359
+ EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return m_matrix.cols(); }
380
360
 
381
361
  /** shortcut for m_matrix(row,col);
382
- * \sa MatrixBase::operator(Index,Index) const */
383
- EIGEN_DEVICE_FUNC inline Scalar operator() (Index row, Index col) const { return m_matrix(row,col); }
362
+ * \sa MatrixBase::operator(Index,Index) const */
363
+ EIGEN_DEVICE_FUNC inline Scalar operator()(Index row, Index col) const { return m_matrix(row, col); }
384
364
  /** shortcut for m_matrix(row,col);
385
- * \sa MatrixBase::operator(Index,Index) */
386
- EIGEN_DEVICE_FUNC inline Scalar& operator() (Index row, Index col) { return m_matrix(row,col); }
365
+ * \sa MatrixBase::operator(Index,Index) */
366
+ EIGEN_DEVICE_FUNC inline Scalar& operator()(Index row, Index col) { return m_matrix(row, col); }
387
367
 
388
368
  /** \returns a read-only expression of the transformation matrix */
389
369
  EIGEN_DEVICE_FUNC inline const MatrixType& matrix() const { return m_matrix; }
@@ -391,9 +371,9 @@ public:
391
371
  EIGEN_DEVICE_FUNC inline MatrixType& matrix() { return m_matrix; }
392
372
 
393
373
  /** \returns a read-only expression of the linear part of the transformation */
394
- EIGEN_DEVICE_FUNC inline ConstLinearPart linear() const { return ConstLinearPart(m_matrix,0,0); }
374
+ EIGEN_DEVICE_FUNC inline ConstLinearPart linear() const { return ConstLinearPart(m_matrix, 0, 0); }
395
375
  /** \returns a writable expression of the linear part of the transformation */
396
- EIGEN_DEVICE_FUNC inline LinearPart linear() { return LinearPart(m_matrix,0,0); }
376
+ EIGEN_DEVICE_FUNC inline LinearPart linear() { return LinearPart(m_matrix, 0, 0); }
397
377
 
398
378
  /** \returns a read-only expression of the Dim x HDim affine part of the transformation */
399
379
  EIGEN_DEVICE_FUNC inline ConstAffinePart affine() const { return take_affine_part::run(m_matrix); }
@@ -401,127 +381,133 @@ public:
401
381
  EIGEN_DEVICE_FUNC inline AffinePart affine() { return take_affine_part::run(m_matrix); }
402
382
 
403
383
  /** \returns a read-only expression of the translation vector of the transformation */
404
- EIGEN_DEVICE_FUNC inline ConstTranslationPart translation() const { return ConstTranslationPart(m_matrix,0,Dim); }
384
+ EIGEN_DEVICE_FUNC inline ConstTranslationPart translation() const { return ConstTranslationPart(m_matrix, 0, Dim); }
405
385
  /** \returns a writable expression of the translation vector of the transformation */
406
- EIGEN_DEVICE_FUNC inline TranslationPart translation() { return TranslationPart(m_matrix,0,Dim); }
386
+ EIGEN_DEVICE_FUNC inline TranslationPart translation() { return TranslationPart(m_matrix, 0, Dim); }
407
387
 
408
388
  /** \returns an expression of the product between the transform \c *this and a matrix expression \a other.
409
- *
410
- * The right-hand-side \a other can be either:
411
- * \li an homogeneous vector of size Dim+1,
412
- * \li a set of homogeneous vectors of size Dim+1 x N,
413
- * \li a transformation matrix of size Dim+1 x Dim+1.
414
- *
415
- * Moreover, if \c *this represents an affine transformation (i.e., Mode!=Projective), then \a other can also be:
416
- * \li a point of size Dim (computes: \code this->linear() * other + this->translation()\endcode),
417
- * \li a set of N points as a Dim x N matrix (computes: \code (this->linear() * other).colwise() + this->translation()\endcode),
418
- *
419
- * In all cases, the return type is a matrix or vector of same sizes as the right-hand-side \a other.
420
- *
421
- * If you want to interpret \a other as a linear or affine transformation, then first convert it to a Transform<> type,
422
- * or do your own cooking.
423
- *
424
- * Finally, if you want to apply Affine transformations to vectors, then explicitly apply the linear part only:
425
- * \code
426
- * Affine3f A;
427
- * Vector3f v1, v2;
428
- * v2 = A.linear() * v1;
429
- * \endcode
430
- *
431
- */
389
+ *
390
+ * The right-hand-side \a other can be either:
391
+ * \li an homogeneous vector of size Dim+1,
392
+ * \li a set of homogeneous vectors of size Dim+1 x N,
393
+ * \li a transformation matrix of size Dim+1 x Dim+1.
394
+ *
395
+ * Moreover, if \c *this represents an affine transformation (i.e., Mode!=Projective), then \a other can also be:
396
+ * \li a point of size Dim (computes: \code this->linear() * other + this->translation()\endcode),
397
+ * \li a set of N points as a Dim x N matrix (computes: \code (this->linear() * other).colwise() +
398
+ * this->translation()\endcode),
399
+ *
400
+ * In all cases, the return type is a matrix or vector of same sizes as the right-hand-side \a other.
401
+ *
402
+ * If you want to interpret \a other as a linear or affine transformation, then first convert it to a Transform<>
403
+ * type, or do your own cooking.
404
+ *
405
+ * Finally, if you want to apply Affine transformations to vectors, then explicitly apply the linear part only:
406
+ * \code
407
+ * Affine3f A;
408
+ * Vector3f v1, v2;
409
+ * v2 = A.linear() * v1;
410
+ * \endcode
411
+ *
412
+ */
432
413
  // note: this function is defined here because some compilers cannot find the respective declaration
433
- template<typename OtherDerived>
434
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename internal::transform_right_product_impl<Transform, OtherDerived>::ResultType
435
- operator * (const EigenBase<OtherDerived> &other) const
436
- { return internal::transform_right_product_impl<Transform, OtherDerived>::run(*this,other.derived()); }
414
+ template <typename OtherDerived>
415
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename internal::transform_right_product_impl<Transform,
416
+ OtherDerived>::ResultType
417
+ operator*(const EigenBase<OtherDerived>& other) const {
418
+ return internal::transform_right_product_impl<Transform, OtherDerived>::run(*this, other.derived());
419
+ }
437
420
 
438
421
  /** \returns the product expression of a transformation matrix \a a times a transform \a b
439
- *
440
- * The left hand side \a other can be either:
441
- * \li a linear transformation matrix of size Dim x Dim,
442
- * \li an affine transformation matrix of size Dim x Dim+1,
443
- * \li a general transformation matrix of size Dim+1 x Dim+1.
444
- */
445
- template<typename OtherDerived> friend
446
- EIGEN_DEVICE_FUNC inline const typename internal::transform_left_product_impl<OtherDerived,Mode,Options,_Dim,_Dim+1>::ResultType
447
- operator * (const EigenBase<OtherDerived> &a, const Transform &b)
448
- { return internal::transform_left_product_impl<OtherDerived,Mode,Options,Dim,HDim>::run(a.derived(),b); }
422
+ *
423
+ * The left hand side \a other can be either:
424
+ * \li a linear transformation matrix of size Dim x Dim,
425
+ * \li an affine transformation matrix of size Dim x Dim+1,
426
+ * \li a general transformation matrix of size Dim+1 x Dim+1.
427
+ */
428
+ template <typename OtherDerived>
429
+ friend EIGEN_DEVICE_FUNC inline const typename internal::transform_left_product_impl<OtherDerived, Mode, Options,
430
+ Dim_, Dim_ + 1>::ResultType
431
+ operator*(const EigenBase<OtherDerived>& a, const Transform& b) {
432
+ return internal::transform_left_product_impl<OtherDerived, Mode, Options, Dim, HDim>::run(a.derived(), b);
433
+ }
449
434
 
450
435
  /** \returns The product expression of a transform \a a times a diagonal matrix \a b
451
- *
452
- * The rhs diagonal matrix is interpreted as an affine scaling transformation. The
453
- * product results in a Transform of the same type (mode) as the lhs only if the lhs
454
- * mode is no isometry. In that case, the returned transform is an affinity.
455
- */
456
- template<typename DiagonalDerived>
457
- EIGEN_DEVICE_FUNC inline const TransformTimeDiagonalReturnType
458
- operator * (const DiagonalBase<DiagonalDerived> &b) const
459
- {
436
+ *
437
+ * The rhs diagonal matrix is interpreted as an affine scaling transformation. The
438
+ * product results in a Transform of the same type (mode) as the lhs only if the lhs
439
+ * mode is no isometry. In that case, the returned transform is an affinity.
440
+ */
441
+ template <typename DiagonalDerived>
442
+ EIGEN_DEVICE_FUNC inline const TransformTimeDiagonalReturnType operator*(
443
+ const DiagonalBase<DiagonalDerived>& b) const {
460
444
  TransformTimeDiagonalReturnType res(*this);
461
445
  res.linearExt() *= b;
462
446
  return res;
463
447
  }
464
448
 
465
449
  /** \returns The product expression of a diagonal matrix \a a times a transform \a b
466
- *
467
- * The lhs diagonal matrix is interpreted as an affine scaling transformation. The
468
- * product results in a Transform of the same type (mode) as the lhs only if the lhs
469
- * mode is no isometry. In that case, the returned transform is an affinity.
470
- */
471
- template<typename DiagonalDerived>
472
- EIGEN_DEVICE_FUNC friend inline TransformTimeDiagonalReturnType
473
- operator * (const DiagonalBase<DiagonalDerived> &a, const Transform &b)
474
- {
450
+ *
451
+ * The lhs diagonal matrix is interpreted as an affine scaling transformation. The
452
+ * product results in a Transform of the same type (mode) as the lhs only if the lhs
453
+ * mode is no isometry. In that case, the returned transform is an affinity.
454
+ */
455
+ template <typename DiagonalDerived>
456
+ EIGEN_DEVICE_FUNC friend inline TransformTimeDiagonalReturnType operator*(const DiagonalBase<DiagonalDerived>& a,
457
+ const Transform& b) {
475
458
  TransformTimeDiagonalReturnType res;
476
- res.linear().noalias() = a*b.linear();
477
- res.translation().noalias() = a*b.translation();
478
- if (EIGEN_CONST_CONDITIONAL(Mode!=int(AffineCompact)))
479
- res.matrix().row(Dim) = b.matrix().row(Dim);
459
+ res.linear().noalias() = a * b.linear();
460
+ res.translation().noalias() = a * b.translation();
461
+ if (EIGEN_CONST_CONDITIONAL(Mode != int(AffineCompact))) res.matrix().row(Dim) = b.matrix().row(Dim);
480
462
  return res;
481
463
  }
482
464
 
483
- template<typename OtherDerived>
484
- EIGEN_DEVICE_FUNC inline Transform& operator*=(const EigenBase<OtherDerived>& other) { return *this = *this * other; }
465
+ template <typename OtherDerived>
466
+ EIGEN_DEVICE_FUNC inline Transform& operator*=(const EigenBase<OtherDerived>& other) {
467
+ return *this = *this * other;
468
+ }
485
469
 
486
470
  /** Concatenates two transformations */
487
- EIGEN_DEVICE_FUNC inline const Transform operator * (const Transform& other) const
488
- {
489
- return internal::transform_transform_product_impl<Transform,Transform>::run(*this,other);
471
+ EIGEN_DEVICE_FUNC inline const Transform operator*(const Transform& other) const {
472
+ return internal::transform_transform_product_impl<Transform, Transform>::run(*this, other);
490
473
  }
491
474
 
492
- #if EIGEN_COMP_ICC
493
- private:
475
+ #if EIGEN_COMP_ICC
476
+ private:
494
477
  // this intermediate structure permits to workaround a bug in ICC 11:
495
478
  // error: template instantiation resulted in unexpected function type of "Eigen::Transform<double, 3, 32, 0>
496
479
  // (const Eigen::Transform<double, 3, 2, 0> &) const"
497
480
  // (the meaning of a name may have changed since the template declaration -- the type of the template is:
498
481
  // "Eigen::internal::transform_transform_product_impl<Eigen::Transform<double, 3, 32, 0>,
499
- // Eigen::Transform<double, 3, Mode, Options>, <expression>>::ResultType (const Eigen::Transform<double, 3, Mode, Options> &) const")
482
+ // Eigen::Transform<double, 3, Mode, Options>, <expression>>::ResultType (const Eigen::Transform<double, 3, Mode,
483
+ // Options> &) const")
500
484
  //
501
- template<int OtherMode,int OtherOptions> struct icc_11_workaround
502
- {
503
- typedef internal::transform_transform_product_impl<Transform,Transform<Scalar,Dim,OtherMode,OtherOptions> > ProductType;
485
+ template <int OtherMode, int OtherOptions>
486
+ struct icc_11_workaround {
487
+ typedef internal::transform_transform_product_impl<Transform, Transform<Scalar, Dim, OtherMode, OtherOptions> >
488
+ ProductType;
504
489
  typedef typename ProductType::ResultType ResultType;
505
490
  };
506
491
 
507
- public:
492
+ public:
508
493
  /** Concatenates two different transformations */
509
- template<int OtherMode,int OtherOptions>
510
- inline typename icc_11_workaround<OtherMode,OtherOptions>::ResultType
511
- operator * (const Transform<Scalar,Dim,OtherMode,OtherOptions>& other) const
512
- {
513
- typedef typename icc_11_workaround<OtherMode,OtherOptions>::ProductType ProductType;
514
- return ProductType::run(*this,other);
494
+ template <int OtherMode, int OtherOptions>
495
+ inline typename icc_11_workaround<OtherMode, OtherOptions>::ResultType operator*(
496
+ const Transform<Scalar, Dim, OtherMode, OtherOptions>& other) const {
497
+ typedef typename icc_11_workaround<OtherMode, OtherOptions>::ProductType ProductType;
498
+ return ProductType::run(*this, other);
515
499
  }
516
- #else
500
+ #else
517
501
  /** Concatenates two different transformations */
518
- template<int OtherMode,int OtherOptions>
519
- EIGEN_DEVICE_FUNC inline typename internal::transform_transform_product_impl<Transform,Transform<Scalar,Dim,OtherMode,OtherOptions> >::ResultType
520
- operator * (const Transform<Scalar,Dim,OtherMode,OtherOptions>& other) const
521
- {
522
- return internal::transform_transform_product_impl<Transform,Transform<Scalar,Dim,OtherMode,OtherOptions> >::run(*this,other);
502
+ template <int OtherMode, int OtherOptions>
503
+ EIGEN_DEVICE_FUNC inline
504
+ typename internal::transform_transform_product_impl<Transform,
505
+ Transform<Scalar, Dim, OtherMode, OtherOptions> >::ResultType
506
+ operator*(const Transform<Scalar, Dim, OtherMode, OtherOptions>& other) const {
507
+ return internal::transform_transform_product_impl<Transform, Transform<Scalar, Dim, OtherMode, OtherOptions> >::run(
508
+ *this, other);
523
509
  }
524
- #endif
510
+ #endif
525
511
 
526
512
  /** \sa MatrixBase::setIdentity() */
527
513
  EIGEN_DEVICE_FUNC void setIdentity() { m_matrix.setIdentity(); }
@@ -530,299 +516,279 @@ public:
530
516
  * \brief Returns an identity transformation.
531
517
  * \todo In the future this function should be returning a Transform expression.
532
518
  */
533
- EIGEN_DEVICE_FUNC static const Transform Identity()
534
- {
535
- return Transform(MatrixType::Identity());
536
- }
519
+ EIGEN_DEVICE_FUNC static const Transform Identity() { return Transform(MatrixType::Identity()); }
537
520
 
538
- template<typename OtherDerived>
539
- EIGEN_DEVICE_FUNC
540
- inline Transform& scale(const MatrixBase<OtherDerived> &other);
521
+ template <typename OtherDerived>
522
+ EIGEN_DEVICE_FUNC inline Transform& scale(const MatrixBase<OtherDerived>& other);
541
523
 
542
- template<typename OtherDerived>
543
- EIGEN_DEVICE_FUNC
544
- inline Transform& prescale(const MatrixBase<OtherDerived> &other);
524
+ template <typename OtherDerived>
525
+ EIGEN_DEVICE_FUNC inline Transform& prescale(const MatrixBase<OtherDerived>& other);
545
526
 
546
527
  EIGEN_DEVICE_FUNC inline Transform& scale(const Scalar& s);
547
528
  EIGEN_DEVICE_FUNC inline Transform& prescale(const Scalar& s);
548
529
 
549
- template<typename OtherDerived>
550
- EIGEN_DEVICE_FUNC
551
- inline Transform& translate(const MatrixBase<OtherDerived> &other);
530
+ template <typename OtherDerived>
531
+ EIGEN_DEVICE_FUNC inline Transform& translate(const MatrixBase<OtherDerived>& other);
552
532
 
553
- template<typename OtherDerived>
554
- EIGEN_DEVICE_FUNC
555
- inline Transform& pretranslate(const MatrixBase<OtherDerived> &other);
533
+ template <typename OtherDerived>
534
+ EIGEN_DEVICE_FUNC inline Transform& pretranslate(const MatrixBase<OtherDerived>& other);
556
535
 
557
- template<typename RotationType>
558
- EIGEN_DEVICE_FUNC
559
- inline Transform& rotate(const RotationType& rotation);
536
+ template <typename RotationType>
537
+ EIGEN_DEVICE_FUNC inline Transform& rotate(const RotationType& rotation);
560
538
 
561
- template<typename RotationType>
562
- EIGEN_DEVICE_FUNC
563
- inline Transform& prerotate(const RotationType& rotation);
539
+ template <typename RotationType>
540
+ EIGEN_DEVICE_FUNC inline Transform& prerotate(const RotationType& rotation);
564
541
 
565
542
  EIGEN_DEVICE_FUNC Transform& shear(const Scalar& sx, const Scalar& sy);
566
543
  EIGEN_DEVICE_FUNC Transform& preshear(const Scalar& sx, const Scalar& sy);
567
544
 
568
545
  EIGEN_DEVICE_FUNC inline Transform& operator=(const TranslationType& t);
569
546
 
570
- EIGEN_DEVICE_FUNC
571
- inline Transform& operator*=(const TranslationType& t) { return translate(t.vector()); }
547
+ EIGEN_DEVICE_FUNC inline Transform& operator*=(const TranslationType& t) { return translate(t.vector()); }
572
548
 
573
549
  EIGEN_DEVICE_FUNC inline Transform operator*(const TranslationType& t) const;
574
550
 
575
- EIGEN_DEVICE_FUNC
576
- inline Transform& operator=(const UniformScaling<Scalar>& t);
551
+ EIGEN_DEVICE_FUNC inline Transform& operator=(const UniformScaling<Scalar>& t);
577
552
 
578
- EIGEN_DEVICE_FUNC
579
- inline Transform& operator*=(const UniformScaling<Scalar>& s) { return scale(s.factor()); }
553
+ EIGEN_DEVICE_FUNC inline Transform& operator*=(const UniformScaling<Scalar>& s) { return scale(s.factor()); }
580
554
 
581
- EIGEN_DEVICE_FUNC
582
- inline TransformTimeDiagonalReturnType operator*(const UniformScaling<Scalar>& s) const
583
- {
555
+ EIGEN_DEVICE_FUNC inline TransformTimeDiagonalReturnType operator*(const UniformScaling<Scalar>& s) const {
584
556
  TransformTimeDiagonalReturnType res = *this;
585
557
  res.scale(s.factor());
586
558
  return res;
587
559
  }
588
560
 
589
- EIGEN_DEVICE_FUNC
590
- inline Transform& operator*=(const DiagonalMatrix<Scalar,Dim>& s) { linearExt() *= s; return *this; }
561
+ EIGEN_DEVICE_FUNC inline Transform& operator*=(const DiagonalMatrix<Scalar, Dim>& s) {
562
+ linearExt() *= s;
563
+ return *this;
564
+ }
591
565
 
592
- template<typename Derived>
593
- EIGEN_DEVICE_FUNC inline Transform& operator=(const RotationBase<Derived,Dim>& r);
594
- template<typename Derived>
595
- EIGEN_DEVICE_FUNC inline Transform& operator*=(const RotationBase<Derived,Dim>& r) { return rotate(r.toRotationMatrix()); }
596
- template<typename Derived>
597
- EIGEN_DEVICE_FUNC inline Transform operator*(const RotationBase<Derived,Dim>& r) const;
566
+ template <typename Derived>
567
+ EIGEN_DEVICE_FUNC inline Transform& operator=(const RotationBase<Derived, Dim>& r);
568
+ template <typename Derived>
569
+ EIGEN_DEVICE_FUNC inline Transform& operator*=(const RotationBase<Derived, Dim>& r) {
570
+ return rotate(r.toRotationMatrix());
571
+ }
572
+ template <typename Derived>
573
+ EIGEN_DEVICE_FUNC inline Transform operator*(const RotationBase<Derived, Dim>& r) const;
598
574
 
599
- typedef typename internal::conditional<int(Mode)==Isometry,ConstLinearPart,const LinearMatrixType>::type RotationReturnType;
575
+ typedef std::conditional_t<int(Mode) == Isometry, ConstLinearPart, const LinearMatrixType> RotationReturnType;
600
576
  EIGEN_DEVICE_FUNC RotationReturnType rotation() const;
601
577
 
602
- template<typename RotationMatrixType, typename ScalingMatrixType>
603
- EIGEN_DEVICE_FUNC
604
- void computeRotationScaling(RotationMatrixType *rotation, ScalingMatrixType *scaling) const;
605
- template<typename ScalingMatrixType, typename RotationMatrixType>
606
- EIGEN_DEVICE_FUNC
607
- void computeScalingRotation(ScalingMatrixType *scaling, RotationMatrixType *rotation) const;
578
+ template <typename RotationMatrixType, typename ScalingMatrixType>
579
+ EIGEN_DEVICE_FUNC void computeRotationScaling(RotationMatrixType* rotation, ScalingMatrixType* scaling) const;
580
+ template <typename ScalingMatrixType, typename RotationMatrixType>
581
+ EIGEN_DEVICE_FUNC void computeScalingRotation(ScalingMatrixType* scaling, RotationMatrixType* rotation) const;
608
582
 
609
- template<typename PositionDerived, typename OrientationType, typename ScaleDerived>
610
- EIGEN_DEVICE_FUNC
611
- Transform& fromPositionOrientationScale(const MatrixBase<PositionDerived> &position,
612
- const OrientationType& orientation, const MatrixBase<ScaleDerived> &scale);
583
+ template <typename PositionDerived, typename OrientationType, typename ScaleDerived>
584
+ EIGEN_DEVICE_FUNC Transform& fromPositionOrientationScale(const MatrixBase<PositionDerived>& position,
585
+ const OrientationType& orientation,
586
+ const MatrixBase<ScaleDerived>& scale);
613
587
 
614
- EIGEN_DEVICE_FUNC
615
- inline Transform inverse(TransformTraits traits = (TransformTraits)Mode) const;
588
+ EIGEN_DEVICE_FUNC inline Transform inverse(TransformTraits traits = (TransformTraits)Mode) const;
616
589
 
617
590
  /** \returns a const pointer to the column major internal matrix */
618
- EIGEN_DEVICE_FUNC const Scalar* data() const { return m_matrix.data(); }
591
+ EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return m_matrix.data(); }
619
592
  /** \returns a non-const pointer to the column major internal matrix */
620
- EIGEN_DEVICE_FUNC Scalar* data() { return m_matrix.data(); }
593
+ EIGEN_DEVICE_FUNC constexpr Scalar* data() { return m_matrix.data(); }
621
594
 
622
595
  /** \returns \c *this with scalar type casted to \a NewScalarType
623
- *
624
- * Note that if \a NewScalarType is equal to the current scalar type of \c *this
625
- * then this function smartly returns a const reference to \c *this.
626
- */
627
- template<typename NewScalarType>
628
- EIGEN_DEVICE_FUNC inline typename internal::cast_return_type<Transform,Transform<NewScalarType,Dim,Mode,Options> >::type cast() const
629
- { return typename internal::cast_return_type<Transform,Transform<NewScalarType,Dim,Mode,Options> >::type(*this); }
596
+ *
597
+ * Note that if \a NewScalarType is equal to the current scalar type of \c *this
598
+ * then this function smartly returns a const reference to \c *this.
599
+ */
600
+ template <typename NewScalarType>
601
+ EIGEN_DEVICE_FUNC inline
602
+ typename internal::cast_return_type<Transform, Transform<NewScalarType, Dim, Mode, Options> >::type
603
+ cast() const {
604
+ return typename internal::cast_return_type<Transform, Transform<NewScalarType, Dim, Mode, Options> >::type(*this);
605
+ }
630
606
 
631
607
  /** Copy constructor with scalar type conversion */
632
- template<typename OtherScalarType>
633
- EIGEN_DEVICE_FUNC inline explicit Transform(const Transform<OtherScalarType,Dim,Mode,Options>& other)
634
- {
608
+ template <typename OtherScalarType>
609
+ EIGEN_DEVICE_FUNC inline explicit Transform(const Transform<OtherScalarType, Dim, Mode, Options>& other) {
635
610
  check_template_params();
636
611
  m_matrix = other.matrix().template cast<Scalar>();
637
612
  }
638
613
 
639
614
  /** \returns \c true if \c *this is approximately equal to \a other, within the precision
640
- * determined by \a prec.
641
- *
642
- * \sa MatrixBase::isApprox() */
643
- EIGEN_DEVICE_FUNC bool isApprox(const Transform& other, const typename NumTraits<Scalar>::Real& prec = NumTraits<Scalar>::dummy_precision()) const
644
- { return m_matrix.isApprox(other.m_matrix, prec); }
615
+ * determined by \a prec.
616
+ *
617
+ * \sa MatrixBase::isApprox() */
618
+ EIGEN_DEVICE_FUNC bool isApprox(const Transform& other, const typename NumTraits<Scalar>::Real& prec =
619
+ NumTraits<Scalar>::dummy_precision()) const {
620
+ return m_matrix.isApprox(other.m_matrix, prec);
621
+ }
645
622
 
646
623
  /** Sets the last row to [0 ... 0 1]
647
- */
648
- EIGEN_DEVICE_FUNC void makeAffine()
649
- {
650
- internal::transform_make_affine<int(Mode)>::run(m_matrix);
651
- }
624
+ */
625
+ EIGEN_DEVICE_FUNC void makeAffine() { internal::transform_make_affine<int(Mode)>::run(m_matrix); }
652
626
 
653
627
  /** \internal
654
- * \returns the Dim x Dim linear part if the transformation is affine,
655
- * and the HDim x Dim part for projective transformations.
656
- */
657
- EIGEN_DEVICE_FUNC inline Block<MatrixType,int(Mode)==int(Projective)?HDim:Dim,Dim> linearExt()
658
- { return m_matrix.template block<int(Mode)==int(Projective)?HDim:Dim,Dim>(0,0); }
628
+ * \returns the Dim x Dim linear part if the transformation is affine,
629
+ * and the HDim x Dim part for projective transformations.
630
+ */
631
+ EIGEN_DEVICE_FUNC inline Block<MatrixType, int(Mode) == int(Projective) ? HDim : Dim, Dim> linearExt() {
632
+ return m_matrix.template block < int(Mode) == int(Projective) ? HDim : Dim, Dim > (0, 0);
633
+ }
659
634
  /** \internal
660
- * \returns the Dim x Dim linear part if the transformation is affine,
661
- * and the HDim x Dim part for projective transformations.
662
- */
663
- EIGEN_DEVICE_FUNC inline const Block<MatrixType,int(Mode)==int(Projective)?HDim:Dim,Dim> linearExt() const
664
- { return m_matrix.template block<int(Mode)==int(Projective)?HDim:Dim,Dim>(0,0); }
635
+ * \returns the Dim x Dim linear part if the transformation is affine,
636
+ * and the HDim x Dim part for projective transformations.
637
+ */
638
+ EIGEN_DEVICE_FUNC inline const Block<MatrixType, int(Mode) == int(Projective) ? HDim : Dim, Dim> linearExt() const {
639
+ return m_matrix.template block < int(Mode) == int(Projective) ? HDim : Dim, Dim > (0, 0);
640
+ }
665
641
 
666
642
  /** \internal
667
- * \returns the translation part if the transformation is affine,
668
- * and the last column for projective transformations.
669
- */
670
- EIGEN_DEVICE_FUNC inline Block<MatrixType,int(Mode)==int(Projective)?HDim:Dim,1> translationExt()
671
- { return m_matrix.template block<int(Mode)==int(Projective)?HDim:Dim,1>(0,Dim); }
643
+ * \returns the translation part if the transformation is affine,
644
+ * and the last column for projective transformations.
645
+ */
646
+ EIGEN_DEVICE_FUNC inline Block<MatrixType, int(Mode) == int(Projective) ? HDim : Dim, 1> translationExt() {
647
+ return m_matrix.template block < int(Mode) == int(Projective) ? HDim : Dim, 1 > (0, Dim);
648
+ }
672
649
  /** \internal
673
- * \returns the translation part if the transformation is affine,
674
- * and the last column for projective transformations.
675
- */
676
- EIGEN_DEVICE_FUNC inline const Block<MatrixType,int(Mode)==int(Projective)?HDim:Dim,1> translationExt() const
677
- { return m_matrix.template block<int(Mode)==int(Projective)?HDim:Dim,1>(0,Dim); }
678
-
679
-
680
- #ifdef EIGEN_TRANSFORM_PLUGIN
681
- #include EIGEN_TRANSFORM_PLUGIN
682
- #endif
683
-
684
- protected:
685
- #ifndef EIGEN_PARSED_BY_DOXYGEN
686
- EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void check_template_params()
687
- {
688
- EIGEN_STATIC_ASSERT((Options & (DontAlign|RowMajor)) == Options, INVALID_MATRIX_TEMPLATE_PARAMETERS)
689
- }
690
- #endif
650
+ * \returns the translation part if the transformation is affine,
651
+ * and the last column for projective transformations.
652
+ */
653
+ EIGEN_DEVICE_FUNC inline const Block<MatrixType, int(Mode) == int(Projective) ? HDim : Dim, 1> translationExt()
654
+ const {
655
+ return m_matrix.template block < int(Mode) == int(Projective) ? HDim : Dim, 1 > (0, Dim);
656
+ }
691
657
 
658
+ #ifdef EIGEN_TRANSFORM_PLUGIN
659
+ #include EIGEN_TRANSFORM_PLUGIN
660
+ #endif
661
+
662
+ protected:
663
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
664
+ EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void check_template_params() {
665
+ EIGEN_STATIC_ASSERT((Options & (DontAlign | RowMajor)) == Options, INVALID_MATRIX_TEMPLATE_PARAMETERS)
666
+ }
667
+ #endif
692
668
  };
693
669
 
694
670
  /** \ingroup Geometry_Module */
695
- typedef Transform<float,2,Isometry> Isometry2f;
671
+ typedef Transform<float, 2, Isometry> Isometry2f;
696
672
  /** \ingroup Geometry_Module */
697
- typedef Transform<float,3,Isometry> Isometry3f;
673
+ typedef Transform<float, 3, Isometry> Isometry3f;
698
674
  /** \ingroup Geometry_Module */
699
- typedef Transform<double,2,Isometry> Isometry2d;
675
+ typedef Transform<double, 2, Isometry> Isometry2d;
700
676
  /** \ingroup Geometry_Module */
701
- typedef Transform<double,3,Isometry> Isometry3d;
677
+ typedef Transform<double, 3, Isometry> Isometry3d;
702
678
 
703
679
  /** \ingroup Geometry_Module */
704
- typedef Transform<float,2,Affine> Affine2f;
680
+ typedef Transform<float, 2, Affine> Affine2f;
705
681
  /** \ingroup Geometry_Module */
706
- typedef Transform<float,3,Affine> Affine3f;
682
+ typedef Transform<float, 3, Affine> Affine3f;
707
683
  /** \ingroup Geometry_Module */
708
- typedef Transform<double,2,Affine> Affine2d;
684
+ typedef Transform<double, 2, Affine> Affine2d;
709
685
  /** \ingroup Geometry_Module */
710
- typedef Transform<double,3,Affine> Affine3d;
686
+ typedef Transform<double, 3, Affine> Affine3d;
711
687
 
712
688
  /** \ingroup Geometry_Module */
713
- typedef Transform<float,2,AffineCompact> AffineCompact2f;
689
+ typedef Transform<float, 2, AffineCompact> AffineCompact2f;
714
690
  /** \ingroup Geometry_Module */
715
- typedef Transform<float,3,AffineCompact> AffineCompact3f;
691
+ typedef Transform<float, 3, AffineCompact> AffineCompact3f;
716
692
  /** \ingroup Geometry_Module */
717
- typedef Transform<double,2,AffineCompact> AffineCompact2d;
693
+ typedef Transform<double, 2, AffineCompact> AffineCompact2d;
718
694
  /** \ingroup Geometry_Module */
719
- typedef Transform<double,3,AffineCompact> AffineCompact3d;
695
+ typedef Transform<double, 3, AffineCompact> AffineCompact3d;
720
696
 
721
697
  /** \ingroup Geometry_Module */
722
- typedef Transform<float,2,Projective> Projective2f;
698
+ typedef Transform<float, 2, Projective> Projective2f;
723
699
  /** \ingroup Geometry_Module */
724
- typedef Transform<float,3,Projective> Projective3f;
700
+ typedef Transform<float, 3, Projective> Projective3f;
725
701
  /** \ingroup Geometry_Module */
726
- typedef Transform<double,2,Projective> Projective2d;
702
+ typedef Transform<double, 2, Projective> Projective2d;
727
703
  /** \ingroup Geometry_Module */
728
- typedef Transform<double,3,Projective> Projective3d;
704
+ typedef Transform<double, 3, Projective> Projective3d;
729
705
 
730
706
  /**************************
731
707
  *** Optional QT support ***
732
708
  **************************/
733
709
 
734
710
  #ifdef EIGEN_QT_SUPPORT
711
+
712
+ #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
735
713
  /** Initializes \c *this from a QMatrix assuming the dimension is 2.
736
- *
737
- * This function is available only if the token EIGEN_QT_SUPPORT is defined.
738
- */
739
- template<typename Scalar, int Dim, int Mode,int Options>
740
- Transform<Scalar,Dim,Mode,Options>::Transform(const QMatrix& other)
741
- {
714
+ *
715
+ * This function is available only if the token EIGEN_QT_SUPPORT is defined.
716
+ */
717
+ template <typename Scalar, int Dim, int Mode, int Options>
718
+ Transform<Scalar, Dim, Mode, Options>::Transform(const QMatrix& other) {
742
719
  check_template_params();
743
720
  *this = other;
744
721
  }
745
722
 
746
723
  /** Set \c *this from a QMatrix assuming the dimension is 2.
747
- *
748
- * This function is available only if the token EIGEN_QT_SUPPORT is defined.
749
- */
750
- template<typename Scalar, int Dim, int Mode,int Options>
751
- Transform<Scalar,Dim,Mode,Options>& Transform<Scalar,Dim,Mode,Options>::operator=(const QMatrix& other)
752
- {
753
- EIGEN_STATIC_ASSERT(Dim==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
724
+ *
725
+ * This function is available only if the token EIGEN_QT_SUPPORT is defined.
726
+ */
727
+ template <typename Scalar, int Dim, int Mode, int Options>
728
+ Transform<Scalar, Dim, Mode, Options>& Transform<Scalar, Dim, Mode, Options>::operator=(const QMatrix& other) {
729
+ EIGEN_STATIC_ASSERT(Dim == 2, YOU_MADE_A_PROGRAMMING_MISTAKE)
754
730
  if (EIGEN_CONST_CONDITIONAL(Mode == int(AffineCompact)))
755
- m_matrix << other.m11(), other.m21(), other.dx(),
756
- other.m12(), other.m22(), other.dy();
731
+ m_matrix << other.m11(), other.m21(), other.dx(), other.m12(), other.m22(), other.dy();
757
732
  else
758
- m_matrix << other.m11(), other.m21(), other.dx(),
759
- other.m12(), other.m22(), other.dy(),
760
- 0, 0, 1;
733
+ m_matrix << other.m11(), other.m21(), other.dx(), other.m12(), other.m22(), other.dy(), 0, 0, 1;
761
734
  return *this;
762
735
  }
763
736
 
764
737
  /** \returns a QMatrix from \c *this assuming the dimension is 2.
765
- *
766
- * \warning this conversion might loss data if \c *this is not affine
767
- *
768
- * This function is available only if the token EIGEN_QT_SUPPORT is defined.
769
- */
770
- template<typename Scalar, int Dim, int Mode, int Options>
771
- QMatrix Transform<Scalar,Dim,Mode,Options>::toQMatrix(void) const
772
- {
738
+ *
739
+ * \warning this conversion might loss data if \c *this is not affine
740
+ *
741
+ * This function is available only if the token EIGEN_QT_SUPPORT is defined.
742
+ */
743
+ template <typename Scalar, int Dim, int Mode, int Options>
744
+ QMatrix Transform<Scalar, Dim, Mode, Options>::toQMatrix(void) const {
773
745
  check_template_params();
774
- EIGEN_STATIC_ASSERT(Dim==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
775
- return QMatrix(m_matrix.coeff(0,0), m_matrix.coeff(1,0),
776
- m_matrix.coeff(0,1), m_matrix.coeff(1,1),
777
- m_matrix.coeff(0,2), m_matrix.coeff(1,2));
746
+ EIGEN_STATIC_ASSERT(Dim == 2, YOU_MADE_A_PROGRAMMING_MISTAKE)
747
+ return QMatrix(m_matrix.coeff(0, 0), m_matrix.coeff(1, 0), m_matrix.coeff(0, 1), m_matrix.coeff(1, 1),
748
+ m_matrix.coeff(0, 2), m_matrix.coeff(1, 2));
778
749
  }
750
+ #endif
779
751
 
780
752
  /** Initializes \c *this from a QTransform assuming the dimension is 2.
781
- *
782
- * This function is available only if the token EIGEN_QT_SUPPORT is defined.
783
- */
784
- template<typename Scalar, int Dim, int Mode,int Options>
785
- Transform<Scalar,Dim,Mode,Options>::Transform(const QTransform& other)
786
- {
753
+ *
754
+ * This function is available only if the token EIGEN_QT_SUPPORT is defined.
755
+ */
756
+ template <typename Scalar, int Dim, int Mode, int Options>
757
+ Transform<Scalar, Dim, Mode, Options>::Transform(const QTransform& other) {
787
758
  check_template_params();
788
759
  *this = other;
789
760
  }
790
761
 
791
762
  /** Set \c *this from a QTransform assuming the dimension is 2.
792
- *
793
- * This function is available only if the token EIGEN_QT_SUPPORT is defined.
794
- */
795
- template<typename Scalar, int Dim, int Mode, int Options>
796
- Transform<Scalar,Dim,Mode,Options>& Transform<Scalar,Dim,Mode,Options>::operator=(const QTransform& other)
797
- {
763
+ *
764
+ * This function is available only if the token EIGEN_QT_SUPPORT is defined.
765
+ */
766
+ template <typename Scalar, int Dim, int Mode, int Options>
767
+ Transform<Scalar, Dim, Mode, Options>& Transform<Scalar, Dim, Mode, Options>::operator=(const QTransform& other) {
798
768
  check_template_params();
799
- EIGEN_STATIC_ASSERT(Dim==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
769
+ EIGEN_STATIC_ASSERT(Dim == 2, YOU_MADE_A_PROGRAMMING_MISTAKE)
800
770
  if (EIGEN_CONST_CONDITIONAL(Mode == int(AffineCompact)))
801
- m_matrix << other.m11(), other.m21(), other.dx(),
802
- other.m12(), other.m22(), other.dy();
771
+ m_matrix << other.m11(), other.m21(), other.dx(), other.m12(), other.m22(), other.dy();
803
772
  else
804
- m_matrix << other.m11(), other.m21(), other.dx(),
805
- other.m12(), other.m22(), other.dy(),
806
- other.m13(), other.m23(), other.m33();
773
+ m_matrix << other.m11(), other.m21(), other.dx(), other.m12(), other.m22(), other.dy(), other.m13(), other.m23(),
774
+ other.m33();
807
775
  return *this;
808
776
  }
809
777
 
810
778
  /** \returns a QTransform from \c *this assuming the dimension is 2.
811
- *
812
- * This function is available only if the token EIGEN_QT_SUPPORT is defined.
813
- */
814
- template<typename Scalar, int Dim, int Mode, int Options>
815
- QTransform Transform<Scalar,Dim,Mode,Options>::toQTransform(void) const
816
- {
817
- EIGEN_STATIC_ASSERT(Dim==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
779
+ *
780
+ * This function is available only if the token EIGEN_QT_SUPPORT is defined.
781
+ */
782
+ template <typename Scalar, int Dim, int Mode, int Options>
783
+ QTransform Transform<Scalar, Dim, Mode, Options>::toQTransform(void) const {
784
+ EIGEN_STATIC_ASSERT(Dim == 2, YOU_MADE_A_PROGRAMMING_MISTAKE)
818
785
  if (EIGEN_CONST_CONDITIONAL(Mode == int(AffineCompact)))
819
- return QTransform(m_matrix.coeff(0,0), m_matrix.coeff(1,0),
820
- m_matrix.coeff(0,1), m_matrix.coeff(1,1),
821
- m_matrix.coeff(0,2), m_matrix.coeff(1,2));
786
+ return QTransform(m_matrix.coeff(0, 0), m_matrix.coeff(1, 0), m_matrix.coeff(0, 1), m_matrix.coeff(1, 1),
787
+ m_matrix.coeff(0, 2), m_matrix.coeff(1, 2));
822
788
  else
823
- return QTransform(m_matrix.coeff(0,0), m_matrix.coeff(1,0), m_matrix.coeff(2,0),
824
- m_matrix.coeff(0,1), m_matrix.coeff(1,1), m_matrix.coeff(2,1),
825
- m_matrix.coeff(0,2), m_matrix.coeff(1,2), m_matrix.coeff(2,2));
789
+ return QTransform(m_matrix.coeff(0, 0), m_matrix.coeff(1, 0), m_matrix.coeff(2, 0), m_matrix.coeff(0, 1),
790
+ m_matrix.coeff(1, 1), m_matrix.coeff(2, 1), m_matrix.coeff(0, 2), m_matrix.coeff(1, 2),
791
+ m_matrix.coeff(2, 2));
826
792
  }
827
793
  #endif
828
794
 
@@ -831,84 +797,80 @@ QTransform Transform<Scalar,Dim,Mode,Options>::toQTransform(void) const
831
797
  *********************/
832
798
 
833
799
  /** Applies on the right the non uniform scale transformation represented
834
- * by the vector \a other to \c *this and returns a reference to \c *this.
835
- * \sa prescale()
836
- */
837
- template<typename Scalar, int Dim, int Mode, int Options>
838
- template<typename OtherDerived>
839
- EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>&
840
- Transform<Scalar,Dim,Mode,Options>::scale(const MatrixBase<OtherDerived> &other)
841
- {
842
- EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,int(Dim))
843
- EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
800
+ * by the vector \a other to \c *this and returns a reference to \c *this.
801
+ * \sa prescale()
802
+ */
803
+ template <typename Scalar, int Dim, int Mode, int Options>
804
+ template <typename OtherDerived>
805
+ EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>& Transform<Scalar, Dim, Mode, Options>::scale(
806
+ const MatrixBase<OtherDerived>& other) {
807
+ EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived, int(Dim))
808
+ EIGEN_STATIC_ASSERT(Mode != int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
844
809
  linearExt().noalias() = (linearExt() * other.asDiagonal());
845
810
  return *this;
846
811
  }
847
812
 
848
813
  /** Applies on the right a uniform scale of a factor \a c to \c *this
849
- * and returns a reference to \c *this.
850
- * \sa prescale(Scalar)
851
- */
852
- template<typename Scalar, int Dim, int Mode, int Options>
853
- EIGEN_DEVICE_FUNC inline Transform<Scalar,Dim,Mode,Options>& Transform<Scalar,Dim,Mode,Options>::scale(const Scalar& s)
854
- {
855
- EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
814
+ * and returns a reference to \c *this.
815
+ * \sa prescale(Scalar)
816
+ */
817
+ template <typename Scalar, int Dim, int Mode, int Options>
818
+ EIGEN_DEVICE_FUNC inline Transform<Scalar, Dim, Mode, Options>& Transform<Scalar, Dim, Mode, Options>::scale(
819
+ const Scalar& s) {
820
+ EIGEN_STATIC_ASSERT(Mode != int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
856
821
  linearExt() *= s;
857
822
  return *this;
858
823
  }
859
824
 
860
825
  /** Applies on the left the non uniform scale transformation represented
861
- * by the vector \a other to \c *this and returns a reference to \c *this.
862
- * \sa scale()
863
- */
864
- template<typename Scalar, int Dim, int Mode, int Options>
865
- template<typename OtherDerived>
866
- EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>&
867
- Transform<Scalar,Dim,Mode,Options>::prescale(const MatrixBase<OtherDerived> &other)
868
- {
869
- EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,int(Dim))
870
- EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
826
+ * by the vector \a other to \c *this and returns a reference to \c *this.
827
+ * \sa scale()
828
+ */
829
+ template <typename Scalar, int Dim, int Mode, int Options>
830
+ template <typename OtherDerived>
831
+ EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>& Transform<Scalar, Dim, Mode, Options>::prescale(
832
+ const MatrixBase<OtherDerived>& other) {
833
+ EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived, int(Dim))
834
+ EIGEN_STATIC_ASSERT(Mode != int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
871
835
  affine().noalias() = (other.asDiagonal() * affine());
872
836
  return *this;
873
837
  }
874
838
 
875
839
  /** Applies on the left a uniform scale of a factor \a c to \c *this
876
- * and returns a reference to \c *this.
877
- * \sa scale(Scalar)
878
- */
879
- template<typename Scalar, int Dim, int Mode, int Options>
880
- EIGEN_DEVICE_FUNC inline Transform<Scalar,Dim,Mode,Options>& Transform<Scalar,Dim,Mode,Options>::prescale(const Scalar& s)
881
- {
882
- EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
840
+ * and returns a reference to \c *this.
841
+ * \sa scale(Scalar)
842
+ */
843
+ template <typename Scalar, int Dim, int Mode, int Options>
844
+ EIGEN_DEVICE_FUNC inline Transform<Scalar, Dim, Mode, Options>& Transform<Scalar, Dim, Mode, Options>::prescale(
845
+ const Scalar& s) {
846
+ EIGEN_STATIC_ASSERT(Mode != int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
883
847
  m_matrix.template topRows<Dim>() *= s;
884
848
  return *this;
885
849
  }
886
850
 
887
851
  /** Applies on the right the translation matrix represented by the vector \a other
888
- * to \c *this and returns a reference to \c *this.
889
- * \sa pretranslate()
890
- */
891
- template<typename Scalar, int Dim, int Mode, int Options>
892
- template<typename OtherDerived>
893
- EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>&
894
- Transform<Scalar,Dim,Mode,Options>::translate(const MatrixBase<OtherDerived> &other)
895
- {
896
- EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,int(Dim))
852
+ * to \c *this and returns a reference to \c *this.
853
+ * \sa pretranslate()
854
+ */
855
+ template <typename Scalar, int Dim, int Mode, int Options>
856
+ template <typename OtherDerived>
857
+ EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>& Transform<Scalar, Dim, Mode, Options>::translate(
858
+ const MatrixBase<OtherDerived>& other) {
859
+ EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived, int(Dim))
897
860
  translationExt() += linearExt() * other;
898
861
  return *this;
899
862
  }
900
863
 
901
864
  /** Applies on the left the translation matrix represented by the vector \a other
902
- * to \c *this and returns a reference to \c *this.
903
- * \sa translate()
904
- */
905
- template<typename Scalar, int Dim, int Mode, int Options>
906
- template<typename OtherDerived>
907
- EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>&
908
- Transform<Scalar,Dim,Mode,Options>::pretranslate(const MatrixBase<OtherDerived> &other)
909
- {
910
- EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,int(Dim))
911
- if(EIGEN_CONST_CONDITIONAL(int(Mode)==int(Projective)))
865
+ * to \c *this and returns a reference to \c *this.
866
+ * \sa translate()
867
+ */
868
+ template <typename Scalar, int Dim, int Mode, int Options>
869
+ template <typename OtherDerived>
870
+ EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>& Transform<Scalar, Dim, Mode, Options>::pretranslate(
871
+ const MatrixBase<OtherDerived>& other) {
872
+ EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived, int(Dim))
873
+ if (EIGEN_CONST_CONDITIONAL(int(Mode) == int(Projective)))
912
874
  affine() += other * m_matrix.row(Dim);
913
875
  else
914
876
  translation() += other;
@@ -916,76 +878,73 @@ Transform<Scalar,Dim,Mode,Options>::pretranslate(const MatrixBase<OtherDerived>
916
878
  }
917
879
 
918
880
  /** Applies on the right the rotation represented by the rotation \a rotation
919
- * to \c *this and returns a reference to \c *this.
920
- *
921
- * The template parameter \a RotationType is the type of the rotation which
922
- * must be known by internal::toRotationMatrix<>.
923
- *
924
- * Natively supported types includes:
925
- * - any scalar (2D),
926
- * - a Dim x Dim matrix expression,
927
- * - a Quaternion (3D),
928
- * - a AngleAxis (3D)
929
- *
930
- * This mechanism is easily extendable to support user types such as Euler angles,
931
- * or a pair of Quaternion for 4D rotations.
932
- *
933
- * \sa rotate(Scalar), class Quaternion, class AngleAxis, prerotate(RotationType)
934
- */
935
- template<typename Scalar, int Dim, int Mode, int Options>
936
- template<typename RotationType>
937
- EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>&
938
- Transform<Scalar,Dim,Mode,Options>::rotate(const RotationType& rotation)
939
- {
940
- linearExt() *= internal::toRotationMatrix<Scalar,Dim>(rotation);
881
+ * to \c *this and returns a reference to \c *this.
882
+ *
883
+ * The template parameter \a RotationType is the type of the rotation which
884
+ * must be known by internal::toRotationMatrix<>.
885
+ *
886
+ * Natively supported types includes:
887
+ * - any scalar (2D),
888
+ * - a Dim x Dim matrix expression,
889
+ * - a Quaternion (3D),
890
+ * - a AngleAxis (3D)
891
+ *
892
+ * This mechanism is easily extendable to support user types such as Euler angles,
893
+ * or a pair of Quaternion for 4D rotations.
894
+ *
895
+ * \sa rotate(Scalar), class Quaternion, class AngleAxis, prerotate(RotationType)
896
+ */
897
+ template <typename Scalar, int Dim, int Mode, int Options>
898
+ template <typename RotationType>
899
+ EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>& Transform<Scalar, Dim, Mode, Options>::rotate(
900
+ const RotationType& rotation) {
901
+ linearExt() *= internal::toRotationMatrix<Scalar, Dim>(rotation);
941
902
  return *this;
942
903
  }
943
904
 
944
905
  /** Applies on the left the rotation represented by the rotation \a rotation
945
- * to \c *this and returns a reference to \c *this.
946
- *
947
- * See rotate() for further details.
948
- *
949
- * \sa rotate()
950
- */
951
- template<typename Scalar, int Dim, int Mode, int Options>
952
- template<typename RotationType>
953
- EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>&
954
- Transform<Scalar,Dim,Mode,Options>::prerotate(const RotationType& rotation)
955
- {
956
- m_matrix.template block<Dim,HDim>(0,0) = internal::toRotationMatrix<Scalar,Dim>(rotation)
957
- * m_matrix.template block<Dim,HDim>(0,0);
906
+ * to \c *this and returns a reference to \c *this.
907
+ *
908
+ * See rotate() for further details.
909
+ *
910
+ * \sa rotate()
911
+ */
912
+ template <typename Scalar, int Dim, int Mode, int Options>
913
+ template <typename RotationType>
914
+ EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>& Transform<Scalar, Dim, Mode, Options>::prerotate(
915
+ const RotationType& rotation) {
916
+ m_matrix.template block<Dim, HDim>(0, 0) =
917
+ internal::toRotationMatrix<Scalar, Dim>(rotation) * m_matrix.template block<Dim, HDim>(0, 0);
958
918
  return *this;
959
919
  }
960
920
 
961
921
  /** Applies on the right the shear transformation represented
962
- * by the vector \a other to \c *this and returns a reference to \c *this.
963
- * \warning 2D only.
964
- * \sa preshear()
965
- */
966
- template<typename Scalar, int Dim, int Mode, int Options>
967
- EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>&
968
- Transform<Scalar,Dim,Mode,Options>::shear(const Scalar& sx, const Scalar& sy)
969
- {
970
- EIGEN_STATIC_ASSERT(int(Dim)==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
971
- EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
972
- VectorType tmp = linear().col(0)*sy + linear().col(1);
973
- linear() << linear().col(0) + linear().col(1)*sx, tmp;
922
+ * by the vector \a other to \c *this and returns a reference to \c *this.
923
+ * \warning 2D only.
924
+ * \sa preshear()
925
+ */
926
+ template <typename Scalar, int Dim, int Mode, int Options>
927
+ EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>& Transform<Scalar, Dim, Mode, Options>::shear(
928
+ const Scalar& sx, const Scalar& sy) {
929
+ EIGEN_STATIC_ASSERT(int(Dim) == 2, YOU_MADE_A_PROGRAMMING_MISTAKE)
930
+ EIGEN_STATIC_ASSERT(Mode != int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
931
+ VectorType tmp = linear().col(0) * sy + linear().col(1);
932
+ linear() << linear().col(0) + linear().col(1) * sx, tmp;
974
933
  return *this;
975
934
  }
976
935
 
977
936
  /** Applies on the left the shear transformation represented
978
- * by the vector \a other to \c *this and returns a reference to \c *this.
979
- * \warning 2D only.
980
- * \sa shear()
981
- */
982
- template<typename Scalar, int Dim, int Mode, int Options>
983
- EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>&
984
- Transform<Scalar,Dim,Mode,Options>::preshear(const Scalar& sx, const Scalar& sy)
985
- {
986
- EIGEN_STATIC_ASSERT(int(Dim)==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
987
- EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
988
- m_matrix.template block<Dim,HDim>(0,0) = LinearMatrixType(1, sx, sy, 1) * m_matrix.template block<Dim,HDim>(0,0);
937
+ * by the vector \a other to \c *this and returns a reference to \c *this.
938
+ * \warning 2D only.
939
+ * \sa shear()
940
+ */
941
+ template <typename Scalar, int Dim, int Mode, int Options>
942
+ EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>& Transform<Scalar, Dim, Mode, Options>::preshear(
943
+ const Scalar& sx, const Scalar& sy) {
944
+ EIGEN_STATIC_ASSERT(int(Dim) == 2, YOU_MADE_A_PROGRAMMING_MISTAKE)
945
+ EIGEN_STATIC_ASSERT(Mode != int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
946
+ m_matrix.template block<Dim, HDim>(0, 0) =
947
+ LinearMatrixType({{1, sy}, {sx, 1}}) * m_matrix.template block<Dim, HDim>(0, 0);
989
948
  return *this;
990
949
  }
991
950
 
@@ -993,46 +952,46 @@ Transform<Scalar,Dim,Mode,Options>::preshear(const Scalar& sx, const Scalar& sy)
993
952
  *** Scaling, Translation and Rotation compatibility ***
994
953
  ******************************************************/
995
954
 
996
- template<typename Scalar, int Dim, int Mode, int Options>
997
- EIGEN_DEVICE_FUNC inline Transform<Scalar,Dim,Mode,Options>& Transform<Scalar,Dim,Mode,Options>::operator=(const TranslationType& t)
998
- {
955
+ template <typename Scalar, int Dim, int Mode, int Options>
956
+ EIGEN_DEVICE_FUNC inline Transform<Scalar, Dim, Mode, Options>& Transform<Scalar, Dim, Mode, Options>::operator=(
957
+ const TranslationType& t) {
999
958
  linear().setIdentity();
1000
959
  translation() = t.vector();
1001
960
  makeAffine();
1002
961
  return *this;
1003
962
  }
1004
963
 
1005
- template<typename Scalar, int Dim, int Mode, int Options>
1006
- EIGEN_DEVICE_FUNC inline Transform<Scalar,Dim,Mode,Options> Transform<Scalar,Dim,Mode,Options>::operator*(const TranslationType& t) const
1007
- {
964
+ template <typename Scalar, int Dim, int Mode, int Options>
965
+ EIGEN_DEVICE_FUNC inline Transform<Scalar, Dim, Mode, Options> Transform<Scalar, Dim, Mode, Options>::operator*(
966
+ const TranslationType& t) const {
1008
967
  Transform res = *this;
1009
968
  res.translate(t.vector());
1010
969
  return res;
1011
970
  }
1012
971
 
1013
- template<typename Scalar, int Dim, int Mode, int Options>
1014
- EIGEN_DEVICE_FUNC inline Transform<Scalar,Dim,Mode,Options>& Transform<Scalar,Dim,Mode,Options>::operator=(const UniformScaling<Scalar>& s)
1015
- {
972
+ template <typename Scalar, int Dim, int Mode, int Options>
973
+ EIGEN_DEVICE_FUNC inline Transform<Scalar, Dim, Mode, Options>& Transform<Scalar, Dim, Mode, Options>::operator=(
974
+ const UniformScaling<Scalar>& s) {
1016
975
  m_matrix.setZero();
1017
976
  linear().diagonal().fill(s.factor());
1018
977
  makeAffine();
1019
978
  return *this;
1020
979
  }
1021
980
 
1022
- template<typename Scalar, int Dim, int Mode, int Options>
1023
- template<typename Derived>
1024
- EIGEN_DEVICE_FUNC inline Transform<Scalar,Dim,Mode,Options>& Transform<Scalar,Dim,Mode,Options>::operator=(const RotationBase<Derived,Dim>& r)
1025
- {
1026
- linear() = internal::toRotationMatrix<Scalar,Dim>(r);
981
+ template <typename Scalar, int Dim, int Mode, int Options>
982
+ template <typename Derived>
983
+ EIGEN_DEVICE_FUNC inline Transform<Scalar, Dim, Mode, Options>& Transform<Scalar, Dim, Mode, Options>::operator=(
984
+ const RotationBase<Derived, Dim>& r) {
985
+ linear() = internal::toRotationMatrix<Scalar, Dim>(r);
1027
986
  translation().setZero();
1028
987
  makeAffine();
1029
988
  return *this;
1030
989
  }
1031
990
 
1032
- template<typename Scalar, int Dim, int Mode, int Options>
1033
- template<typename Derived>
1034
- EIGEN_DEVICE_FUNC inline Transform<Scalar,Dim,Mode,Options> Transform<Scalar,Dim,Mode,Options>::operator*(const RotationBase<Derived,Dim>& r) const
1035
- {
991
+ template <typename Scalar, int Dim, int Mode, int Options>
992
+ template <typename Derived>
993
+ EIGEN_DEVICE_FUNC inline Transform<Scalar, Dim, Mode, Options> Transform<Scalar, Dim, Mode, Options>::operator*(
994
+ const RotationBase<Derived, Dim>& r) const {
1036
995
  Transform res = *this;
1037
996
  res.rotate(r.derived());
1038
997
  return res;
@@ -1043,115 +1002,112 @@ EIGEN_DEVICE_FUNC inline Transform<Scalar,Dim,Mode,Options> Transform<Scalar,Dim
1043
1002
  ************************/
1044
1003
 
1045
1004
  namespace internal {
1046
- template<int Mode> struct transform_rotation_impl {
1047
- template<typename TransformType>
1048
- EIGEN_DEVICE_FUNC static inline
1049
- const typename TransformType::LinearMatrixType run(const TransformType& t)
1050
- {
1005
+ template <int Mode>
1006
+ struct transform_rotation_impl {
1007
+ template <typename TransformType>
1008
+ EIGEN_DEVICE_FUNC static inline const typename TransformType::LinearMatrixType run(const TransformType& t) {
1051
1009
  typedef typename TransformType::LinearMatrixType LinearMatrixType;
1052
1010
  LinearMatrixType result;
1053
1011
  t.computeRotationScaling(&result, (LinearMatrixType*)0);
1054
1012
  return result;
1055
1013
  }
1056
1014
  };
1057
- template<> struct transform_rotation_impl<Isometry> {
1058
- template<typename TransformType>
1059
- EIGEN_DEVICE_FUNC static inline
1060
- typename TransformType::ConstLinearPart run(const TransformType& t)
1061
- {
1015
+ template <>
1016
+ struct transform_rotation_impl<Isometry> {
1017
+ template <typename TransformType>
1018
+ EIGEN_DEVICE_FUNC static inline typename TransformType::ConstLinearPart run(const TransformType& t) {
1062
1019
  return t.linear();
1063
1020
  }
1064
1021
  };
1065
- }
1022
+ } // namespace internal
1066
1023
  /** \returns the rotation part of the transformation
1067
- *
1068
- * If Mode==Isometry, then this method is an alias for linear(),
1069
- * otherwise it calls computeRotationScaling() to extract the rotation
1070
- * through a SVD decomposition.
1071
- *
1072
- * \svd_module
1073
- *
1074
- * \sa computeRotationScaling(), computeScalingRotation(), class SVD
1075
- */
1076
- template<typename Scalar, int Dim, int Mode, int Options>
1077
- EIGEN_DEVICE_FUNC
1078
- typename Transform<Scalar,Dim,Mode,Options>::RotationReturnType
1079
- Transform<Scalar,Dim,Mode,Options>::rotation() const
1080
- {
1024
+ *
1025
+ * If Mode==Isometry, then this method is an alias for linear(),
1026
+ * otherwise it calls computeRotationScaling() to extract the rotation
1027
+ * through a SVD decomposition.
1028
+ *
1029
+ * \svd_module
1030
+ *
1031
+ * \sa computeRotationScaling(), computeScalingRotation(), class SVD
1032
+ */
1033
+ template <typename Scalar, int Dim, int Mode, int Options>
1034
+ EIGEN_DEVICE_FUNC typename Transform<Scalar, Dim, Mode, Options>::RotationReturnType
1035
+ Transform<Scalar, Dim, Mode, Options>::rotation() const {
1081
1036
  return internal::transform_rotation_impl<Mode>::run(*this);
1082
1037
  }
1083
1038
 
1084
-
1085
1039
  /** decomposes the linear part of the transformation as a product rotation x scaling, the scaling being
1086
- * not necessarily positive.
1087
- *
1088
- * If either pointer is zero, the corresponding computation is skipped.
1089
- *
1090
- *
1091
- *
1092
- * \svd_module
1093
- *
1094
- * \sa computeScalingRotation(), rotation(), class SVD
1095
- */
1096
- template<typename Scalar, int Dim, int Mode, int Options>
1097
- template<typename RotationMatrixType, typename ScalingMatrixType>
1098
- EIGEN_DEVICE_FUNC void Transform<Scalar,Dim,Mode,Options>::computeRotationScaling(RotationMatrixType *rotation, ScalingMatrixType *scaling) const
1099
- {
1040
+ * not necessarily positive.
1041
+ *
1042
+ * If either pointer is zero, the corresponding computation is skipped.
1043
+ *
1044
+ *
1045
+ *
1046
+ * \svd_module
1047
+ *
1048
+ * \sa computeScalingRotation(), rotation(), class SVD
1049
+ */
1050
+ template <typename Scalar, int Dim, int Mode, int Options>
1051
+ template <typename RotationMatrixType, typename ScalingMatrixType>
1052
+ EIGEN_DEVICE_FUNC void Transform<Scalar, Dim, Mode, Options>::computeRotationScaling(RotationMatrixType* rotation,
1053
+ ScalingMatrixType* scaling) const {
1100
1054
  // Note that JacobiSVD is faster than BDCSVD for small matrices.
1101
- JacobiSVD<LinearMatrixType> svd(linear(), ComputeFullU | ComputeFullV);
1055
+ JacobiSVD<LinearMatrixType, ComputeFullU | ComputeFullV> svd(linear());
1102
1056
 
1103
- Scalar x = (svd.matrixU() * svd.matrixV().adjoint()).determinant() < Scalar(0) ? Scalar(-1) : Scalar(1); // so x has absolute value 1
1057
+ Scalar x = (svd.matrixU() * svd.matrixV().adjoint()).determinant() < Scalar(0)
1058
+ ? Scalar(-1)
1059
+ : Scalar(1); // so x has absolute value 1
1104
1060
  VectorType sv(svd.singularValues());
1105
- sv.coeffRef(Dim-1) *= x;
1106
- if(scaling) *scaling = svd.matrixV() * sv.asDiagonal() * svd.matrixV().adjoint();
1107
- if(rotation)
1108
- {
1061
+ sv.coeffRef(Dim - 1) *= x;
1062
+ if (scaling) (*scaling).noalias() = svd.matrixV() * sv.asDiagonal() * svd.matrixV().adjoint();
1063
+ if (rotation) {
1109
1064
  LinearMatrixType m(svd.matrixU());
1110
- m.col(Dim-1) *= x;
1111
- *rotation = m * svd.matrixV().adjoint();
1065
+ m.col(Dim - 1) *= x;
1066
+ (*rotation).noalias() = m * svd.matrixV().adjoint();
1112
1067
  }
1113
1068
  }
1114
1069
 
1115
1070
  /** decomposes the linear part of the transformation as a product scaling x rotation, the scaling being
1116
- * not necessarily positive.
1117
- *
1118
- * If either pointer is zero, the corresponding computation is skipped.
1119
- *
1120
- *
1121
- *
1122
- * \svd_module
1123
- *
1124
- * \sa computeRotationScaling(), rotation(), class SVD
1125
- */
1126
- template<typename Scalar, int Dim, int Mode, int Options>
1127
- template<typename ScalingMatrixType, typename RotationMatrixType>
1128
- EIGEN_DEVICE_FUNC void Transform<Scalar,Dim,Mode,Options>::computeScalingRotation(ScalingMatrixType *scaling, RotationMatrixType *rotation) const
1129
- {
1071
+ * not necessarily positive.
1072
+ *
1073
+ * If either pointer is zero, the corresponding computation is skipped.
1074
+ *
1075
+ *
1076
+ *
1077
+ * \svd_module
1078
+ *
1079
+ * \sa computeRotationScaling(), rotation(), class SVD
1080
+ */
1081
+ template <typename Scalar, int Dim, int Mode, int Options>
1082
+ template <typename ScalingMatrixType, typename RotationMatrixType>
1083
+ EIGEN_DEVICE_FUNC void Transform<Scalar, Dim, Mode, Options>::computeScalingRotation(
1084
+ ScalingMatrixType* scaling, RotationMatrixType* rotation) const {
1130
1085
  // Note that JacobiSVD is faster than BDCSVD for small matrices.
1131
- JacobiSVD<LinearMatrixType> svd(linear(), ComputeFullU | ComputeFullV);
1086
+ JacobiSVD<LinearMatrixType, ComputeFullU | ComputeFullV> svd(linear());
1132
1087
 
1133
- Scalar x = (svd.matrixU() * svd.matrixV().adjoint()).determinant() < Scalar(0) ? Scalar(-1) : Scalar(1); // so x has absolute value 1
1088
+ Scalar x = (svd.matrixU() * svd.matrixV().adjoint()).determinant() < Scalar(0)
1089
+ ? Scalar(-1)
1090
+ : Scalar(1); // so x has absolute value 1
1134
1091
  VectorType sv(svd.singularValues());
1135
- sv.coeffRef(Dim-1) *= x;
1136
- if(scaling) *scaling = svd.matrixU() * sv.asDiagonal() * svd.matrixU().adjoint();
1137
- if(rotation)
1138
- {
1092
+ sv.coeffRef(Dim - 1) *= x;
1093
+ if (scaling) *scaling = svd.matrixU() * sv.asDiagonal() * svd.matrixU().adjoint();
1094
+ if (rotation) {
1139
1095
  LinearMatrixType m(svd.matrixU());
1140
- m.col(Dim-1) *= x;
1096
+ m.col(Dim - 1) *= x;
1141
1097
  *rotation = m * svd.matrixV().adjoint();
1142
1098
  }
1143
1099
  }
1144
1100
 
1145
1101
  /** Convenient method to set \c *this from a position, orientation and scale
1146
- * of a 3D object.
1147
- */
1148
- template<typename Scalar, int Dim, int Mode, int Options>
1149
- template<typename PositionDerived, typename OrientationType, typename ScaleDerived>
1150
- EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>&
1151
- Transform<Scalar,Dim,Mode,Options>::fromPositionOrientationScale(const MatrixBase<PositionDerived> &position,
1152
- const OrientationType& orientation, const MatrixBase<ScaleDerived> &scale)
1153
- {
1154
- linear() = internal::toRotationMatrix<Scalar,Dim>(orientation);
1102
+ * of a 3D object.
1103
+ */
1104
+ template <typename Scalar, int Dim, int Mode, int Options>
1105
+ template <typename PositionDerived, typename OrientationType, typename ScaleDerived>
1106
+ EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>&
1107
+ Transform<Scalar, Dim, Mode, Options>::fromPositionOrientationScale(const MatrixBase<PositionDerived>& position,
1108
+ const OrientationType& orientation,
1109
+ const MatrixBase<ScaleDerived>& scale) {
1110
+ linear() = internal::toRotationMatrix<Scalar, Dim>(orientation);
1155
1111
  linear() *= scale.asDiagonal();
1156
1112
  translation() = position;
1157
1113
  makeAffine();
@@ -1160,91 +1116,75 @@ Transform<Scalar,Dim,Mode,Options>::fromPositionOrientationScale(const MatrixBas
1160
1116
 
1161
1117
  namespace internal {
1162
1118
 
1163
- template<int Mode>
1164
- struct transform_make_affine
1165
- {
1166
- template<typename MatrixType>
1167
- EIGEN_DEVICE_FUNC static void run(MatrixType &mat)
1168
- {
1169
- static const int Dim = MatrixType::ColsAtCompileTime-1;
1170
- mat.template block<1,Dim>(Dim,0).setZero();
1171
- mat.coeffRef(Dim,Dim) = typename MatrixType::Scalar(1);
1119
+ template <int Mode>
1120
+ struct transform_make_affine {
1121
+ template <typename MatrixType>
1122
+ EIGEN_DEVICE_FUNC static void run(MatrixType& mat) {
1123
+ static const int Dim = MatrixType::ColsAtCompileTime - 1;
1124
+ mat.template block<1, Dim>(Dim, 0).setZero();
1125
+ mat.coeffRef(Dim, Dim) = typename MatrixType::Scalar(1);
1172
1126
  }
1173
1127
  };
1174
1128
 
1175
- template<>
1176
- struct transform_make_affine<AffineCompact>
1177
- {
1178
- template<typename MatrixType> EIGEN_DEVICE_FUNC static void run(MatrixType &) { }
1129
+ template <>
1130
+ struct transform_make_affine<AffineCompact> {
1131
+ template <typename MatrixType>
1132
+ EIGEN_DEVICE_FUNC static void run(MatrixType&) {}
1179
1133
  };
1180
1134
 
1181
1135
  // selector needed to avoid taking the inverse of a 3x4 matrix
1182
- template<typename TransformType, int Mode=TransformType::Mode>
1183
- struct projective_transform_inverse
1184
- {
1185
- EIGEN_DEVICE_FUNC static inline void run(const TransformType&, TransformType&)
1186
- {}
1136
+ template <typename TransformType, int Mode = TransformType::Mode>
1137
+ struct projective_transform_inverse {
1138
+ EIGEN_DEVICE_FUNC static inline void run(const TransformType&, TransformType&) {}
1187
1139
  };
1188
1140
 
1189
- template<typename TransformType>
1190
- struct projective_transform_inverse<TransformType, Projective>
1191
- {
1192
- EIGEN_DEVICE_FUNC static inline void run(const TransformType& m, TransformType& res)
1193
- {
1141
+ template <typename TransformType>
1142
+ struct projective_transform_inverse<TransformType, Projective> {
1143
+ EIGEN_DEVICE_FUNC static inline void run(const TransformType& m, TransformType& res) {
1194
1144
  res.matrix() = m.matrix().inverse();
1195
1145
  }
1196
1146
  };
1197
1147
 
1198
- } // end namespace internal
1199
-
1148
+ } // end namespace internal
1200
1149
 
1201
1150
  /**
1202
- *
1203
- * \returns the inverse transformation according to some given knowledge
1204
- * on \c *this.
1205
- *
1206
- * \param hint allows to optimize the inversion process when the transformation
1207
- * is known to be not a general transformation (optional). The possible values are:
1208
- * - #Projective if the transformation is not necessarily affine, i.e., if the
1209
- * last row is not guaranteed to be [0 ... 0 1]
1210
- * - #Affine if the last row can be assumed to be [0 ... 0 1]
1211
- * - #Isometry if the transformation is only a concatenations of translations
1212
- * and rotations.
1213
- * The default is the template class parameter \c Mode.
1214
- *
1215
- * \warning unless \a traits is always set to NoShear or NoScaling, this function
1216
- * requires the generic inverse method of MatrixBase defined in the LU module. If
1217
- * you forget to include this module, then you will get hard to debug linking errors.
1218
- *
1219
- * \sa MatrixBase::inverse()
1220
- */
1221
- template<typename Scalar, int Dim, int Mode, int Options>
1222
- EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>
1223
- Transform<Scalar,Dim,Mode,Options>::inverse(TransformTraits hint) const
1224
- {
1151
+ *
1152
+ * \returns the inverse transformation according to some given knowledge
1153
+ * on \c *this.
1154
+ *
1155
+ * \param hint allows to optimize the inversion process when the transformation
1156
+ * is known to be not a general transformation (optional). The possible values are:
1157
+ * - #Projective if the transformation is not necessarily affine, i.e., if the
1158
+ * last row is not guaranteed to be [0 ... 0 1]
1159
+ * - #Affine if the last row can be assumed to be [0 ... 0 1]
1160
+ * - #Isometry if the transformation is only a concatenations of translations
1161
+ * and rotations.
1162
+ * The default is the template class parameter \c Mode.
1163
+ *
1164
+ * \warning unless \a traits is always set to NoShear or NoScaling, this function
1165
+ * requires the generic inverse method of MatrixBase defined in the LU module. If
1166
+ * you forget to include this module, then you will get hard to debug linking errors.
1167
+ *
1168
+ * \sa MatrixBase::inverse()
1169
+ */
1170
+ template <typename Scalar, int Dim, int Mode, int Options>
1171
+ EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options> Transform<Scalar, Dim, Mode, Options>::inverse(
1172
+ TransformTraits hint) const {
1225
1173
  Transform res;
1226
- if (hint == Projective)
1227
- {
1174
+ if (hint == Projective) {
1228
1175
  internal::projective_transform_inverse<Transform>::run(*this, res);
1229
- }
1230
- else
1231
- {
1232
- if (hint == Isometry)
1233
- {
1234
- res.matrix().template topLeftCorner<Dim,Dim>() = linear().transpose();
1235
- }
1236
- else if(hint&Affine)
1237
- {
1238
- res.matrix().template topLeftCorner<Dim,Dim>() = linear().inverse();
1239
- }
1240
- else
1241
- {
1176
+ } else {
1177
+ if (hint == Isometry) {
1178
+ res.matrix().template topLeftCorner<Dim, Dim>() = linear().transpose();
1179
+ } else if (hint & Affine) {
1180
+ res.matrix().template topLeftCorner<Dim, Dim>() = linear().inverse();
1181
+ } else {
1242
1182
  eigen_assert(false && "Invalid transform traits in Transform::Inverse");
1243
1183
  }
1244
1184
  // translation and remaining parts
1245
- res.matrix().template topRightCorner<Dim,1>()
1246
- = - res.matrix().template topLeftCorner<Dim,Dim>() * translation();
1247
- res.makeAffine(); // we do need this, because in the beginning res is uninitialized
1185
+ res.matrix().template topRightCorner<Dim, 1>().noalias() =
1186
+ -res.matrix().template topLeftCorner<Dim, Dim>() * translation();
1187
+ res.makeAffine(); // we do need this, because in the beginning res is uninitialized
1248
1188
  }
1249
1189
  return res;
1250
1190
  }
@@ -1255,93 +1195,91 @@ namespace internal {
1255
1195
  *** Specializations of take affine part ***
1256
1196
  *****************************************************/
1257
1197
 
1258
- template<typename TransformType> struct transform_take_affine_part {
1198
+ template <typename TransformType>
1199
+ struct transform_take_affine_part {
1259
1200
  typedef typename TransformType::MatrixType MatrixType;
1260
1201
  typedef typename TransformType::AffinePart AffinePart;
1261
1202
  typedef typename TransformType::ConstAffinePart ConstAffinePart;
1262
- static inline AffinePart run(MatrixType& m)
1263
- { return m.template block<TransformType::Dim,TransformType::HDim>(0,0); }
1264
- static inline ConstAffinePart run(const MatrixType& m)
1265
- { return m.template block<TransformType::Dim,TransformType::HDim>(0,0); }
1203
+ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE AffinePart run(MatrixType& m) {
1204
+ return m.template block<TransformType::Dim, TransformType::HDim>(0, 0);
1205
+ }
1206
+ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ConstAffinePart run(const MatrixType& m) {
1207
+ return m.template block<TransformType::Dim, TransformType::HDim>(0, 0);
1208
+ }
1266
1209
  };
1267
1210
 
1268
- template<typename Scalar, int Dim, int Options>
1269
- struct transform_take_affine_part<Transform<Scalar,Dim,AffineCompact, Options> > {
1270
- typedef typename Transform<Scalar,Dim,AffineCompact,Options>::MatrixType MatrixType;
1271
- static inline MatrixType& run(MatrixType& m) { return m; }
1272
- static inline const MatrixType& run(const MatrixType& m) { return m; }
1211
+ template <typename Scalar, int Dim, int Options>
1212
+ struct transform_take_affine_part<Transform<Scalar, Dim, AffineCompact, Options> > {
1213
+ typedef typename Transform<Scalar, Dim, AffineCompact, Options>::MatrixType MatrixType;
1214
+ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE MatrixType& run(MatrixType& m) { return m; }
1215
+ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixType& run(const MatrixType& m) { return m; }
1273
1216
  };
1274
1217
 
1275
1218
  /*****************************************************
1276
1219
  *** Specializations of construct from matrix ***
1277
1220
  *****************************************************/
1278
1221
 
1279
- template<typename Other, int Mode, int Options, int Dim, int HDim>
1280
- struct transform_construct_from_matrix<Other, Mode,Options,Dim,HDim, Dim,Dim>
1281
- {
1282
- static inline void run(Transform<typename Other::Scalar,Dim,Mode,Options> *transform, const Other& other)
1283
- {
1222
+ template <typename Other, int Mode, int Options, int Dim, int HDim>
1223
+ struct transform_construct_from_matrix<Other, Mode, Options, Dim, HDim, Dim, Dim> {
1224
+ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(
1225
+ Transform<typename Other::Scalar, Dim, Mode, Options>* transform, const Other& other) {
1284
1226
  transform->linear() = other;
1285
1227
  transform->translation().setZero();
1286
1228
  transform->makeAffine();
1287
1229
  }
1288
1230
  };
1289
1231
 
1290
- template<typename Other, int Mode, int Options, int Dim, int HDim>
1291
- struct transform_construct_from_matrix<Other, Mode,Options,Dim,HDim, Dim,HDim>
1292
- {
1293
- static inline void run(Transform<typename Other::Scalar,Dim,Mode,Options> *transform, const Other& other)
1294
- {
1232
+ template <typename Other, int Mode, int Options, int Dim, int HDim>
1233
+ struct transform_construct_from_matrix<Other, Mode, Options, Dim, HDim, Dim, HDim> {
1234
+ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(
1235
+ Transform<typename Other::Scalar, Dim, Mode, Options>* transform, const Other& other) {
1295
1236
  transform->affine() = other;
1296
1237
  transform->makeAffine();
1297
1238
  }
1298
1239
  };
1299
1240
 
1300
- template<typename Other, int Mode, int Options, int Dim, int HDim>
1301
- struct transform_construct_from_matrix<Other, Mode,Options,Dim,HDim, HDim,HDim>
1302
- {
1303
- static inline void run(Transform<typename Other::Scalar,Dim,Mode,Options> *transform, const Other& other)
1304
- { transform->matrix() = other; }
1241
+ template <typename Other, int Mode, int Options, int Dim, int HDim>
1242
+ struct transform_construct_from_matrix<Other, Mode, Options, Dim, HDim, HDim, HDim> {
1243
+ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(
1244
+ Transform<typename Other::Scalar, Dim, Mode, Options>* transform, const Other& other) {
1245
+ transform->matrix() = other;
1246
+ }
1305
1247
  };
1306
1248
 
1307
- template<typename Other, int Options, int Dim, int HDim>
1308
- struct transform_construct_from_matrix<Other, AffineCompact,Options,Dim,HDim, HDim,HDim>
1309
- {
1310
- static inline void run(Transform<typename Other::Scalar,Dim,AffineCompact,Options> *transform, const Other& other)
1311
- { transform->matrix() = other.template block<Dim,HDim>(0,0); }
1249
+ template <typename Other, int Options, int Dim, int HDim>
1250
+ struct transform_construct_from_matrix<Other, AffineCompact, Options, Dim, HDim, HDim, HDim> {
1251
+ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(
1252
+ Transform<typename Other::Scalar, Dim, AffineCompact, Options>* transform, const Other& other) {
1253
+ transform->matrix() = other.template block<Dim, HDim>(0, 0);
1254
+ }
1312
1255
  };
1313
1256
 
1314
1257
  /**********************************************************
1315
1258
  *** Specializations of operator* with rhs EigenBase ***
1316
1259
  **********************************************************/
1317
1260
 
1318
- template<int LhsMode,int RhsMode>
1319
- struct transform_product_result
1320
- {
1321
- enum
1322
- {
1323
- Mode =
1324
- (LhsMode == (int)Projective || RhsMode == (int)Projective ) ? Projective :
1325
- (LhsMode == (int)Affine || RhsMode == (int)Affine ) ? Affine :
1326
- (LhsMode == (int)AffineCompact || RhsMode == (int)AffineCompact ) ? AffineCompact :
1327
- (LhsMode == (int)Isometry || RhsMode == (int)Isometry ) ? Isometry : Projective
1261
+ template <int LhsMode, int RhsMode>
1262
+ struct transform_product_result {
1263
+ enum {
1264
+ Mode = (LhsMode == (int)Projective || RhsMode == (int)Projective) ? Projective
1265
+ : (LhsMode == (int)Affine || RhsMode == (int)Affine) ? Affine
1266
+ : (LhsMode == (int)AffineCompact || RhsMode == (int)AffineCompact) ? AffineCompact
1267
+ : (LhsMode == (int)Isometry || RhsMode == (int)Isometry) ? Isometry
1268
+ : Projective
1328
1269
  };
1329
1270
  };
1330
1271
 
1331
- template< typename TransformType, typename MatrixType, int RhsCols>
1332
- struct transform_right_product_impl< TransformType, MatrixType, 0, RhsCols>
1333
- {
1272
+ template <typename TransformType, typename MatrixType, int RhsCols>
1273
+ struct transform_right_product_impl<TransformType, MatrixType, 0, RhsCols> {
1334
1274
  typedef typename MatrixType::PlainObject ResultType;
1335
1275
 
1336
- static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType run(const TransformType& T, const MatrixType& other)
1337
- {
1276
+ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType run(const TransformType& T, const MatrixType& other) {
1338
1277
  return T.matrix() * other;
1339
1278
  }
1340
1279
  };
1341
1280
 
1342
- template< typename TransformType, typename MatrixType, int RhsCols>
1343
- struct transform_right_product_impl< TransformType, MatrixType, 1, RhsCols>
1344
- {
1281
+ template <typename TransformType, typename MatrixType, int RhsCols>
1282
+ struct transform_right_product_impl<TransformType, MatrixType, 1, RhsCols> {
1345
1283
  enum {
1346
1284
  Dim = TransformType::Dim,
1347
1285
  HDim = TransformType::HDim,
@@ -1351,23 +1289,21 @@ struct transform_right_product_impl< TransformType, MatrixType, 1, RhsCols>
1351
1289
 
1352
1290
  typedef typename MatrixType::PlainObject ResultType;
1353
1291
 
1354
- static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType run(const TransformType& T, const MatrixType& other)
1355
- {
1356
- EIGEN_STATIC_ASSERT(OtherRows==HDim, YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES);
1292
+ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType run(const TransformType& T, const MatrixType& other) {
1293
+ EIGEN_STATIC_ASSERT(OtherRows == HDim, YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES);
1357
1294
 
1358
- typedef Block<ResultType, Dim, OtherCols, int(MatrixType::RowsAtCompileTime)==Dim> TopLeftLhs;
1295
+ typedef Block<ResultType, Dim, OtherCols, int(MatrixType::RowsAtCompileTime) == Dim> TopLeftLhs;
1359
1296
 
1360
- ResultType res(other.rows(),other.cols());
1297
+ ResultType res(other.rows(), other.cols());
1361
1298
  TopLeftLhs(res, 0, 0, Dim, other.cols()).noalias() = T.affine() * other;
1362
- res.row(OtherRows-1) = other.row(OtherRows-1);
1299
+ res.row(OtherRows - 1) = other.row(OtherRows - 1);
1363
1300
 
1364
1301
  return res;
1365
1302
  }
1366
1303
  };
1367
1304
 
1368
- template< typename TransformType, typename MatrixType, int RhsCols>
1369
- struct transform_right_product_impl< TransformType, MatrixType, 2, RhsCols>
1370
- {
1305
+ template <typename TransformType, typename MatrixType, int RhsCols>
1306
+ struct transform_right_product_impl<TransformType, MatrixType, 2, RhsCols> {
1371
1307
  enum {
1372
1308
  Dim = TransformType::Dim,
1373
1309
  HDim = TransformType::HDim,
@@ -1377,37 +1313,37 @@ struct transform_right_product_impl< TransformType, MatrixType, 2, RhsCols>
1377
1313
 
1378
1314
  typedef typename MatrixType::PlainObject ResultType;
1379
1315
 
1380
- static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType run(const TransformType& T, const MatrixType& other)
1381
- {
1382
- EIGEN_STATIC_ASSERT(OtherRows==Dim, YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES);
1316
+ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType run(const TransformType& T, const MatrixType& other) {
1317
+ EIGEN_STATIC_ASSERT(OtherRows == Dim, YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES);
1383
1318
 
1384
1319
  typedef Block<ResultType, Dim, OtherCols, true> TopLeftLhs;
1385
- ResultType res(Replicate<typename TransformType::ConstTranslationPart, 1, OtherCols>(T.translation(),1,other.cols()));
1320
+ ResultType res(
1321
+ Replicate<typename TransformType::ConstTranslationPart, 1, OtherCols>(T.translation(), 1, other.cols()));
1386
1322
  TopLeftLhs(res, 0, 0, Dim, other.cols()).noalias() += T.linear() * other;
1387
1323
 
1388
1324
  return res;
1389
1325
  }
1390
1326
  };
1391
1327
 
1392
- template< typename TransformType, typename MatrixType >
1393
- struct transform_right_product_impl< TransformType, MatrixType, 2, 1> // rhs is a vector of size Dim
1328
+ template <typename TransformType, typename MatrixType>
1329
+ struct transform_right_product_impl<TransformType, MatrixType, 2, 1> // rhs is a vector of size Dim
1394
1330
  {
1395
1331
  typedef typename TransformType::MatrixType TransformMatrix;
1396
1332
  enum {
1397
1333
  Dim = TransformType::Dim,
1398
1334
  HDim = TransformType::HDim,
1399
1335
  OtherRows = MatrixType::RowsAtCompileTime,
1400
- WorkingRows = EIGEN_PLAIN_ENUM_MIN(TransformMatrix::RowsAtCompileTime,HDim)
1336
+ WorkingRows = plain_enum_min(TransformMatrix::RowsAtCompileTime, HDim)
1401
1337
  };
1402
1338
 
1403
1339
  typedef typename MatrixType::PlainObject ResultType;
1404
1340
 
1405
- static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType run(const TransformType& T, const MatrixType& other)
1406
- {
1407
- EIGEN_STATIC_ASSERT(OtherRows==Dim, YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES);
1341
+ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType run(const TransformType& T, const MatrixType& other) {
1342
+ EIGEN_STATIC_ASSERT(OtherRows == Dim, YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES);
1408
1343
 
1409
- Matrix<typename ResultType::Scalar, Dim+1, 1> rhs;
1410
- rhs.template head<Dim>() = other; rhs[Dim] = typename ResultType::Scalar(1);
1344
+ Matrix<typename ResultType::Scalar, Dim + 1, 1> rhs;
1345
+ rhs.template head<Dim>() = other;
1346
+ rhs[Dim] = typename ResultType::Scalar(1);
1411
1347
  Matrix<typename ResultType::Scalar, WorkingRows, 1> res(T.matrix() * rhs);
1412
1348
  return res.template head<Dim>();
1413
1349
  }
@@ -1418,41 +1354,37 @@ struct transform_right_product_impl< TransformType, MatrixType, 2, 1> // rhs is
1418
1354
  **********************************************************/
1419
1355
 
1420
1356
  // generic HDim x HDim matrix * T => Projective
1421
- template<typename Other,int Mode, int Options, int Dim, int HDim>
1422
- struct transform_left_product_impl<Other,Mode,Options,Dim,HDim, HDim,HDim>
1423
- {
1424
- typedef Transform<typename Other::Scalar,Dim,Mode,Options> TransformType;
1357
+ template <typename Other, int Mode, int Options, int Dim, int HDim>
1358
+ struct transform_left_product_impl<Other, Mode, Options, Dim, HDim, HDim, HDim> {
1359
+ typedef Transform<typename Other::Scalar, Dim, Mode, Options> TransformType;
1425
1360
  typedef typename TransformType::MatrixType MatrixType;
1426
- typedef Transform<typename Other::Scalar,Dim,Projective,Options> ResultType;
1427
- static ResultType run(const Other& other,const TransformType& tr)
1428
- { return ResultType(other * tr.matrix()); }
1361
+ typedef Transform<typename Other::Scalar, Dim, Projective, Options> ResultType;
1362
+ static EIGEN_DEVICE_FUNC ResultType run(const Other& other, const TransformType& tr) {
1363
+ return ResultType(other * tr.matrix());
1364
+ }
1429
1365
  };
1430
1366
 
1431
1367
  // generic HDim x HDim matrix * AffineCompact => Projective
1432
- template<typename Other, int Options, int Dim, int HDim>
1433
- struct transform_left_product_impl<Other,AffineCompact,Options,Dim,HDim, HDim,HDim>
1434
- {
1435
- typedef Transform<typename Other::Scalar,Dim,AffineCompact,Options> TransformType;
1368
+ template <typename Other, int Options, int Dim, int HDim>
1369
+ struct transform_left_product_impl<Other, AffineCompact, Options, Dim, HDim, HDim, HDim> {
1370
+ typedef Transform<typename Other::Scalar, Dim, AffineCompact, Options> TransformType;
1436
1371
  typedef typename TransformType::MatrixType MatrixType;
1437
- typedef Transform<typename Other::Scalar,Dim,Projective,Options> ResultType;
1438
- static ResultType run(const Other& other,const TransformType& tr)
1439
- {
1372
+ typedef Transform<typename Other::Scalar, Dim, Projective, Options> ResultType;
1373
+ static EIGEN_DEVICE_FUNC ResultType run(const Other& other, const TransformType& tr) {
1440
1374
  ResultType res;
1441
- res.matrix().noalias() = other.template block<HDim,Dim>(0,0) * tr.matrix();
1375
+ res.matrix().noalias() = other.template block<HDim, Dim>(0, 0) * tr.matrix();
1442
1376
  res.matrix().col(Dim) += other.col(Dim);
1443
1377
  return res;
1444
1378
  }
1445
1379
  };
1446
1380
 
1447
1381
  // affine matrix * T
1448
- template<typename Other,int Mode, int Options, int Dim, int HDim>
1449
- struct transform_left_product_impl<Other,Mode,Options,Dim,HDim, Dim,HDim>
1450
- {
1451
- typedef Transform<typename Other::Scalar,Dim,Mode,Options> TransformType;
1382
+ template <typename Other, int Mode, int Options, int Dim, int HDim>
1383
+ struct transform_left_product_impl<Other, Mode, Options, Dim, HDim, Dim, HDim> {
1384
+ typedef Transform<typename Other::Scalar, Dim, Mode, Options> TransformType;
1452
1385
  typedef typename TransformType::MatrixType MatrixType;
1453
1386
  typedef TransformType ResultType;
1454
- static ResultType run(const Other& other,const TransformType& tr)
1455
- {
1387
+ static EIGEN_DEVICE_FUNC ResultType run(const Other& other, const TransformType& tr) {
1456
1388
  ResultType res;
1457
1389
  res.affine().noalias() = other * tr.matrix();
1458
1390
  res.matrix().row(Dim) = tr.matrix().row(Dim);
@@ -1461,35 +1393,29 @@ struct transform_left_product_impl<Other,Mode,Options,Dim,HDim, Dim,HDim>
1461
1393
  };
1462
1394
 
1463
1395
  // affine matrix * AffineCompact
1464
- template<typename Other, int Options, int Dim, int HDim>
1465
- struct transform_left_product_impl<Other,AffineCompact,Options,Dim,HDim, Dim,HDim>
1466
- {
1467
- typedef Transform<typename Other::Scalar,Dim,AffineCompact,Options> TransformType;
1396
+ template <typename Other, int Options, int Dim, int HDim>
1397
+ struct transform_left_product_impl<Other, AffineCompact, Options, Dim, HDim, Dim, HDim> {
1398
+ typedef Transform<typename Other::Scalar, Dim, AffineCompact, Options> TransformType;
1468
1399
  typedef typename TransformType::MatrixType MatrixType;
1469
1400
  typedef TransformType ResultType;
1470
- static ResultType run(const Other& other,const TransformType& tr)
1471
- {
1401
+ static EIGEN_DEVICE_FUNC ResultType run(const Other& other, const TransformType& tr) {
1472
1402
  ResultType res;
1473
- res.matrix().noalias() = other.template block<Dim,Dim>(0,0) * tr.matrix();
1403
+ res.matrix().noalias() = other.template block<Dim, Dim>(0, 0) * tr.matrix();
1474
1404
  res.translation() += other.col(Dim);
1475
1405
  return res;
1476
1406
  }
1477
1407
  };
1478
1408
 
1479
1409
  // linear matrix * T
1480
- template<typename Other,int Mode, int Options, int Dim, int HDim>
1481
- struct transform_left_product_impl<Other,Mode,Options,Dim,HDim, Dim,Dim>
1482
- {
1483
- typedef Transform<typename Other::Scalar,Dim,Mode,Options> TransformType;
1410
+ template <typename Other, int Mode, int Options, int Dim, int HDim>
1411
+ struct transform_left_product_impl<Other, Mode, Options, Dim, HDim, Dim, Dim> {
1412
+ typedef Transform<typename Other::Scalar, Dim, Mode, Options> TransformType;
1484
1413
  typedef typename TransformType::MatrixType MatrixType;
1485
1414
  typedef TransformType ResultType;
1486
- static ResultType run(const Other& other, const TransformType& tr)
1487
- {
1415
+ static EIGEN_DEVICE_FUNC ResultType run(const Other& other, const TransformType& tr) {
1488
1416
  TransformType res;
1489
- if(Mode!=int(AffineCompact))
1490
- res.matrix().row(Dim) = tr.matrix().row(Dim);
1491
- res.matrix().template topRows<Dim>().noalias()
1492
- = other * tr.matrix().template topRows<Dim>();
1417
+ if (Mode != int(AffineCompact)) res.matrix().row(Dim) = tr.matrix().row(Dim);
1418
+ res.matrix().template topRows<Dim>().noalias() = other * tr.matrix().template topRows<Dim>();
1493
1419
  return res;
1494
1420
  }
1495
1421
  };
@@ -1498,43 +1424,40 @@ struct transform_left_product_impl<Other,Mode,Options,Dim,HDim, Dim,Dim>
1498
1424
  *** Specializations of operator* with another Transform ***
1499
1425
  **********************************************************/
1500
1426
 
1501
- template<typename Scalar, int Dim, int LhsMode, int LhsOptions, int RhsMode, int RhsOptions>
1502
- struct transform_transform_product_impl<Transform<Scalar,Dim,LhsMode,LhsOptions>,Transform<Scalar,Dim,RhsMode,RhsOptions>,false >
1503
- {
1504
- enum { ResultMode = transform_product_result<LhsMode,RhsMode>::Mode };
1505
- typedef Transform<Scalar,Dim,LhsMode,LhsOptions> Lhs;
1506
- typedef Transform<Scalar,Dim,RhsMode,RhsOptions> Rhs;
1507
- typedef Transform<Scalar,Dim,ResultMode,LhsOptions> ResultType;
1508
- static ResultType run(const Lhs& lhs, const Rhs& rhs)
1509
- {
1427
+ template <typename Scalar, int Dim, int LhsMode, int LhsOptions, int RhsMode, int RhsOptions>
1428
+ struct transform_transform_product_impl<Transform<Scalar, Dim, LhsMode, LhsOptions>,
1429
+ Transform<Scalar, Dim, RhsMode, RhsOptions>, false> {
1430
+ enum { ResultMode = transform_product_result<LhsMode, RhsMode>::Mode };
1431
+ typedef Transform<Scalar, Dim, LhsMode, LhsOptions> Lhs;
1432
+ typedef Transform<Scalar, Dim, RhsMode, RhsOptions> Rhs;
1433
+ typedef Transform<Scalar, Dim, ResultMode, LhsOptions> ResultType;
1434
+ static EIGEN_DEVICE_FUNC ResultType run(const Lhs& lhs, const Rhs& rhs) {
1510
1435
  ResultType res;
1511
- res.linear() = lhs.linear() * rhs.linear();
1436
+ res.linear().noalias() = lhs.linear() * rhs.linear();
1512
1437
  res.translation() = lhs.linear() * rhs.translation() + lhs.translation();
1513
1438
  res.makeAffine();
1514
1439
  return res;
1515
1440
  }
1516
1441
  };
1517
1442
 
1518
- template<typename Scalar, int Dim, int LhsMode, int LhsOptions, int RhsMode, int RhsOptions>
1519
- struct transform_transform_product_impl<Transform<Scalar,Dim,LhsMode,LhsOptions>,Transform<Scalar,Dim,RhsMode,RhsOptions>,true >
1520
- {
1521
- typedef Transform<Scalar,Dim,LhsMode,LhsOptions> Lhs;
1522
- typedef Transform<Scalar,Dim,RhsMode,RhsOptions> Rhs;
1523
- typedef Transform<Scalar,Dim,Projective> ResultType;
1524
- static ResultType run(const Lhs& lhs, const Rhs& rhs)
1525
- {
1526
- return ResultType( lhs.matrix() * rhs.matrix() );
1443
+ template <typename Scalar, int Dim, int LhsMode, int LhsOptions, int RhsMode, int RhsOptions>
1444
+ struct transform_transform_product_impl<Transform<Scalar, Dim, LhsMode, LhsOptions>,
1445
+ Transform<Scalar, Dim, RhsMode, RhsOptions>, true> {
1446
+ typedef Transform<Scalar, Dim, LhsMode, LhsOptions> Lhs;
1447
+ typedef Transform<Scalar, Dim, RhsMode, RhsOptions> Rhs;
1448
+ typedef Transform<Scalar, Dim, Projective> ResultType;
1449
+ static EIGEN_DEVICE_FUNC ResultType run(const Lhs& lhs, const Rhs& rhs) {
1450
+ return ResultType(lhs.matrix() * rhs.matrix());
1527
1451
  }
1528
1452
  };
1529
1453
 
1530
- template<typename Scalar, int Dim, int LhsOptions, int RhsOptions>
1531
- struct transform_transform_product_impl<Transform<Scalar,Dim,AffineCompact,LhsOptions>,Transform<Scalar,Dim,Projective,RhsOptions>,true >
1532
- {
1533
- typedef Transform<Scalar,Dim,AffineCompact,LhsOptions> Lhs;
1534
- typedef Transform<Scalar,Dim,Projective,RhsOptions> Rhs;
1535
- typedef Transform<Scalar,Dim,Projective> ResultType;
1536
- static ResultType run(const Lhs& lhs, const Rhs& rhs)
1537
- {
1454
+ template <typename Scalar, int Dim, int LhsOptions, int RhsOptions>
1455
+ struct transform_transform_product_impl<Transform<Scalar, Dim, AffineCompact, LhsOptions>,
1456
+ Transform<Scalar, Dim, Projective, RhsOptions>, true> {
1457
+ typedef Transform<Scalar, Dim, AffineCompact, LhsOptions> Lhs;
1458
+ typedef Transform<Scalar, Dim, Projective, RhsOptions> Rhs;
1459
+ typedef Transform<Scalar, Dim, Projective> ResultType;
1460
+ static EIGEN_DEVICE_FUNC ResultType run(const Lhs& lhs, const Rhs& rhs) {
1538
1461
  ResultType res;
1539
1462
  res.matrix().template topRows<Dim>() = lhs.matrix() * rhs.matrix();
1540
1463
  res.matrix().row(Dim) = rhs.matrix().row(Dim);
@@ -1542,22 +1465,21 @@ struct transform_transform_product_impl<Transform<Scalar,Dim,AffineCompact,LhsOp
1542
1465
  }
1543
1466
  };
1544
1467
 
1545
- template<typename Scalar, int Dim, int LhsOptions, int RhsOptions>
1546
- struct transform_transform_product_impl<Transform<Scalar,Dim,Projective,LhsOptions>,Transform<Scalar,Dim,AffineCompact,RhsOptions>,true >
1547
- {
1548
- typedef Transform<Scalar,Dim,Projective,LhsOptions> Lhs;
1549
- typedef Transform<Scalar,Dim,AffineCompact,RhsOptions> Rhs;
1550
- typedef Transform<Scalar,Dim,Projective> ResultType;
1551
- static ResultType run(const Lhs& lhs, const Rhs& rhs)
1552
- {
1468
+ template <typename Scalar, int Dim, int LhsOptions, int RhsOptions>
1469
+ struct transform_transform_product_impl<Transform<Scalar, Dim, Projective, LhsOptions>,
1470
+ Transform<Scalar, Dim, AffineCompact, RhsOptions>, true> {
1471
+ typedef Transform<Scalar, Dim, Projective, LhsOptions> Lhs;
1472
+ typedef Transform<Scalar, Dim, AffineCompact, RhsOptions> Rhs;
1473
+ typedef Transform<Scalar, Dim, Projective> ResultType;
1474
+ static EIGEN_DEVICE_FUNC ResultType run(const Lhs& lhs, const Rhs& rhs) {
1553
1475
  ResultType res(lhs.matrix().template leftCols<Dim>() * rhs.matrix());
1554
1476
  res.matrix().col(Dim) += lhs.matrix().col(Dim);
1555
1477
  return res;
1556
1478
  }
1557
1479
  };
1558
1480
 
1559
- } // end namespace internal
1481
+ } // end namespace internal
1560
1482
 
1561
- } // end namespace Eigen
1483
+ } // end namespace Eigen
1562
1484
 
1563
- #endif // EIGEN_TRANSFORM_H
1485
+ #endif // EIGEN_TRANSFORM_H