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