ruby-eigen 0.0.9 → 0.0.10.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +22 -0
- data/README.md +21 -0
- data/ext/eigen/eigen3/COPYING.BSD +26 -0
- data/ext/eigen/eigen3/COPYING.MPL2 +373 -0
- data/ext/eigen/eigen3/COPYING.README +18 -0
- data/ext/eigen/eigen3/Eigen/Array +11 -0
- data/ext/eigen/eigen3/Eigen/Cholesky +32 -0
- data/ext/eigen/eigen3/Eigen/CholmodSupport +45 -0
- data/ext/eigen/eigen3/Eigen/Core +376 -0
- data/ext/eigen/eigen3/Eigen/Dense +7 -0
- data/ext/eigen/eigen3/Eigen/Eigen +2 -0
- data/ext/eigen/eigen3/Eigen/Eigen2Support +95 -0
- data/ext/eigen/eigen3/Eigen/Eigenvalues +48 -0
- data/ext/eigen/eigen3/Eigen/Geometry +63 -0
- data/ext/eigen/eigen3/Eigen/Householder +23 -0
- data/ext/eigen/eigen3/Eigen/IterativeLinearSolvers +40 -0
- data/ext/eigen/eigen3/Eigen/Jacobi +26 -0
- data/ext/eigen/eigen3/Eigen/LU +41 -0
- data/ext/eigen/eigen3/Eigen/LeastSquares +32 -0
- data/ext/eigen/eigen3/Eigen/MetisSupport +28 -0
- data/ext/eigen/eigen3/Eigen/PaStiXSupport +46 -0
- data/ext/eigen/eigen3/Eigen/PardisoSupport +30 -0
- data/ext/eigen/eigen3/Eigen/QR +45 -0
- data/ext/eigen/eigen3/Eigen/QtAlignedMalloc +34 -0
- data/ext/eigen/eigen3/Eigen/SPQRSupport +29 -0
- data/ext/eigen/eigen3/Eigen/SVD +37 -0
- data/ext/eigen/eigen3/Eigen/Sparse +27 -0
- data/ext/eigen/eigen3/Eigen/SparseCore +64 -0
- data/ext/eigen/eigen3/Eigen/SparseLU +49 -0
- data/ext/eigen/eigen3/Eigen/SparseQR +33 -0
- data/ext/eigen/eigen3/Eigen/StdDeque +27 -0
- data/ext/eigen/eigen3/Eigen/StdList +26 -0
- data/ext/eigen/eigen3/Eigen/StdVector +27 -0
- data/ext/eigen/eigen3/Eigen/SuperLUSupport +59 -0
- data/ext/eigen/eigen3/Eigen/UmfPackSupport +36 -0
- data/ext/eigen/eigen3/Eigen/src/Cholesky/LDLT.h +611 -0
- data/ext/eigen/eigen3/Eigen/src/Cholesky/LLT.h +498 -0
- data/ext/eigen/eigen3/Eigen/src/Cholesky/LLT_MKL.h +102 -0
- data/ext/eigen/eigen3/Eigen/src/CholmodSupport/CholmodSupport.h +607 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Array.h +323 -0
- data/ext/eigen/eigen3/Eigen/src/Core/ArrayBase.h +226 -0
- data/ext/eigen/eigen3/Eigen/src/Core/ArrayWrapper.h +264 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Assign.h +590 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Assign_MKL.h +224 -0
- data/ext/eigen/eigen3/Eigen/src/Core/BandMatrix.h +334 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Block.h +406 -0
- data/ext/eigen/eigen3/Eigen/src/Core/BooleanRedux.h +154 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CommaInitializer.h +154 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CoreIterators.h +61 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CwiseBinaryOp.h +230 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CwiseNullaryOp.h +864 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CwiseUnaryOp.h +126 -0
- data/ext/eigen/eigen3/Eigen/src/Core/CwiseUnaryView.h +139 -0
- data/ext/eigen/eigen3/Eigen/src/Core/DenseBase.h +521 -0
- data/ext/eigen/eigen3/Eigen/src/Core/DenseCoeffsBase.h +754 -0
- data/ext/eigen/eigen3/Eigen/src/Core/DenseStorage.h +434 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Diagonal.h +237 -0
- data/ext/eigen/eigen3/Eigen/src/Core/DiagonalMatrix.h +313 -0
- data/ext/eigen/eigen3/Eigen/src/Core/DiagonalProduct.h +131 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Dot.h +263 -0
- data/ext/eigen/eigen3/Eigen/src/Core/EigenBase.h +131 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Flagged.h +140 -0
- data/ext/eigen/eigen3/Eigen/src/Core/ForceAlignedAccess.h +146 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Functors.h +1026 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Fuzzy.h +150 -0
- data/ext/eigen/eigen3/Eigen/src/Core/GeneralProduct.h +635 -0
- data/ext/eigen/eigen3/Eigen/src/Core/GenericPacketMath.h +350 -0
- data/ext/eigen/eigen3/Eigen/src/Core/GlobalFunctions.h +92 -0
- data/ext/eigen/eigen3/Eigen/src/Core/IO.h +250 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Map.h +192 -0
- data/ext/eigen/eigen3/Eigen/src/Core/MapBase.h +247 -0
- data/ext/eigen/eigen3/Eigen/src/Core/MathFunctions.h +768 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Matrix.h +420 -0
- data/ext/eigen/eigen3/Eigen/src/Core/MatrixBase.h +563 -0
- data/ext/eigen/eigen3/Eigen/src/Core/NestByValue.h +111 -0
- data/ext/eigen/eigen3/Eigen/src/Core/NoAlias.h +134 -0
- data/ext/eigen/eigen3/Eigen/src/Core/NumTraits.h +150 -0
- data/ext/eigen/eigen3/Eigen/src/Core/PermutationMatrix.h +721 -0
- data/ext/eigen/eigen3/Eigen/src/Core/PlainObjectBase.h +822 -0
- data/ext/eigen/eigen3/Eigen/src/Core/ProductBase.h +290 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Random.h +152 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Redux.h +409 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Ref.h +278 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Replicate.h +177 -0
- data/ext/eigen/eigen3/Eigen/src/Core/ReturnByValue.h +99 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Reverse.h +224 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Select.h +162 -0
- data/ext/eigen/eigen3/Eigen/src/Core/SelfAdjointView.h +314 -0
- data/ext/eigen/eigen3/Eigen/src/Core/SelfCwiseBinaryOp.h +191 -0
- data/ext/eigen/eigen3/Eigen/src/Core/SolveTriangular.h +260 -0
- data/ext/eigen/eigen3/Eigen/src/Core/StableNorm.h +203 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Stride.h +108 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Swap.h +126 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Transpose.h +419 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Transpositions.h +436 -0
- data/ext/eigen/eigen3/Eigen/src/Core/TriangularMatrix.h +839 -0
- data/ext/eigen/eigen3/Eigen/src/Core/VectorBlock.h +95 -0
- data/ext/eigen/eigen3/Eigen/src/Core/VectorwiseOp.h +642 -0
- data/ext/eigen/eigen3/Eigen/src/Core/Visitor.h +237 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/AltiVec/Complex.h +217 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/AltiVec/PacketMath.h +501 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/Default/Settings.h +49 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/NEON/Complex.h +253 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/NEON/PacketMath.h +420 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/SSE/Complex.h +442 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/SSE/MathFunctions.h +475 -0
- data/ext/eigen/eigen3/Eigen/src/Core/arch/SSE/PacketMath.h +649 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/CoeffBasedProduct.h +476 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1341 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix.h +427 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +278 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_MKL.h +146 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix_MKL.h +118 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h +566 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h +131 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/Parallelizer.h +162 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +436 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix_MKL.h +295 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector.h +281 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector_MKL.h +114 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointProduct.h +123 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/SelfadjointRank2Update.h +93 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix.h +427 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix_MKL.h +309 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixVector.h +348 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularMatrixVector_MKL.h +247 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularSolverMatrix.h +332 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h +155 -0
- data/ext/eigen/eigen3/Eigen/src/Core/products/TriangularSolverVector.h +139 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/BlasUtil.h +264 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/Constants.h +451 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/DisableStupidWarnings.h +40 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/ForwardDeclarations.h +302 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/MKL_support.h +158 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/Macros.h +451 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/Memory.h +977 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/Meta.h +243 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/NonMPL2.h +3 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/ReenableStupidWarnings.h +14 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/StaticAssert.h +208 -0
- data/ext/eigen/eigen3/Eigen/src/Core/util/XprHelper.h +469 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Block.h +126 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Cwise.h +192 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/CwiseOperators.h +298 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/AlignedBox.h +159 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/All.h +115 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/AngleAxis.h +214 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Hyperplane.h +254 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/ParametrizedLine.h +141 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Quaternion.h +495 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Rotation2D.h +145 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/RotationBase.h +123 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Scaling.h +167 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Transform.h +786 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Geometry/Translation.h +184 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/LU.h +120 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Lazy.h +71 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/LeastSquares.h +169 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Macros.h +20 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/MathFunctions.h +57 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Memory.h +45 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Meta.h +75 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/Minor.h +117 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/QR.h +67 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/SVD.h +637 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/TriangularSolver.h +42 -0
- data/ext/eigen/eigen3/Eigen/src/Eigen2Support/VectorBlock.h +94 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/ComplexEigenSolver.h +341 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/ComplexSchur.h +456 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/ComplexSchur_MKL.h +94 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/EigenSolver.h +607 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +350 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +227 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/HessenbergDecomposition.h +373 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +160 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/RealQZ.h +624 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/RealSchur.h +525 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/RealSchur_MKL.h +83 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +801 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_MKL.h +92 -0
- data/ext/eigen/eigen3/Eigen/src/Eigenvalues/Tridiagonalization.h +557 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/AlignedBox.h +392 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/AngleAxis.h +233 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/EulerAngles.h +104 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Homogeneous.h +307 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Hyperplane.h +280 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/OrthoMethods.h +218 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/ParametrizedLine.h +195 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Quaternion.h +776 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Rotation2D.h +160 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/RotationBase.h +206 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Scaling.h +166 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Transform.h +1455 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Translation.h +206 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/Umeyama.h +177 -0
- data/ext/eigen/eigen3/Eigen/src/Geometry/arch/Geometry_SSE.h +115 -0
- data/ext/eigen/eigen3/Eigen/src/Householder/BlockHouseholder.h +68 -0
- data/ext/eigen/eigen3/Eigen/src/Householder/Householder.h +171 -0
- data/ext/eigen/eigen3/Eigen/src/Householder/HouseholderSequence.h +441 -0
- data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +149 -0
- data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +263 -0
- data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +256 -0
- data/ext/eigen/eigen3/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +282 -0
- data/ext/eigen/eigen3/Eigen/src/Jacobi/Jacobi.h +433 -0
- data/ext/eigen/eigen3/Eigen/src/LU/Determinant.h +101 -0
- data/ext/eigen/eigen3/Eigen/src/LU/FullPivLU.h +751 -0
- data/ext/eigen/eigen3/Eigen/src/LU/Inverse.h +400 -0
- data/ext/eigen/eigen3/Eigen/src/LU/PartialPivLU.h +509 -0
- data/ext/eigen/eigen3/Eigen/src/LU/PartialPivLU_MKL.h +85 -0
- data/ext/eigen/eigen3/Eigen/src/LU/arch/Inverse_SSE.h +329 -0
- data/ext/eigen/eigen3/Eigen/src/MetisSupport/MetisSupport.h +137 -0
- data/ext/eigen/eigen3/Eigen/src/OrderingMethods/Amd.h +444 -0
- data/ext/eigen/eigen3/Eigen/src/OrderingMethods/Eigen_Colamd.h +1850 -0
- data/ext/eigen/eigen3/Eigen/src/PaStiXSupport/PaStiXSupport.h +721 -0
- data/ext/eigen/eigen3/Eigen/src/PardisoSupport/PardisoSupport.h +592 -0
- data/ext/eigen/eigen3/Eigen/src/QR/ColPivHouseholderQR.h +580 -0
- data/ext/eigen/eigen3/Eigen/src/QR/ColPivHouseholderQR_MKL.h +99 -0
- data/ext/eigen/eigen3/Eigen/src/QR/FullPivHouseholderQR.h +622 -0
- data/ext/eigen/eigen3/Eigen/src/QR/HouseholderQR.h +388 -0
- data/ext/eigen/eigen3/Eigen/src/QR/HouseholderQR_MKL.h +71 -0
- data/ext/eigen/eigen3/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +338 -0
- data/ext/eigen/eigen3/Eigen/src/SVD/JacobiSVD.h +976 -0
- data/ext/eigen/eigen3/Eigen/src/SVD/JacobiSVD_MKL.h +92 -0
- data/ext/eigen/eigen3/Eigen/src/SVD/UpperBidiagonalization.h +148 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky.h +671 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +199 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/AmbiVector.h +373 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/CompressedStorage.h +233 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +245 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/MappedSparseMatrix.h +181 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseBlock.h +537 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseColEtree.h +206 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +325 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +163 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseDenseProduct.h +311 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseDiagonalProduct.h +196 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseDot.h +101 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseFuzzy.h +26 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseMatrix.h +1262 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseMatrixBase.h +461 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparsePermutation.h +148 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseProduct.h +188 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseRedux.h +45 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseSelfAdjointView.h +507 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +150 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseTranspose.h +63 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseTriangularView.h +179 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseUtil.h +172 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseVector.h +448 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseView.h +99 -0
- data/ext/eigen/eigen3/Eigen/src/SparseCore/TriangularSolver.h +334 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU.h +806 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLUImpl.h +66 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_Memory.h +227 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_Structs.h +111 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +298 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_Utils.h +80 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_column_bmod.h +180 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_column_dfs.h +177 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +106 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +279 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +127 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +130 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_panel_bmod.h +223 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_panel_dfs.h +258 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_pivotL.h +137 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_pruneL.h +135 -0
- data/ext/eigen/eigen3/Eigen/src/SparseLU/SparseLU_relax_snode.h +83 -0
- data/ext/eigen/eigen3/Eigen/src/SparseQR/SparseQR.h +714 -0
- data/ext/eigen/eigen3/Eigen/src/StlSupport/StdDeque.h +134 -0
- data/ext/eigen/eigen3/Eigen/src/StlSupport/StdList.h +114 -0
- data/ext/eigen/eigen3/Eigen/src/StlSupport/StdVector.h +126 -0
- data/ext/eigen/eigen3/Eigen/src/StlSupport/details.h +84 -0
- data/ext/eigen/eigen3/Eigen/src/SuperLUSupport/SuperLUSupport.h +1026 -0
- data/ext/eigen/eigen3/Eigen/src/UmfPackSupport/UmfPackSupport.h +474 -0
- data/ext/eigen/eigen3/Eigen/src/misc/Image.h +84 -0
- data/ext/eigen/eigen3/Eigen/src/misc/Kernel.h +81 -0
- data/ext/eigen/eigen3/Eigen/src/misc/Solve.h +76 -0
- data/ext/eigen/eigen3/Eigen/src/misc/SparseSolve.h +128 -0
- data/ext/eigen/eigen3/Eigen/src/misc/blas.h +658 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/ArrayCwiseBinaryOps.h +253 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/ArrayCwiseUnaryOps.h +187 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/BlockMethods.h +935 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/CommonCwiseBinaryOps.h +46 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/CommonCwiseUnaryOps.h +172 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/MatrixCwiseBinaryOps.h +143 -0
- data/ext/eigen/eigen3/Eigen/src/plugins/MatrixCwiseUnaryOps.h +52 -0
- data/ext/eigen/eigen3/signature_of_eigen3_matrix_library +1 -0
- data/ext/eigen/eigen_wrap.cxx +19420 -10396
- data/ext/eigen/extconf.rb +37 -2
- data/lib/eigen.rb +146 -3
- metadata +294 -7
@@ -0,0 +1,104 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
|
5
|
+
//
|
6
|
+
// This Source Code Form is subject to the terms of the Mozilla
|
7
|
+
// Public License v. 2.0. If a copy of the MPL was not distributed
|
8
|
+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
9
|
+
|
10
|
+
#ifndef EIGEN_EULERANGLES_H
|
11
|
+
#define EIGEN_EULERANGLES_H
|
12
|
+
|
13
|
+
namespace Eigen {
|
14
|
+
|
15
|
+
/** \geometry_module \ingroup Geometry_Module
|
16
|
+
*
|
17
|
+
*
|
18
|
+
* \returns the Euler-angles of the rotation matrix \c *this using the convention defined by the triplet (\a a0,\a a1,\a a2)
|
19
|
+
*
|
20
|
+
* Each of the three parameters \a a0,\a a1,\a a2 represents the respective rotation axis as an integer in {0,1,2}.
|
21
|
+
* For instance, in:
|
22
|
+
* \code Vector3f ea = mat.eulerAngles(2, 0, 2); \endcode
|
23
|
+
* "2" represents the z axis and "0" the x axis, etc. The returned angles are such that
|
24
|
+
* we have the following equality:
|
25
|
+
* \code
|
26
|
+
* mat == AngleAxisf(ea[0], Vector3f::UnitZ())
|
27
|
+
* * AngleAxisf(ea[1], Vector3f::UnitX())
|
28
|
+
* * AngleAxisf(ea[2], Vector3f::UnitZ()); \endcode
|
29
|
+
* This corresponds to the right-multiply conventions (with right hand side frames).
|
30
|
+
*
|
31
|
+
* The returned angles are in the ranges [0:pi]x[-pi:pi]x[-pi:pi].
|
32
|
+
*
|
33
|
+
* \sa class AngleAxis
|
34
|
+
*/
|
35
|
+
template<typename Derived>
|
36
|
+
inline Matrix<typename MatrixBase<Derived>::Scalar,3,1>
|
37
|
+
MatrixBase<Derived>::eulerAngles(Index a0, Index a1, Index a2) const
|
38
|
+
{
|
39
|
+
using std::atan2;
|
40
|
+
using std::sin;
|
41
|
+
using std::cos;
|
42
|
+
/* Implemented from Graphics Gems IV */
|
43
|
+
EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Derived,3,3)
|
44
|
+
|
45
|
+
Matrix<Scalar,3,1> res;
|
46
|
+
typedef Matrix<typename Derived::Scalar,2,1> Vector2;
|
47
|
+
|
48
|
+
const Index odd = ((a0+1)%3 == a1) ? 0 : 1;
|
49
|
+
const Index i = a0;
|
50
|
+
const Index j = (a0 + 1 + odd)%3;
|
51
|
+
const Index k = (a0 + 2 - odd)%3;
|
52
|
+
|
53
|
+
if (a0==a2)
|
54
|
+
{
|
55
|
+
res[0] = atan2(coeff(j,i), coeff(k,i));
|
56
|
+
if((odd && res[0]<Scalar(0)) || ((!odd) && res[0]>Scalar(0)))
|
57
|
+
{
|
58
|
+
res[0] = (res[0] > Scalar(0)) ? res[0] - Scalar(M_PI) : res[0] + Scalar(M_PI);
|
59
|
+
Scalar s2 = Vector2(coeff(j,i), coeff(k,i)).norm();
|
60
|
+
res[1] = -atan2(s2, coeff(i,i));
|
61
|
+
}
|
62
|
+
else
|
63
|
+
{
|
64
|
+
Scalar s2 = Vector2(coeff(j,i), coeff(k,i)).norm();
|
65
|
+
res[1] = atan2(s2, coeff(i,i));
|
66
|
+
}
|
67
|
+
|
68
|
+
// With a=(0,1,0), we have i=0; j=1; k=2, and after computing the first two angles,
|
69
|
+
// we can compute their respective rotation, and apply its inverse to M. Since the result must
|
70
|
+
// be a rotation around x, we have:
|
71
|
+
//
|
72
|
+
// c2 s1.s2 c1.s2 1 0 0
|
73
|
+
// 0 c1 -s1 * M = 0 c3 s3
|
74
|
+
// -s2 s1.c2 c1.c2 0 -s3 c3
|
75
|
+
//
|
76
|
+
// Thus: m11.c1 - m21.s1 = c3 & m12.c1 - m22.s1 = s3
|
77
|
+
|
78
|
+
Scalar s1 = sin(res[0]);
|
79
|
+
Scalar c1 = cos(res[0]);
|
80
|
+
res[2] = atan2(c1*coeff(j,k)-s1*coeff(k,k), c1*coeff(j,j) - s1 * coeff(k,j));
|
81
|
+
}
|
82
|
+
else
|
83
|
+
{
|
84
|
+
res[0] = atan2(coeff(j,k), coeff(k,k));
|
85
|
+
Scalar c2 = Vector2(coeff(i,i), coeff(i,j)).norm();
|
86
|
+
if((odd && res[0]<Scalar(0)) || ((!odd) && res[0]>Scalar(0))) {
|
87
|
+
res[0] = (res[0] > Scalar(0)) ? res[0] - Scalar(M_PI) : res[0] + Scalar(M_PI);
|
88
|
+
res[1] = atan2(-coeff(i,k), -c2);
|
89
|
+
}
|
90
|
+
else
|
91
|
+
res[1] = atan2(-coeff(i,k), c2);
|
92
|
+
Scalar s1 = sin(res[0]);
|
93
|
+
Scalar c1 = cos(res[0]);
|
94
|
+
res[2] = atan2(s1*coeff(k,i)-c1*coeff(j,i), c1*coeff(j,j) - s1 * coeff(k,j));
|
95
|
+
}
|
96
|
+
if (!odd)
|
97
|
+
res = -res;
|
98
|
+
|
99
|
+
return res;
|
100
|
+
}
|
101
|
+
|
102
|
+
} // end namespace Eigen
|
103
|
+
|
104
|
+
#endif // EIGEN_EULERANGLES_H
|
@@ -0,0 +1,307 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2009-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
|
5
|
+
//
|
6
|
+
// This Source Code Form is subject to the terms of the Mozilla
|
7
|
+
// Public License v. 2.0. If a copy of the MPL was not distributed
|
8
|
+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
9
|
+
|
10
|
+
#ifndef EIGEN_HOMOGENEOUS_H
|
11
|
+
#define EIGEN_HOMOGENEOUS_H
|
12
|
+
|
13
|
+
namespace Eigen {
|
14
|
+
|
15
|
+
/** \geometry_module \ingroup Geometry_Module
|
16
|
+
*
|
17
|
+
* \class Homogeneous
|
18
|
+
*
|
19
|
+
* \brief Expression of one (or a set of) homogeneous vector(s)
|
20
|
+
*
|
21
|
+
* \param MatrixType the type of the object in which we are making homogeneous
|
22
|
+
*
|
23
|
+
* This class represents an expression of one (or a set of) homogeneous vector(s).
|
24
|
+
* It is the return type of MatrixBase::homogeneous() and most of the time
|
25
|
+
* this is the only way it is used.
|
26
|
+
*
|
27
|
+
* \sa MatrixBase::homogeneous()
|
28
|
+
*/
|
29
|
+
|
30
|
+
namespace internal {
|
31
|
+
|
32
|
+
template<typename MatrixType,int Direction>
|
33
|
+
struct traits<Homogeneous<MatrixType,Direction> >
|
34
|
+
: traits<MatrixType>
|
35
|
+
{
|
36
|
+
typedef typename traits<MatrixType>::StorageKind StorageKind;
|
37
|
+
typedef typename nested<MatrixType>::type MatrixTypeNested;
|
38
|
+
typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested;
|
39
|
+
enum {
|
40
|
+
RowsPlusOne = (MatrixType::RowsAtCompileTime != Dynamic) ?
|
41
|
+
int(MatrixType::RowsAtCompileTime) + 1 : Dynamic,
|
42
|
+
ColsPlusOne = (MatrixType::ColsAtCompileTime != Dynamic) ?
|
43
|
+
int(MatrixType::ColsAtCompileTime) + 1 : Dynamic,
|
44
|
+
RowsAtCompileTime = Direction==Vertical ? RowsPlusOne : MatrixType::RowsAtCompileTime,
|
45
|
+
ColsAtCompileTime = Direction==Horizontal ? ColsPlusOne : MatrixType::ColsAtCompileTime,
|
46
|
+
MaxRowsAtCompileTime = RowsAtCompileTime,
|
47
|
+
MaxColsAtCompileTime = ColsAtCompileTime,
|
48
|
+
TmpFlags = _MatrixTypeNested::Flags & HereditaryBits,
|
49
|
+
Flags = ColsAtCompileTime==1 ? (TmpFlags & ~RowMajorBit)
|
50
|
+
: RowsAtCompileTime==1 ? (TmpFlags | RowMajorBit)
|
51
|
+
: TmpFlags,
|
52
|
+
CoeffReadCost = _MatrixTypeNested::CoeffReadCost
|
53
|
+
};
|
54
|
+
};
|
55
|
+
|
56
|
+
template<typename MatrixType,typename Lhs> struct homogeneous_left_product_impl;
|
57
|
+
template<typename MatrixType,typename Rhs> struct homogeneous_right_product_impl;
|
58
|
+
|
59
|
+
} // end namespace internal
|
60
|
+
|
61
|
+
template<typename MatrixType,int _Direction> class Homogeneous
|
62
|
+
: internal::no_assignment_operator, public MatrixBase<Homogeneous<MatrixType,_Direction> >
|
63
|
+
{
|
64
|
+
public:
|
65
|
+
|
66
|
+
enum { Direction = _Direction };
|
67
|
+
|
68
|
+
typedef MatrixBase<Homogeneous> Base;
|
69
|
+
EIGEN_DENSE_PUBLIC_INTERFACE(Homogeneous)
|
70
|
+
|
71
|
+
inline Homogeneous(const MatrixType& matrix)
|
72
|
+
: m_matrix(matrix)
|
73
|
+
{}
|
74
|
+
|
75
|
+
inline Index rows() const { return m_matrix.rows() + (int(Direction)==Vertical ? 1 : 0); }
|
76
|
+
inline Index cols() const { return m_matrix.cols() + (int(Direction)==Horizontal ? 1 : 0); }
|
77
|
+
|
78
|
+
inline Scalar coeff(Index row, Index col) const
|
79
|
+
{
|
80
|
+
if( (int(Direction)==Vertical && row==m_matrix.rows())
|
81
|
+
|| (int(Direction)==Horizontal && col==m_matrix.cols()))
|
82
|
+
return Scalar(1);
|
83
|
+
return m_matrix.coeff(row, col);
|
84
|
+
}
|
85
|
+
|
86
|
+
template<typename Rhs>
|
87
|
+
inline const internal::homogeneous_right_product_impl<Homogeneous,Rhs>
|
88
|
+
operator* (const MatrixBase<Rhs>& rhs) const
|
89
|
+
{
|
90
|
+
eigen_assert(int(Direction)==Horizontal);
|
91
|
+
return internal::homogeneous_right_product_impl<Homogeneous,Rhs>(m_matrix,rhs.derived());
|
92
|
+
}
|
93
|
+
|
94
|
+
template<typename Lhs> friend
|
95
|
+
inline const internal::homogeneous_left_product_impl<Homogeneous,Lhs>
|
96
|
+
operator* (const MatrixBase<Lhs>& lhs, const Homogeneous& rhs)
|
97
|
+
{
|
98
|
+
eigen_assert(int(Direction)==Vertical);
|
99
|
+
return internal::homogeneous_left_product_impl<Homogeneous,Lhs>(lhs.derived(),rhs.m_matrix);
|
100
|
+
}
|
101
|
+
|
102
|
+
template<typename Scalar, int Dim, int Mode, int Options> friend
|
103
|
+
inline const internal::homogeneous_left_product_impl<Homogeneous,Transform<Scalar,Dim,Mode,Options> >
|
104
|
+
operator* (const Transform<Scalar,Dim,Mode,Options>& lhs, const Homogeneous& rhs)
|
105
|
+
{
|
106
|
+
eigen_assert(int(Direction)==Vertical);
|
107
|
+
return internal::homogeneous_left_product_impl<Homogeneous,Transform<Scalar,Dim,Mode,Options> >(lhs,rhs.m_matrix);
|
108
|
+
}
|
109
|
+
|
110
|
+
protected:
|
111
|
+
typename MatrixType::Nested m_matrix;
|
112
|
+
};
|
113
|
+
|
114
|
+
/** \geometry_module
|
115
|
+
*
|
116
|
+
* \return an expression of the equivalent homogeneous vector
|
117
|
+
*
|
118
|
+
* \only_for_vectors
|
119
|
+
*
|
120
|
+
* Example: \include MatrixBase_homogeneous.cpp
|
121
|
+
* Output: \verbinclude MatrixBase_homogeneous.out
|
122
|
+
*
|
123
|
+
* \sa class Homogeneous
|
124
|
+
*/
|
125
|
+
template<typename Derived>
|
126
|
+
inline typename MatrixBase<Derived>::HomogeneousReturnType
|
127
|
+
MatrixBase<Derived>::homogeneous() const
|
128
|
+
{
|
129
|
+
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived);
|
130
|
+
return derived();
|
131
|
+
}
|
132
|
+
|
133
|
+
/** \geometry_module
|
134
|
+
*
|
135
|
+
* \returns a matrix expression of homogeneous column (or row) vectors
|
136
|
+
*
|
137
|
+
* Example: \include VectorwiseOp_homogeneous.cpp
|
138
|
+
* Output: \verbinclude VectorwiseOp_homogeneous.out
|
139
|
+
*
|
140
|
+
* \sa MatrixBase::homogeneous() */
|
141
|
+
template<typename ExpressionType, int Direction>
|
142
|
+
inline Homogeneous<ExpressionType,Direction>
|
143
|
+
VectorwiseOp<ExpressionType,Direction>::homogeneous() const
|
144
|
+
{
|
145
|
+
return _expression();
|
146
|
+
}
|
147
|
+
|
148
|
+
/** \geometry_module
|
149
|
+
*
|
150
|
+
* \returns an expression of the homogeneous normalized vector of \c *this
|
151
|
+
*
|
152
|
+
* Example: \include MatrixBase_hnormalized.cpp
|
153
|
+
* Output: \verbinclude MatrixBase_hnormalized.out
|
154
|
+
*
|
155
|
+
* \sa VectorwiseOp::hnormalized() */
|
156
|
+
template<typename Derived>
|
157
|
+
inline const typename MatrixBase<Derived>::HNormalizedReturnType
|
158
|
+
MatrixBase<Derived>::hnormalized() const
|
159
|
+
{
|
160
|
+
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived);
|
161
|
+
return ConstStartMinusOne(derived(),0,0,
|
162
|
+
ColsAtCompileTime==1?size()-1:1,
|
163
|
+
ColsAtCompileTime==1?1:size()-1) / coeff(size()-1);
|
164
|
+
}
|
165
|
+
|
166
|
+
/** \geometry_module
|
167
|
+
*
|
168
|
+
* \returns an expression of the homogeneous normalized vector of \c *this
|
169
|
+
*
|
170
|
+
* Example: \include DirectionWise_hnormalized.cpp
|
171
|
+
* Output: \verbinclude DirectionWise_hnormalized.out
|
172
|
+
*
|
173
|
+
* \sa MatrixBase::hnormalized() */
|
174
|
+
template<typename ExpressionType, int Direction>
|
175
|
+
inline const typename VectorwiseOp<ExpressionType,Direction>::HNormalizedReturnType
|
176
|
+
VectorwiseOp<ExpressionType,Direction>::hnormalized() const
|
177
|
+
{
|
178
|
+
return HNormalized_Block(_expression(),0,0,
|
179
|
+
Direction==Vertical ? _expression().rows()-1 : _expression().rows(),
|
180
|
+
Direction==Horizontal ? _expression().cols()-1 : _expression().cols()).cwiseQuotient(
|
181
|
+
Replicate<HNormalized_Factors,
|
182
|
+
Direction==Vertical ? HNormalized_SizeMinusOne : 1,
|
183
|
+
Direction==Horizontal ? HNormalized_SizeMinusOne : 1>
|
184
|
+
(HNormalized_Factors(_expression(),
|
185
|
+
Direction==Vertical ? _expression().rows()-1:0,
|
186
|
+
Direction==Horizontal ? _expression().cols()-1:0,
|
187
|
+
Direction==Vertical ? 1 : _expression().rows(),
|
188
|
+
Direction==Horizontal ? 1 : _expression().cols()),
|
189
|
+
Direction==Vertical ? _expression().rows()-1 : 1,
|
190
|
+
Direction==Horizontal ? _expression().cols()-1 : 1));
|
191
|
+
}
|
192
|
+
|
193
|
+
namespace internal {
|
194
|
+
|
195
|
+
template<typename MatrixOrTransformType>
|
196
|
+
struct take_matrix_for_product
|
197
|
+
{
|
198
|
+
typedef MatrixOrTransformType type;
|
199
|
+
static const type& run(const type &x) { return x; }
|
200
|
+
};
|
201
|
+
|
202
|
+
template<typename Scalar, int Dim, int Mode,int Options>
|
203
|
+
struct take_matrix_for_product<Transform<Scalar, Dim, Mode, Options> >
|
204
|
+
{
|
205
|
+
typedef Transform<Scalar, Dim, Mode, Options> TransformType;
|
206
|
+
typedef typename internal::add_const<typename TransformType::ConstAffinePart>::type type;
|
207
|
+
static type run (const TransformType& x) { return x.affine(); }
|
208
|
+
};
|
209
|
+
|
210
|
+
template<typename Scalar, int Dim, int Options>
|
211
|
+
struct take_matrix_for_product<Transform<Scalar, Dim, Projective, Options> >
|
212
|
+
{
|
213
|
+
typedef Transform<Scalar, Dim, Projective, Options> TransformType;
|
214
|
+
typedef typename TransformType::MatrixType type;
|
215
|
+
static const type& run (const TransformType& x) { return x.matrix(); }
|
216
|
+
};
|
217
|
+
|
218
|
+
template<typename MatrixType,typename Lhs>
|
219
|
+
struct traits<homogeneous_left_product_impl<Homogeneous<MatrixType,Vertical>,Lhs> >
|
220
|
+
{
|
221
|
+
typedef typename take_matrix_for_product<Lhs>::type LhsMatrixType;
|
222
|
+
typedef typename remove_all<MatrixType>::type MatrixTypeCleaned;
|
223
|
+
typedef typename remove_all<LhsMatrixType>::type LhsMatrixTypeCleaned;
|
224
|
+
typedef typename make_proper_matrix_type<
|
225
|
+
typename traits<MatrixTypeCleaned>::Scalar,
|
226
|
+
LhsMatrixTypeCleaned::RowsAtCompileTime,
|
227
|
+
MatrixTypeCleaned::ColsAtCompileTime,
|
228
|
+
MatrixTypeCleaned::PlainObject::Options,
|
229
|
+
LhsMatrixTypeCleaned::MaxRowsAtCompileTime,
|
230
|
+
MatrixTypeCleaned::MaxColsAtCompileTime>::type ReturnType;
|
231
|
+
};
|
232
|
+
|
233
|
+
template<typename MatrixType,typename Lhs>
|
234
|
+
struct homogeneous_left_product_impl<Homogeneous<MatrixType,Vertical>,Lhs>
|
235
|
+
: public ReturnByValue<homogeneous_left_product_impl<Homogeneous<MatrixType,Vertical>,Lhs> >
|
236
|
+
{
|
237
|
+
typedef typename traits<homogeneous_left_product_impl>::LhsMatrixType LhsMatrixType;
|
238
|
+
typedef typename remove_all<LhsMatrixType>::type LhsMatrixTypeCleaned;
|
239
|
+
typedef typename remove_all<typename LhsMatrixTypeCleaned::Nested>::type LhsMatrixTypeNested;
|
240
|
+
typedef typename MatrixType::Index Index;
|
241
|
+
homogeneous_left_product_impl(const Lhs& lhs, const MatrixType& rhs)
|
242
|
+
: m_lhs(take_matrix_for_product<Lhs>::run(lhs)),
|
243
|
+
m_rhs(rhs)
|
244
|
+
{}
|
245
|
+
|
246
|
+
inline Index rows() const { return m_lhs.rows(); }
|
247
|
+
inline Index cols() const { return m_rhs.cols(); }
|
248
|
+
|
249
|
+
template<typename Dest> void evalTo(Dest& dst) const
|
250
|
+
{
|
251
|
+
// FIXME investigate how to allow lazy evaluation of this product when possible
|
252
|
+
dst = Block<const LhsMatrixTypeNested,
|
253
|
+
LhsMatrixTypeNested::RowsAtCompileTime,
|
254
|
+
LhsMatrixTypeNested::ColsAtCompileTime==Dynamic?Dynamic:LhsMatrixTypeNested::ColsAtCompileTime-1>
|
255
|
+
(m_lhs,0,0,m_lhs.rows(),m_lhs.cols()-1) * m_rhs;
|
256
|
+
dst += m_lhs.col(m_lhs.cols()-1).rowwise()
|
257
|
+
.template replicate<MatrixType::ColsAtCompileTime>(m_rhs.cols());
|
258
|
+
}
|
259
|
+
|
260
|
+
typename LhsMatrixTypeCleaned::Nested m_lhs;
|
261
|
+
typename MatrixType::Nested m_rhs;
|
262
|
+
};
|
263
|
+
|
264
|
+
template<typename MatrixType,typename Rhs>
|
265
|
+
struct traits<homogeneous_right_product_impl<Homogeneous<MatrixType,Horizontal>,Rhs> >
|
266
|
+
{
|
267
|
+
typedef typename make_proper_matrix_type<typename traits<MatrixType>::Scalar,
|
268
|
+
MatrixType::RowsAtCompileTime,
|
269
|
+
Rhs::ColsAtCompileTime,
|
270
|
+
MatrixType::PlainObject::Options,
|
271
|
+
MatrixType::MaxRowsAtCompileTime,
|
272
|
+
Rhs::MaxColsAtCompileTime>::type ReturnType;
|
273
|
+
};
|
274
|
+
|
275
|
+
template<typename MatrixType,typename Rhs>
|
276
|
+
struct homogeneous_right_product_impl<Homogeneous<MatrixType,Horizontal>,Rhs>
|
277
|
+
: public ReturnByValue<homogeneous_right_product_impl<Homogeneous<MatrixType,Horizontal>,Rhs> >
|
278
|
+
{
|
279
|
+
typedef typename remove_all<typename Rhs::Nested>::type RhsNested;
|
280
|
+
typedef typename MatrixType::Index Index;
|
281
|
+
homogeneous_right_product_impl(const MatrixType& lhs, const Rhs& rhs)
|
282
|
+
: m_lhs(lhs), m_rhs(rhs)
|
283
|
+
{}
|
284
|
+
|
285
|
+
inline Index rows() const { return m_lhs.rows(); }
|
286
|
+
inline Index cols() const { return m_rhs.cols(); }
|
287
|
+
|
288
|
+
template<typename Dest> void evalTo(Dest& dst) const
|
289
|
+
{
|
290
|
+
// FIXME investigate how to allow lazy evaluation of this product when possible
|
291
|
+
dst = m_lhs * Block<const RhsNested,
|
292
|
+
RhsNested::RowsAtCompileTime==Dynamic?Dynamic:RhsNested::RowsAtCompileTime-1,
|
293
|
+
RhsNested::ColsAtCompileTime>
|
294
|
+
(m_rhs,0,0,m_rhs.rows()-1,m_rhs.cols());
|
295
|
+
dst += m_rhs.row(m_rhs.rows()-1).colwise()
|
296
|
+
.template replicate<MatrixType::RowsAtCompileTime>(m_lhs.rows());
|
297
|
+
}
|
298
|
+
|
299
|
+
typename MatrixType::Nested m_lhs;
|
300
|
+
typename Rhs::Nested m_rhs;
|
301
|
+
};
|
302
|
+
|
303
|
+
} // end namespace internal
|
304
|
+
|
305
|
+
} // end namespace Eigen
|
306
|
+
|
307
|
+
#endif // EIGEN_HOMOGENEOUS_H
|
@@ -0,0 +1,280 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
|
5
|
+
// Copyright (C) 2008 Benoit Jacob <jacob.benoit.1@gmail.com>
|
6
|
+
//
|
7
|
+
// This Source Code Form is subject to the terms of the Mozilla
|
8
|
+
// Public License v. 2.0. If a copy of the MPL was not distributed
|
9
|
+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
10
|
+
|
11
|
+
#ifndef EIGEN_HYPERPLANE_H
|
12
|
+
#define EIGEN_HYPERPLANE_H
|
13
|
+
|
14
|
+
namespace Eigen {
|
15
|
+
|
16
|
+
/** \geometry_module \ingroup Geometry_Module
|
17
|
+
*
|
18
|
+
* \class Hyperplane
|
19
|
+
*
|
20
|
+
* \brief A hyperplane
|
21
|
+
*
|
22
|
+
* A hyperplane is an affine subspace of dimension n-1 in a space of dimension n.
|
23
|
+
* For example, a hyperplane in a plane is a line; a hyperplane in 3-space is a plane.
|
24
|
+
*
|
25
|
+
* \param _Scalar the scalar type, i.e., the type of the coefficients
|
26
|
+
* \param _AmbientDim the dimension of the ambient space, can be a compile time value or Dynamic.
|
27
|
+
* Notice that the dimension of the hyperplane is _AmbientDim-1.
|
28
|
+
*
|
29
|
+
* This class represents an hyperplane as the zero set of the implicit equation
|
30
|
+
* \f$ n \cdot x + d = 0 \f$ where \f$ n \f$ is a unit normal vector of the plane (linear part)
|
31
|
+
* and \f$ d \f$ is the distance (offset) to the origin.
|
32
|
+
*/
|
33
|
+
template <typename _Scalar, int _AmbientDim, int _Options>
|
34
|
+
class Hyperplane
|
35
|
+
{
|
36
|
+
public:
|
37
|
+
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim==Dynamic ? Dynamic : _AmbientDim+1)
|
38
|
+
enum {
|
39
|
+
AmbientDimAtCompileTime = _AmbientDim,
|
40
|
+
Options = _Options
|
41
|
+
};
|
42
|
+
typedef _Scalar Scalar;
|
43
|
+
typedef typename NumTraits<Scalar>::Real RealScalar;
|
44
|
+
typedef DenseIndex Index;
|
45
|
+
typedef Matrix<Scalar,AmbientDimAtCompileTime,1> VectorType;
|
46
|
+
typedef Matrix<Scalar,Index(AmbientDimAtCompileTime)==Dynamic
|
47
|
+
? Dynamic
|
48
|
+
: Index(AmbientDimAtCompileTime)+1,1,Options> Coefficients;
|
49
|
+
typedef Block<Coefficients,AmbientDimAtCompileTime,1> NormalReturnType;
|
50
|
+
typedef const Block<const Coefficients,AmbientDimAtCompileTime,1> ConstNormalReturnType;
|
51
|
+
|
52
|
+
/** Default constructor without initialization */
|
53
|
+
inline Hyperplane() {}
|
54
|
+
|
55
|
+
template<int OtherOptions>
|
56
|
+
Hyperplane(const Hyperplane<Scalar,AmbientDimAtCompileTime,OtherOptions>& other)
|
57
|
+
: m_coeffs(other.coeffs())
|
58
|
+
{}
|
59
|
+
|
60
|
+
/** Constructs a dynamic-size hyperplane with \a _dim the dimension
|
61
|
+
* of the ambient space */
|
62
|
+
inline explicit Hyperplane(Index _dim) : m_coeffs(_dim+1) {}
|
63
|
+
|
64
|
+
/** Construct a plane from its normal \a n and a point \a e onto the plane.
|
65
|
+
* \warning the vector normal is assumed to be normalized.
|
66
|
+
*/
|
67
|
+
inline Hyperplane(const VectorType& n, const VectorType& e)
|
68
|
+
: m_coeffs(n.size()+1)
|
69
|
+
{
|
70
|
+
normal() = n;
|
71
|
+
offset() = -n.dot(e);
|
72
|
+
}
|
73
|
+
|
74
|
+
/** Constructs a plane from its normal \a n and distance to the origin \a d
|
75
|
+
* such that the algebraic equation of the plane is \f$ n \cdot x + d = 0 \f$.
|
76
|
+
* \warning the vector normal is assumed to be normalized.
|
77
|
+
*/
|
78
|
+
inline Hyperplane(const VectorType& n, const Scalar& d)
|
79
|
+
: m_coeffs(n.size()+1)
|
80
|
+
{
|
81
|
+
normal() = n;
|
82
|
+
offset() = d;
|
83
|
+
}
|
84
|
+
|
85
|
+
/** Constructs a hyperplane passing through the two points. If the dimension of the ambient space
|
86
|
+
* is greater than 2, then there isn't uniqueness, so an arbitrary choice is made.
|
87
|
+
*/
|
88
|
+
static inline Hyperplane Through(const VectorType& p0, const VectorType& p1)
|
89
|
+
{
|
90
|
+
Hyperplane result(p0.size());
|
91
|
+
result.normal() = (p1 - p0).unitOrthogonal();
|
92
|
+
result.offset() = -p0.dot(result.normal());
|
93
|
+
return result;
|
94
|
+
}
|
95
|
+
|
96
|
+
/** Constructs a hyperplane passing through the three points. The dimension of the ambient space
|
97
|
+
* is required to be exactly 3.
|
98
|
+
*/
|
99
|
+
static inline Hyperplane Through(const VectorType& p0, const VectorType& p1, const VectorType& p2)
|
100
|
+
{
|
101
|
+
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(VectorType, 3)
|
102
|
+
Hyperplane result(p0.size());
|
103
|
+
VectorType v0(p2 - p0), v1(p1 - p0);
|
104
|
+
result.normal() = v0.cross(v1);
|
105
|
+
RealScalar norm = result.normal().norm();
|
106
|
+
if(norm <= v0.norm() * v1.norm() * NumTraits<RealScalar>::epsilon())
|
107
|
+
{
|
108
|
+
Matrix<Scalar,2,3> m; m << v0.transpose(), v1.transpose();
|
109
|
+
JacobiSVD<Matrix<Scalar,2,3> > svd(m, ComputeFullV);
|
110
|
+
result.normal() = svd.matrixV().col(2);
|
111
|
+
}
|
112
|
+
else
|
113
|
+
result.normal() /= norm;
|
114
|
+
result.offset() = -p0.dot(result.normal());
|
115
|
+
return result;
|
116
|
+
}
|
117
|
+
|
118
|
+
/** Constructs a hyperplane passing through the parametrized line \a parametrized.
|
119
|
+
* If the dimension of the ambient space is greater than 2, then there isn't uniqueness,
|
120
|
+
* so an arbitrary choice is made.
|
121
|
+
*/
|
122
|
+
// FIXME to be consitent with the rest this could be implemented as a static Through function ??
|
123
|
+
explicit Hyperplane(const ParametrizedLine<Scalar, AmbientDimAtCompileTime>& parametrized)
|
124
|
+
{
|
125
|
+
normal() = parametrized.direction().unitOrthogonal();
|
126
|
+
offset() = -parametrized.origin().dot(normal());
|
127
|
+
}
|
128
|
+
|
129
|
+
~Hyperplane() {}
|
130
|
+
|
131
|
+
/** \returns the dimension in which the plane holds */
|
132
|
+
inline Index dim() const { return AmbientDimAtCompileTime==Dynamic ? m_coeffs.size()-1 : Index(AmbientDimAtCompileTime); }
|
133
|
+
|
134
|
+
/** normalizes \c *this */
|
135
|
+
void normalize(void)
|
136
|
+
{
|
137
|
+
m_coeffs /= normal().norm();
|
138
|
+
}
|
139
|
+
|
140
|
+
/** \returns the signed distance between the plane \c *this and a point \a p.
|
141
|
+
* \sa absDistance()
|
142
|
+
*/
|
143
|
+
inline Scalar signedDistance(const VectorType& p) const { return normal().dot(p) + offset(); }
|
144
|
+
|
145
|
+
/** \returns the absolute distance between the plane \c *this and a point \a p.
|
146
|
+
* \sa signedDistance()
|
147
|
+
*/
|
148
|
+
inline Scalar absDistance(const VectorType& p) const { using std::abs; return abs(signedDistance(p)); }
|
149
|
+
|
150
|
+
/** \returns the projection of a point \a p onto the plane \c *this.
|
151
|
+
*/
|
152
|
+
inline VectorType projection(const VectorType& p) const { return p - signedDistance(p) * normal(); }
|
153
|
+
|
154
|
+
/** \returns a constant reference to the unit normal vector of the plane, which corresponds
|
155
|
+
* to the linear part of the implicit equation.
|
156
|
+
*/
|
157
|
+
inline ConstNormalReturnType normal() const { return ConstNormalReturnType(m_coeffs,0,0,dim(),1); }
|
158
|
+
|
159
|
+
/** \returns a non-constant reference to the unit normal vector of the plane, which corresponds
|
160
|
+
* to the linear part of the implicit equation.
|
161
|
+
*/
|
162
|
+
inline NormalReturnType normal() { return NormalReturnType(m_coeffs,0,0,dim(),1); }
|
163
|
+
|
164
|
+
/** \returns the distance to the origin, which is also the "constant term" of the implicit equation
|
165
|
+
* \warning the vector normal is assumed to be normalized.
|
166
|
+
*/
|
167
|
+
inline const Scalar& offset() const { return m_coeffs.coeff(dim()); }
|
168
|
+
|
169
|
+
/** \returns a non-constant reference to the distance to the origin, which is also the constant part
|
170
|
+
* of the implicit equation */
|
171
|
+
inline Scalar& offset() { return m_coeffs(dim()); }
|
172
|
+
|
173
|
+
/** \returns a constant reference to the coefficients c_i of the plane equation:
|
174
|
+
* \f$ c_0*x_0 + ... + c_{d-1}*x_{d-1} + c_d = 0 \f$
|
175
|
+
*/
|
176
|
+
inline const Coefficients& coeffs() const { return m_coeffs; }
|
177
|
+
|
178
|
+
/** \returns a non-constant reference to the coefficients c_i of the plane equation:
|
179
|
+
* \f$ c_0*x_0 + ... + c_{d-1}*x_{d-1} + c_d = 0 \f$
|
180
|
+
*/
|
181
|
+
inline Coefficients& coeffs() { return m_coeffs; }
|
182
|
+
|
183
|
+
/** \returns the intersection of *this with \a other.
|
184
|
+
*
|
185
|
+
* \warning The ambient space must be a plane, i.e. have dimension 2, so that \c *this and \a other are lines.
|
186
|
+
*
|
187
|
+
* \note If \a other is approximately parallel to *this, this method will return any point on *this.
|
188
|
+
*/
|
189
|
+
VectorType intersection(const Hyperplane& other) const
|
190
|
+
{
|
191
|
+
using std::abs;
|
192
|
+
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(VectorType, 2)
|
193
|
+
Scalar det = coeffs().coeff(0) * other.coeffs().coeff(1) - coeffs().coeff(1) * other.coeffs().coeff(0);
|
194
|
+
// since the line equations ax+by=c are normalized with a^2+b^2=1, the following tests
|
195
|
+
// whether the two lines are approximately parallel.
|
196
|
+
if(internal::isMuchSmallerThan(det, Scalar(1)))
|
197
|
+
{ // special case where the two lines are approximately parallel. Pick any point on the first line.
|
198
|
+
if(abs(coeffs().coeff(1))>abs(coeffs().coeff(0)))
|
199
|
+
return VectorType(coeffs().coeff(1), -coeffs().coeff(2)/coeffs().coeff(1)-coeffs().coeff(0));
|
200
|
+
else
|
201
|
+
return VectorType(-coeffs().coeff(2)/coeffs().coeff(0)-coeffs().coeff(1), coeffs().coeff(0));
|
202
|
+
}
|
203
|
+
else
|
204
|
+
{ // general case
|
205
|
+
Scalar invdet = Scalar(1) / det;
|
206
|
+
return VectorType(invdet*(coeffs().coeff(1)*other.coeffs().coeff(2)-other.coeffs().coeff(1)*coeffs().coeff(2)),
|
207
|
+
invdet*(other.coeffs().coeff(0)*coeffs().coeff(2)-coeffs().coeff(0)*other.coeffs().coeff(2)));
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
211
|
+
/** Applies the transformation matrix \a mat to \c *this and returns a reference to \c *this.
|
212
|
+
*
|
213
|
+
* \param mat the Dim x Dim transformation matrix
|
214
|
+
* \param traits specifies whether the matrix \a mat represents an #Isometry
|
215
|
+
* or a more generic #Affine transformation. The default is #Affine.
|
216
|
+
*/
|
217
|
+
template<typename XprType>
|
218
|
+
inline Hyperplane& transform(const MatrixBase<XprType>& mat, TransformTraits traits = Affine)
|
219
|
+
{
|
220
|
+
if (traits==Affine)
|
221
|
+
normal() = mat.inverse().transpose() * normal();
|
222
|
+
else if (traits==Isometry)
|
223
|
+
normal() = mat * normal();
|
224
|
+
else
|
225
|
+
{
|
226
|
+
eigen_assert(0 && "invalid traits value in Hyperplane::transform()");
|
227
|
+
}
|
228
|
+
return *this;
|
229
|
+
}
|
230
|
+
|
231
|
+
/** Applies the transformation \a t to \c *this and returns a reference to \c *this.
|
232
|
+
*
|
233
|
+
* \param t the transformation of dimension Dim
|
234
|
+
* \param traits specifies whether the transformation \a t represents an #Isometry
|
235
|
+
* or a more generic #Affine transformation. The default is #Affine.
|
236
|
+
* Other kind of transformations are not supported.
|
237
|
+
*/
|
238
|
+
template<int TrOptions>
|
239
|
+
inline Hyperplane& transform(const Transform<Scalar,AmbientDimAtCompileTime,Affine,TrOptions>& t,
|
240
|
+
TransformTraits traits = Affine)
|
241
|
+
{
|
242
|
+
transform(t.linear(), traits);
|
243
|
+
offset() -= normal().dot(t.translation());
|
244
|
+
return *this;
|
245
|
+
}
|
246
|
+
|
247
|
+
/** \returns \c *this with scalar type casted to \a NewScalarType
|
248
|
+
*
|
249
|
+
* Note that if \a NewScalarType is equal to the current scalar type of \c *this
|
250
|
+
* then this function smartly returns a const reference to \c *this.
|
251
|
+
*/
|
252
|
+
template<typename NewScalarType>
|
253
|
+
inline typename internal::cast_return_type<Hyperplane,
|
254
|
+
Hyperplane<NewScalarType,AmbientDimAtCompileTime,Options> >::type cast() const
|
255
|
+
{
|
256
|
+
return typename internal::cast_return_type<Hyperplane,
|
257
|
+
Hyperplane<NewScalarType,AmbientDimAtCompileTime,Options> >::type(*this);
|
258
|
+
}
|
259
|
+
|
260
|
+
/** Copy constructor with scalar type conversion */
|
261
|
+
template<typename OtherScalarType,int OtherOptions>
|
262
|
+
inline explicit Hyperplane(const Hyperplane<OtherScalarType,AmbientDimAtCompileTime,OtherOptions>& other)
|
263
|
+
{ m_coeffs = other.coeffs().template cast<Scalar>(); }
|
264
|
+
|
265
|
+
/** \returns \c true if \c *this is approximately equal to \a other, within the precision
|
266
|
+
* determined by \a prec.
|
267
|
+
*
|
268
|
+
* \sa MatrixBase::isApprox() */
|
269
|
+
template<int OtherOptions>
|
270
|
+
bool isApprox(const Hyperplane<Scalar,AmbientDimAtCompileTime,OtherOptions>& other, const typename NumTraits<Scalar>::Real& prec = NumTraits<Scalar>::dummy_precision()) const
|
271
|
+
{ return m_coeffs.isApprox(other.m_coeffs, prec); }
|
272
|
+
|
273
|
+
protected:
|
274
|
+
|
275
|
+
Coefficients m_coeffs;
|
276
|
+
};
|
277
|
+
|
278
|
+
} // end namespace Eigen
|
279
|
+
|
280
|
+
#endif // EIGEN_HYPERPLANE_H
|