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,420 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2006-2010 Benoit Jacob <jacob.benoit.1@gmail.com>
|
5
|
+
// Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr>
|
6
|
+
//
|
7
|
+
// This Source Code Form is subject to the terms of the Mozilla
|
8
|
+
// Public License v. 2.0. If a copy of the MPL was not distributed
|
9
|
+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
10
|
+
|
11
|
+
#ifndef EIGEN_MATRIX_H
|
12
|
+
#define EIGEN_MATRIX_H
|
13
|
+
|
14
|
+
namespace Eigen {
|
15
|
+
|
16
|
+
/** \class Matrix
|
17
|
+
* \ingroup Core_Module
|
18
|
+
*
|
19
|
+
* \brief The matrix class, also used for vectors and row-vectors
|
20
|
+
*
|
21
|
+
* The %Matrix class is the work-horse for all \em dense (\ref dense "note") matrices and vectors within Eigen.
|
22
|
+
* Vectors are matrices with one column, and row-vectors are matrices with one row.
|
23
|
+
*
|
24
|
+
* The %Matrix class encompasses \em both fixed-size and dynamic-size objects (\ref fixedsize "note").
|
25
|
+
*
|
26
|
+
* The first three template parameters are required:
|
27
|
+
* \tparam _Scalar \anchor matrix_tparam_scalar Numeric type, e.g. float, double, int or std::complex<float>.
|
28
|
+
* User defined sclar types are supported as well (see \ref user_defined_scalars "here").
|
29
|
+
* \tparam _Rows Number of rows, or \b Dynamic
|
30
|
+
* \tparam _Cols Number of columns, or \b Dynamic
|
31
|
+
*
|
32
|
+
* The remaining template parameters are optional -- in most cases you don't have to worry about them.
|
33
|
+
* \tparam _Options \anchor matrix_tparam_options A combination of either \b #RowMajor or \b #ColMajor, and of either
|
34
|
+
* \b #AutoAlign or \b #DontAlign.
|
35
|
+
* The former controls \ref TopicStorageOrders "storage order", and defaults to column-major. The latter controls alignment, which is required
|
36
|
+
* for vectorization. It defaults to aligning matrices except for fixed sizes that aren't a multiple of the packet size.
|
37
|
+
* \tparam _MaxRows Maximum number of rows. Defaults to \a _Rows (\ref maxrows "note").
|
38
|
+
* \tparam _MaxCols Maximum number of columns. Defaults to \a _Cols (\ref maxrows "note").
|
39
|
+
*
|
40
|
+
* Eigen provides a number of typedefs covering the usual cases. Here are some examples:
|
41
|
+
*
|
42
|
+
* \li \c Matrix2d is a 2x2 square matrix of doubles (\c Matrix<double, 2, 2>)
|
43
|
+
* \li \c Vector4f is a vector of 4 floats (\c Matrix<float, 4, 1>)
|
44
|
+
* \li \c RowVector3i is a row-vector of 3 ints (\c Matrix<int, 1, 3>)
|
45
|
+
*
|
46
|
+
* \li \c MatrixXf is a dynamic-size matrix of floats (\c Matrix<float, Dynamic, Dynamic>)
|
47
|
+
* \li \c VectorXf is a dynamic-size vector of floats (\c Matrix<float, Dynamic, 1>)
|
48
|
+
*
|
49
|
+
* \li \c Matrix2Xf is a partially fixed-size (dynamic-size) matrix of floats (\c Matrix<float, 2, Dynamic>)
|
50
|
+
* \li \c MatrixX3d is a partially dynamic-size (fixed-size) matrix of double (\c Matrix<double, Dynamic, 3>)
|
51
|
+
*
|
52
|
+
* See \link matrixtypedefs this page \endlink for a complete list of predefined \em %Matrix and \em Vector typedefs.
|
53
|
+
*
|
54
|
+
* You can access elements of vectors and matrices using normal subscripting:
|
55
|
+
*
|
56
|
+
* \code
|
57
|
+
* Eigen::VectorXd v(10);
|
58
|
+
* v[0] = 0.1;
|
59
|
+
* v[1] = 0.2;
|
60
|
+
* v(0) = 0.3;
|
61
|
+
* v(1) = 0.4;
|
62
|
+
*
|
63
|
+
* Eigen::MatrixXi m(10, 10);
|
64
|
+
* m(0, 1) = 1;
|
65
|
+
* m(0, 2) = 2;
|
66
|
+
* m(0, 3) = 3;
|
67
|
+
* \endcode
|
68
|
+
*
|
69
|
+
* This class can be extended with the help of the plugin mechanism described on the page
|
70
|
+
* \ref TopicCustomizingEigen by defining the preprocessor symbol \c EIGEN_MATRIX_PLUGIN.
|
71
|
+
*
|
72
|
+
* <i><b>Some notes:</b></i>
|
73
|
+
*
|
74
|
+
* <dl>
|
75
|
+
* <dt><b>\anchor dense Dense versus sparse:</b></dt>
|
76
|
+
* <dd>This %Matrix class handles dense, not sparse matrices and vectors. For sparse matrices and vectors, see the Sparse module.
|
77
|
+
*
|
78
|
+
* Dense matrices and vectors are plain usual arrays of coefficients. All the coefficients are stored, in an ordinary contiguous array.
|
79
|
+
* This is unlike Sparse matrices and vectors where the coefficients are stored as a list of nonzero coefficients.</dd>
|
80
|
+
*
|
81
|
+
* <dt><b>\anchor fixedsize Fixed-size versus dynamic-size:</b></dt>
|
82
|
+
* <dd>Fixed-size means that the numbers of rows and columns are known are compile-time. In this case, Eigen allocates the array
|
83
|
+
* of coefficients as a fixed-size array, as a class member. This makes sense for very small matrices, typically up to 4x4, sometimes up
|
84
|
+
* to 16x16. Larger matrices should be declared as dynamic-size even if one happens to know their size at compile-time.
|
85
|
+
*
|
86
|
+
* Dynamic-size means that the numbers of rows or columns are not necessarily known at compile-time. In this case they are runtime
|
87
|
+
* variables, and the array of coefficients is allocated dynamically on the heap.
|
88
|
+
*
|
89
|
+
* Note that \em dense matrices, be they Fixed-size or Dynamic-size, <em>do not</em> expand dynamically in the sense of a std::map.
|
90
|
+
* If you want this behavior, see the Sparse module.</dd>
|
91
|
+
*
|
92
|
+
* <dt><b>\anchor maxrows _MaxRows and _MaxCols:</b></dt>
|
93
|
+
* <dd>In most cases, one just leaves these parameters to the default values.
|
94
|
+
* These parameters mean the maximum size of rows and columns that the matrix may have. They are useful in cases
|
95
|
+
* when the exact numbers of rows and columns are not known are compile-time, but it is known at compile-time that they cannot
|
96
|
+
* exceed a certain value. This happens when taking dynamic-size blocks inside fixed-size matrices: in this case _MaxRows and _MaxCols
|
97
|
+
* are the dimensions of the original matrix, while _Rows and _Cols are Dynamic.</dd>
|
98
|
+
* </dl>
|
99
|
+
*
|
100
|
+
* \see MatrixBase for the majority of the API methods for matrices, \ref TopicClassHierarchy,
|
101
|
+
* \ref TopicStorageOrders
|
102
|
+
*/
|
103
|
+
|
104
|
+
namespace internal {
|
105
|
+
template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
|
106
|
+
struct traits<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
|
107
|
+
{
|
108
|
+
typedef _Scalar Scalar;
|
109
|
+
typedef Dense StorageKind;
|
110
|
+
typedef DenseIndex Index;
|
111
|
+
typedef MatrixXpr XprKind;
|
112
|
+
enum {
|
113
|
+
RowsAtCompileTime = _Rows,
|
114
|
+
ColsAtCompileTime = _Cols,
|
115
|
+
MaxRowsAtCompileTime = _MaxRows,
|
116
|
+
MaxColsAtCompileTime = _MaxCols,
|
117
|
+
Flags = compute_matrix_flags<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::ret,
|
118
|
+
CoeffReadCost = NumTraits<Scalar>::ReadCost,
|
119
|
+
Options = _Options,
|
120
|
+
InnerStrideAtCompileTime = 1,
|
121
|
+
OuterStrideAtCompileTime = (Options&RowMajor) ? ColsAtCompileTime : RowsAtCompileTime
|
122
|
+
};
|
123
|
+
};
|
124
|
+
}
|
125
|
+
|
126
|
+
template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
|
127
|
+
class Matrix
|
128
|
+
: public PlainObjectBase<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
|
129
|
+
{
|
130
|
+
public:
|
131
|
+
|
132
|
+
/** \brief Base class typedef.
|
133
|
+
* \sa PlainObjectBase
|
134
|
+
*/
|
135
|
+
typedef PlainObjectBase<Matrix> Base;
|
136
|
+
|
137
|
+
enum { Options = _Options };
|
138
|
+
|
139
|
+
EIGEN_DENSE_PUBLIC_INTERFACE(Matrix)
|
140
|
+
|
141
|
+
typedef typename Base::PlainObject PlainObject;
|
142
|
+
|
143
|
+
using Base::base;
|
144
|
+
using Base::coeffRef;
|
145
|
+
|
146
|
+
/**
|
147
|
+
* \brief Assigns matrices to each other.
|
148
|
+
*
|
149
|
+
* \note This is a special case of the templated operator=. Its purpose is
|
150
|
+
* to prevent a default operator= from hiding the templated operator=.
|
151
|
+
*
|
152
|
+
* \callgraph
|
153
|
+
*/
|
154
|
+
EIGEN_STRONG_INLINE Matrix& operator=(const Matrix& other)
|
155
|
+
{
|
156
|
+
return Base::_set(other);
|
157
|
+
}
|
158
|
+
|
159
|
+
/** \internal
|
160
|
+
* \brief Copies the value of the expression \a other into \c *this with automatic resizing.
|
161
|
+
*
|
162
|
+
* *this might be resized to match the dimensions of \a other. If *this was a null matrix (not already initialized),
|
163
|
+
* it will be initialized.
|
164
|
+
*
|
165
|
+
* Note that copying a row-vector into a vector (and conversely) is allowed.
|
166
|
+
* The resizing, if any, is then done in the appropriate way so that row-vectors
|
167
|
+
* remain row-vectors and vectors remain vectors.
|
168
|
+
*/
|
169
|
+
template<typename OtherDerived>
|
170
|
+
EIGEN_STRONG_INLINE Matrix& operator=(const MatrixBase<OtherDerived>& other)
|
171
|
+
{
|
172
|
+
return Base::_set(other);
|
173
|
+
}
|
174
|
+
|
175
|
+
/* Here, doxygen failed to copy the brief information when using \copydoc */
|
176
|
+
|
177
|
+
/**
|
178
|
+
* \brief Copies the generic expression \a other into *this.
|
179
|
+
* \copydetails DenseBase::operator=(const EigenBase<OtherDerived> &other)
|
180
|
+
*/
|
181
|
+
template<typename OtherDerived>
|
182
|
+
EIGEN_STRONG_INLINE Matrix& operator=(const EigenBase<OtherDerived> &other)
|
183
|
+
{
|
184
|
+
return Base::operator=(other);
|
185
|
+
}
|
186
|
+
|
187
|
+
template<typename OtherDerived>
|
188
|
+
EIGEN_STRONG_INLINE Matrix& operator=(const ReturnByValue<OtherDerived>& func)
|
189
|
+
{
|
190
|
+
return Base::operator=(func);
|
191
|
+
}
|
192
|
+
|
193
|
+
/** \brief Default constructor.
|
194
|
+
*
|
195
|
+
* For fixed-size matrices, does nothing.
|
196
|
+
*
|
197
|
+
* For dynamic-size matrices, creates an empty matrix of size 0. Does not allocate any array. Such a matrix
|
198
|
+
* is called a null matrix. This constructor is the unique way to create null matrices: resizing
|
199
|
+
* a matrix to 0 is not supported.
|
200
|
+
*
|
201
|
+
* \sa resize(Index,Index)
|
202
|
+
*/
|
203
|
+
EIGEN_STRONG_INLINE Matrix() : Base()
|
204
|
+
{
|
205
|
+
Base::_check_template_params();
|
206
|
+
EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
|
207
|
+
}
|
208
|
+
|
209
|
+
// FIXME is it still needed
|
210
|
+
Matrix(internal::constructor_without_unaligned_array_assert)
|
211
|
+
: Base(internal::constructor_without_unaligned_array_assert())
|
212
|
+
{ Base::_check_template_params(); EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED }
|
213
|
+
|
214
|
+
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
|
215
|
+
Matrix(Matrix&& other)
|
216
|
+
: Base(std::move(other))
|
217
|
+
{
|
218
|
+
Base::_check_template_params();
|
219
|
+
if (RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic)
|
220
|
+
Base::_set_noalias(other);
|
221
|
+
}
|
222
|
+
Matrix& operator=(Matrix&& other)
|
223
|
+
{
|
224
|
+
other.swap(*this);
|
225
|
+
return *this;
|
226
|
+
}
|
227
|
+
#endif
|
228
|
+
|
229
|
+
/** \brief Constructs a vector or row-vector with given dimension. \only_for_vectors
|
230
|
+
*
|
231
|
+
* Note that this is only useful for dynamic-size vectors. For fixed-size vectors,
|
232
|
+
* it is redundant to pass the dimension here, so it makes more sense to use the default
|
233
|
+
* constructor Matrix() instead.
|
234
|
+
*/
|
235
|
+
EIGEN_STRONG_INLINE explicit Matrix(Index dim)
|
236
|
+
: Base(dim, RowsAtCompileTime == 1 ? 1 : dim, ColsAtCompileTime == 1 ? 1 : dim)
|
237
|
+
{
|
238
|
+
Base::_check_template_params();
|
239
|
+
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Matrix)
|
240
|
+
eigen_assert(dim >= 0);
|
241
|
+
eigen_assert(SizeAtCompileTime == Dynamic || SizeAtCompileTime == dim);
|
242
|
+
EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
|
243
|
+
}
|
244
|
+
|
245
|
+
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
246
|
+
template<typename T0, typename T1>
|
247
|
+
EIGEN_STRONG_INLINE Matrix(const T0& x, const T1& y)
|
248
|
+
{
|
249
|
+
Base::_check_template_params();
|
250
|
+
Base::template _init2<T0,T1>(x, y);
|
251
|
+
}
|
252
|
+
#else
|
253
|
+
/** \brief Constructs an uninitialized matrix with \a rows rows and \a cols columns.
|
254
|
+
*
|
255
|
+
* This is useful for dynamic-size matrices. For fixed-size matrices,
|
256
|
+
* it is redundant to pass these parameters, so one should use the default constructor
|
257
|
+
* Matrix() instead. */
|
258
|
+
Matrix(Index rows, Index cols);
|
259
|
+
/** \brief Constructs an initialized 2D vector with given coefficients */
|
260
|
+
Matrix(const Scalar& x, const Scalar& y);
|
261
|
+
#endif
|
262
|
+
|
263
|
+
/** \brief Constructs an initialized 3D vector with given coefficients */
|
264
|
+
EIGEN_STRONG_INLINE Matrix(const Scalar& x, const Scalar& y, const Scalar& z)
|
265
|
+
{
|
266
|
+
Base::_check_template_params();
|
267
|
+
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 3)
|
268
|
+
m_storage.data()[0] = x;
|
269
|
+
m_storage.data()[1] = y;
|
270
|
+
m_storage.data()[2] = z;
|
271
|
+
}
|
272
|
+
/** \brief Constructs an initialized 4D vector with given coefficients */
|
273
|
+
EIGEN_STRONG_INLINE Matrix(const Scalar& x, const Scalar& y, const Scalar& z, const Scalar& w)
|
274
|
+
{
|
275
|
+
Base::_check_template_params();
|
276
|
+
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 4)
|
277
|
+
m_storage.data()[0] = x;
|
278
|
+
m_storage.data()[1] = y;
|
279
|
+
m_storage.data()[2] = z;
|
280
|
+
m_storage.data()[3] = w;
|
281
|
+
}
|
282
|
+
|
283
|
+
explicit Matrix(const Scalar *data);
|
284
|
+
|
285
|
+
/** \brief Constructor copying the value of the expression \a other */
|
286
|
+
template<typename OtherDerived>
|
287
|
+
EIGEN_STRONG_INLINE Matrix(const MatrixBase<OtherDerived>& other)
|
288
|
+
: Base(other.rows() * other.cols(), other.rows(), other.cols())
|
289
|
+
{
|
290
|
+
// This test resides here, to bring the error messages closer to the user. Normally, these checks
|
291
|
+
// are performed deeply within the library, thus causing long and scary error traces.
|
292
|
+
EIGEN_STATIC_ASSERT((internal::is_same<Scalar, typename OtherDerived::Scalar>::value),
|
293
|
+
YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
|
294
|
+
|
295
|
+
Base::_check_template_params();
|
296
|
+
Base::_set_noalias(other);
|
297
|
+
}
|
298
|
+
/** \brief Copy constructor */
|
299
|
+
EIGEN_STRONG_INLINE Matrix(const Matrix& other)
|
300
|
+
: Base(other.rows() * other.cols(), other.rows(), other.cols())
|
301
|
+
{
|
302
|
+
Base::_check_template_params();
|
303
|
+
Base::_set_noalias(other);
|
304
|
+
}
|
305
|
+
/** \brief Copy constructor with in-place evaluation */
|
306
|
+
template<typename OtherDerived>
|
307
|
+
EIGEN_STRONG_INLINE Matrix(const ReturnByValue<OtherDerived>& other)
|
308
|
+
{
|
309
|
+
Base::_check_template_params();
|
310
|
+
Base::resize(other.rows(), other.cols());
|
311
|
+
other.evalTo(*this);
|
312
|
+
}
|
313
|
+
|
314
|
+
/** \brief Copy constructor for generic expressions.
|
315
|
+
* \sa MatrixBase::operator=(const EigenBase<OtherDerived>&)
|
316
|
+
*/
|
317
|
+
template<typename OtherDerived>
|
318
|
+
EIGEN_STRONG_INLINE Matrix(const EigenBase<OtherDerived> &other)
|
319
|
+
: Base(other.derived().rows() * other.derived().cols(), other.derived().rows(), other.derived().cols())
|
320
|
+
{
|
321
|
+
Base::_check_template_params();
|
322
|
+
Base::_resize_to_match(other);
|
323
|
+
// FIXME/CHECK: isn't *this = other.derived() more efficient. it allows to
|
324
|
+
// go for pure _set() implementations, right?
|
325
|
+
*this = other;
|
326
|
+
}
|
327
|
+
|
328
|
+
/** \internal
|
329
|
+
* \brief Override MatrixBase::swap() since for dynamic-sized matrices
|
330
|
+
* of same type it is enough to swap the data pointers.
|
331
|
+
*/
|
332
|
+
template<typename OtherDerived>
|
333
|
+
void swap(MatrixBase<OtherDerived> const & other)
|
334
|
+
{ this->_swap(other.derived()); }
|
335
|
+
|
336
|
+
inline Index innerStride() const { return 1; }
|
337
|
+
inline Index outerStride() const { return this->innerSize(); }
|
338
|
+
|
339
|
+
/////////// Geometry module ///////////
|
340
|
+
|
341
|
+
template<typename OtherDerived>
|
342
|
+
explicit Matrix(const RotationBase<OtherDerived,ColsAtCompileTime>& r);
|
343
|
+
template<typename OtherDerived>
|
344
|
+
Matrix& operator=(const RotationBase<OtherDerived,ColsAtCompileTime>& r);
|
345
|
+
|
346
|
+
#ifdef EIGEN2_SUPPORT
|
347
|
+
template<typename OtherDerived>
|
348
|
+
explicit Matrix(const eigen2_RotationBase<OtherDerived,ColsAtCompileTime>& r);
|
349
|
+
template<typename OtherDerived>
|
350
|
+
Matrix& operator=(const eigen2_RotationBase<OtherDerived,ColsAtCompileTime>& r);
|
351
|
+
#endif
|
352
|
+
|
353
|
+
// allow to extend Matrix outside Eigen
|
354
|
+
#ifdef EIGEN_MATRIX_PLUGIN
|
355
|
+
#include EIGEN_MATRIX_PLUGIN
|
356
|
+
#endif
|
357
|
+
|
358
|
+
protected:
|
359
|
+
template <typename Derived, typename OtherDerived, bool IsVector>
|
360
|
+
friend struct internal::conservative_resize_like_impl;
|
361
|
+
|
362
|
+
using Base::m_storage;
|
363
|
+
};
|
364
|
+
|
365
|
+
/** \defgroup matrixtypedefs Global matrix typedefs
|
366
|
+
*
|
367
|
+
* \ingroup Core_Module
|
368
|
+
*
|
369
|
+
* Eigen defines several typedef shortcuts for most common matrix and vector types.
|
370
|
+
*
|
371
|
+
* The general patterns are the following:
|
372
|
+
*
|
373
|
+
* \c MatrixSizeType where \c Size can be \c 2,\c 3,\c 4 for fixed size square matrices or \c X for dynamic size,
|
374
|
+
* and where \c Type can be \c i for integer, \c f for float, \c d for double, \c cf for complex float, \c cd
|
375
|
+
* for complex double.
|
376
|
+
*
|
377
|
+
* For example, \c Matrix3d is a fixed-size 3x3 matrix type of doubles, and \c MatrixXf is a dynamic-size matrix of floats.
|
378
|
+
*
|
379
|
+
* There are also \c VectorSizeType and \c RowVectorSizeType which are self-explanatory. For example, \c Vector4cf is
|
380
|
+
* a fixed-size vector of 4 complex floats.
|
381
|
+
*
|
382
|
+
* \sa class Matrix
|
383
|
+
*/
|
384
|
+
|
385
|
+
#define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \
|
386
|
+
/** \ingroup matrixtypedefs */ \
|
387
|
+
typedef Matrix<Type, Size, Size> Matrix##SizeSuffix##TypeSuffix; \
|
388
|
+
/** \ingroup matrixtypedefs */ \
|
389
|
+
typedef Matrix<Type, Size, 1> Vector##SizeSuffix##TypeSuffix; \
|
390
|
+
/** \ingroup matrixtypedefs */ \
|
391
|
+
typedef Matrix<Type, 1, Size> RowVector##SizeSuffix##TypeSuffix;
|
392
|
+
|
393
|
+
#define EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, Size) \
|
394
|
+
/** \ingroup matrixtypedefs */ \
|
395
|
+
typedef Matrix<Type, Size, Dynamic> Matrix##Size##X##TypeSuffix; \
|
396
|
+
/** \ingroup matrixtypedefs */ \
|
397
|
+
typedef Matrix<Type, Dynamic, Size> Matrix##X##Size##TypeSuffix;
|
398
|
+
|
399
|
+
#define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \
|
400
|
+
EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 2, 2) \
|
401
|
+
EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 3, 3) \
|
402
|
+
EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 4, 4) \
|
403
|
+
EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \
|
404
|
+
EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 2) \
|
405
|
+
EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 3) \
|
406
|
+
EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 4)
|
407
|
+
|
408
|
+
EIGEN_MAKE_TYPEDEFS_ALL_SIZES(int, i)
|
409
|
+
EIGEN_MAKE_TYPEDEFS_ALL_SIZES(float, f)
|
410
|
+
EIGEN_MAKE_TYPEDEFS_ALL_SIZES(double, d)
|
411
|
+
EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex<float>, cf)
|
412
|
+
EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex<double>, cd)
|
413
|
+
|
414
|
+
#undef EIGEN_MAKE_TYPEDEFS_ALL_SIZES
|
415
|
+
#undef EIGEN_MAKE_TYPEDEFS
|
416
|
+
#undef EIGEN_MAKE_FIXED_TYPEDEFS
|
417
|
+
|
418
|
+
} // end namespace Eigen
|
419
|
+
|
420
|
+
#endif // EIGEN_MATRIX_H
|
@@ -0,0 +1,563 @@
|
|
1
|
+
// This file is part of Eigen, a lightweight C++ template library
|
2
|
+
// for linear algebra.
|
3
|
+
//
|
4
|
+
// Copyright (C) 2006-2009 Benoit Jacob <jacob.benoit.1@gmail.com>
|
5
|
+
// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
|
6
|
+
//
|
7
|
+
// This Source Code Form is subject to the terms of the Mozilla
|
8
|
+
// Public License v. 2.0. If a copy of the MPL was not distributed
|
9
|
+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
10
|
+
|
11
|
+
#ifndef EIGEN_MATRIXBASE_H
|
12
|
+
#define EIGEN_MATRIXBASE_H
|
13
|
+
|
14
|
+
namespace Eigen {
|
15
|
+
|
16
|
+
/** \class MatrixBase
|
17
|
+
* \ingroup Core_Module
|
18
|
+
*
|
19
|
+
* \brief Base class for all dense matrices, vectors, and expressions
|
20
|
+
*
|
21
|
+
* This class is the base that is inherited by all matrix, vector, and related expression
|
22
|
+
* types. Most of the Eigen API is contained in this class, and its base classes. Other important
|
23
|
+
* classes for the Eigen API are Matrix, and VectorwiseOp.
|
24
|
+
*
|
25
|
+
* Note that some methods are defined in other modules such as the \ref LU_Module LU module
|
26
|
+
* for all functions related to matrix inversions.
|
27
|
+
*
|
28
|
+
* \tparam Derived is the derived type, e.g. a matrix type, or an expression, etc.
|
29
|
+
*
|
30
|
+
* When writing a function taking Eigen objects as argument, if you want your function
|
31
|
+
* to take as argument any matrix, vector, or expression, just let it take a
|
32
|
+
* MatrixBase argument. As an example, here is a function printFirstRow which, given
|
33
|
+
* a matrix, vector, or expression \a x, prints the first row of \a x.
|
34
|
+
*
|
35
|
+
* \code
|
36
|
+
template<typename Derived>
|
37
|
+
void printFirstRow(const Eigen::MatrixBase<Derived>& x)
|
38
|
+
{
|
39
|
+
cout << x.row(0) << endl;
|
40
|
+
}
|
41
|
+
* \endcode
|
42
|
+
*
|
43
|
+
* This class can be extended with the help of the plugin mechanism described on the page
|
44
|
+
* \ref TopicCustomizingEigen by defining the preprocessor symbol \c EIGEN_MATRIXBASE_PLUGIN.
|
45
|
+
*
|
46
|
+
* \sa \ref TopicClassHierarchy
|
47
|
+
*/
|
48
|
+
template<typename Derived> class MatrixBase
|
49
|
+
: public DenseBase<Derived>
|
50
|
+
{
|
51
|
+
public:
|
52
|
+
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
53
|
+
typedef MatrixBase StorageBaseType;
|
54
|
+
typedef typename internal::traits<Derived>::StorageKind StorageKind;
|
55
|
+
typedef typename internal::traits<Derived>::Index Index;
|
56
|
+
typedef typename internal::traits<Derived>::Scalar Scalar;
|
57
|
+
typedef typename internal::packet_traits<Scalar>::type PacketScalar;
|
58
|
+
typedef typename NumTraits<Scalar>::Real RealScalar;
|
59
|
+
|
60
|
+
typedef DenseBase<Derived> Base;
|
61
|
+
using Base::RowsAtCompileTime;
|
62
|
+
using Base::ColsAtCompileTime;
|
63
|
+
using Base::SizeAtCompileTime;
|
64
|
+
using Base::MaxRowsAtCompileTime;
|
65
|
+
using Base::MaxColsAtCompileTime;
|
66
|
+
using Base::MaxSizeAtCompileTime;
|
67
|
+
using Base::IsVectorAtCompileTime;
|
68
|
+
using Base::Flags;
|
69
|
+
using Base::CoeffReadCost;
|
70
|
+
|
71
|
+
using Base::derived;
|
72
|
+
using Base::const_cast_derived;
|
73
|
+
using Base::rows;
|
74
|
+
using Base::cols;
|
75
|
+
using Base::size;
|
76
|
+
using Base::coeff;
|
77
|
+
using Base::coeffRef;
|
78
|
+
using Base::lazyAssign;
|
79
|
+
using Base::eval;
|
80
|
+
using Base::operator+=;
|
81
|
+
using Base::operator-=;
|
82
|
+
using Base::operator*=;
|
83
|
+
using Base::operator/=;
|
84
|
+
|
85
|
+
typedef typename Base::CoeffReturnType CoeffReturnType;
|
86
|
+
typedef typename Base::ConstTransposeReturnType ConstTransposeReturnType;
|
87
|
+
typedef typename Base::RowXpr RowXpr;
|
88
|
+
typedef typename Base::ColXpr ColXpr;
|
89
|
+
#endif // not EIGEN_PARSED_BY_DOXYGEN
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
94
|
+
/** type of the equivalent square matrix */
|
95
|
+
typedef Matrix<Scalar,EIGEN_SIZE_MAX(RowsAtCompileTime,ColsAtCompileTime),
|
96
|
+
EIGEN_SIZE_MAX(RowsAtCompileTime,ColsAtCompileTime)> SquareMatrixType;
|
97
|
+
#endif // not EIGEN_PARSED_BY_DOXYGEN
|
98
|
+
|
99
|
+
/** \returns the size of the main diagonal, which is min(rows(),cols()).
|
100
|
+
* \sa rows(), cols(), SizeAtCompileTime. */
|
101
|
+
inline Index diagonalSize() const { return (std::min)(rows(),cols()); }
|
102
|
+
|
103
|
+
/** \brief The plain matrix type corresponding to this expression.
|
104
|
+
*
|
105
|
+
* This is not necessarily exactly the return type of eval(). In the case of plain matrices,
|
106
|
+
* the return type of eval() is a const reference to a matrix, not a matrix! It is however guaranteed
|
107
|
+
* that the return type of eval() is either PlainObject or const PlainObject&.
|
108
|
+
*/
|
109
|
+
typedef Matrix<typename internal::traits<Derived>::Scalar,
|
110
|
+
internal::traits<Derived>::RowsAtCompileTime,
|
111
|
+
internal::traits<Derived>::ColsAtCompileTime,
|
112
|
+
AutoAlign | (internal::traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor),
|
113
|
+
internal::traits<Derived>::MaxRowsAtCompileTime,
|
114
|
+
internal::traits<Derived>::MaxColsAtCompileTime
|
115
|
+
> PlainObject;
|
116
|
+
|
117
|
+
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
118
|
+
/** \internal Represents a matrix with all coefficients equal to one another*/
|
119
|
+
typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>,Derived> ConstantReturnType;
|
120
|
+
/** \internal the return type of MatrixBase::adjoint() */
|
121
|
+
typedef typename internal::conditional<NumTraits<Scalar>::IsComplex,
|
122
|
+
CwiseUnaryOp<internal::scalar_conjugate_op<Scalar>, ConstTransposeReturnType>,
|
123
|
+
ConstTransposeReturnType
|
124
|
+
>::type AdjointReturnType;
|
125
|
+
/** \internal Return type of eigenvalues() */
|
126
|
+
typedef Matrix<std::complex<RealScalar>, internal::traits<Derived>::ColsAtCompileTime, 1, ColMajor> EigenvaluesReturnType;
|
127
|
+
/** \internal the return type of identity */
|
128
|
+
typedef CwiseNullaryOp<internal::scalar_identity_op<Scalar>,Derived> IdentityReturnType;
|
129
|
+
/** \internal the return type of unit vectors */
|
130
|
+
typedef Block<const CwiseNullaryOp<internal::scalar_identity_op<Scalar>, SquareMatrixType>,
|
131
|
+
internal::traits<Derived>::RowsAtCompileTime,
|
132
|
+
internal::traits<Derived>::ColsAtCompileTime> BasisReturnType;
|
133
|
+
#endif // not EIGEN_PARSED_BY_DOXYGEN
|
134
|
+
|
135
|
+
#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::MatrixBase
|
136
|
+
# include "../plugins/CommonCwiseUnaryOps.h"
|
137
|
+
# include "../plugins/CommonCwiseBinaryOps.h"
|
138
|
+
# include "../plugins/MatrixCwiseUnaryOps.h"
|
139
|
+
# include "../plugins/MatrixCwiseBinaryOps.h"
|
140
|
+
# ifdef EIGEN_MATRIXBASE_PLUGIN
|
141
|
+
# include EIGEN_MATRIXBASE_PLUGIN
|
142
|
+
# endif
|
143
|
+
#undef EIGEN_CURRENT_STORAGE_BASE_CLASS
|
144
|
+
|
145
|
+
/** Special case of the template operator=, in order to prevent the compiler
|
146
|
+
* from generating a default operator= (issue hit with g++ 4.1)
|
147
|
+
*/
|
148
|
+
Derived& operator=(const MatrixBase& other);
|
149
|
+
|
150
|
+
// We cannot inherit here via Base::operator= since it is causing
|
151
|
+
// trouble with MSVC.
|
152
|
+
|
153
|
+
template <typename OtherDerived>
|
154
|
+
Derived& operator=(const DenseBase<OtherDerived>& other);
|
155
|
+
|
156
|
+
template <typename OtherDerived>
|
157
|
+
Derived& operator=(const EigenBase<OtherDerived>& other);
|
158
|
+
|
159
|
+
template<typename OtherDerived>
|
160
|
+
Derived& operator=(const ReturnByValue<OtherDerived>& other);
|
161
|
+
|
162
|
+
template<typename ProductDerived, typename Lhs, typename Rhs>
|
163
|
+
Derived& lazyAssign(const ProductBase<ProductDerived, Lhs,Rhs>& other);
|
164
|
+
|
165
|
+
template<typename MatrixPower, typename Lhs, typename Rhs>
|
166
|
+
Derived& lazyAssign(const MatrixPowerProduct<MatrixPower, Lhs,Rhs>& other);
|
167
|
+
|
168
|
+
template<typename OtherDerived>
|
169
|
+
Derived& operator+=(const MatrixBase<OtherDerived>& other);
|
170
|
+
template<typename OtherDerived>
|
171
|
+
Derived& operator-=(const MatrixBase<OtherDerived>& other);
|
172
|
+
|
173
|
+
template<typename OtherDerived>
|
174
|
+
const typename ProductReturnType<Derived,OtherDerived>::Type
|
175
|
+
operator*(const MatrixBase<OtherDerived> &other) const;
|
176
|
+
|
177
|
+
template<typename OtherDerived>
|
178
|
+
const typename LazyProductReturnType<Derived,OtherDerived>::Type
|
179
|
+
lazyProduct(const MatrixBase<OtherDerived> &other) const;
|
180
|
+
|
181
|
+
template<typename OtherDerived>
|
182
|
+
Derived& operator*=(const EigenBase<OtherDerived>& other);
|
183
|
+
|
184
|
+
template<typename OtherDerived>
|
185
|
+
void applyOnTheLeft(const EigenBase<OtherDerived>& other);
|
186
|
+
|
187
|
+
template<typename OtherDerived>
|
188
|
+
void applyOnTheRight(const EigenBase<OtherDerived>& other);
|
189
|
+
|
190
|
+
template<typename DiagonalDerived>
|
191
|
+
const DiagonalProduct<Derived, DiagonalDerived, OnTheRight>
|
192
|
+
operator*(const DiagonalBase<DiagonalDerived> &diagonal) const;
|
193
|
+
|
194
|
+
template<typename OtherDerived>
|
195
|
+
typename internal::scalar_product_traits<typename internal::traits<Derived>::Scalar,typename internal::traits<OtherDerived>::Scalar>::ReturnType
|
196
|
+
dot(const MatrixBase<OtherDerived>& other) const;
|
197
|
+
|
198
|
+
#ifdef EIGEN2_SUPPORT
|
199
|
+
template<typename OtherDerived>
|
200
|
+
Scalar eigen2_dot(const MatrixBase<OtherDerived>& other) const;
|
201
|
+
#endif
|
202
|
+
|
203
|
+
RealScalar squaredNorm() const;
|
204
|
+
RealScalar norm() const;
|
205
|
+
RealScalar stableNorm() const;
|
206
|
+
RealScalar blueNorm() const;
|
207
|
+
RealScalar hypotNorm() const;
|
208
|
+
const PlainObject normalized() const;
|
209
|
+
void normalize();
|
210
|
+
|
211
|
+
const AdjointReturnType adjoint() const;
|
212
|
+
void adjointInPlace();
|
213
|
+
|
214
|
+
typedef Diagonal<Derived> DiagonalReturnType;
|
215
|
+
DiagonalReturnType diagonal();
|
216
|
+
typedef typename internal::add_const<Diagonal<const Derived> >::type ConstDiagonalReturnType;
|
217
|
+
ConstDiagonalReturnType diagonal() const;
|
218
|
+
|
219
|
+
template<int Index> struct DiagonalIndexReturnType { typedef Diagonal<Derived,Index> Type; };
|
220
|
+
template<int Index> struct ConstDiagonalIndexReturnType { typedef const Diagonal<const Derived,Index> Type; };
|
221
|
+
|
222
|
+
template<int Index> typename DiagonalIndexReturnType<Index>::Type diagonal();
|
223
|
+
template<int Index> typename ConstDiagonalIndexReturnType<Index>::Type diagonal() const;
|
224
|
+
|
225
|
+
typedef Diagonal<Derived,DynamicIndex> DiagonalDynamicIndexReturnType;
|
226
|
+
typedef typename internal::add_const<Diagonal<const Derived,DynamicIndex> >::type ConstDiagonalDynamicIndexReturnType;
|
227
|
+
|
228
|
+
DiagonalDynamicIndexReturnType diagonal(Index index);
|
229
|
+
ConstDiagonalDynamicIndexReturnType diagonal(Index index) const;
|
230
|
+
|
231
|
+
#ifdef EIGEN2_SUPPORT
|
232
|
+
template<unsigned int Mode> typename internal::eigen2_part_return_type<Derived, Mode>::type part();
|
233
|
+
template<unsigned int Mode> const typename internal::eigen2_part_return_type<Derived, Mode>::type part() const;
|
234
|
+
|
235
|
+
// huuuge hack. make Eigen2's matrix.part<Diagonal>() work in eigen3. Problem: Diagonal is now a class template instead
|
236
|
+
// of an integer constant. Solution: overload the part() method template wrt template parameters list.
|
237
|
+
template<template<typename T, int N> class U>
|
238
|
+
const DiagonalWrapper<ConstDiagonalReturnType> part() const
|
239
|
+
{ return diagonal().asDiagonal(); }
|
240
|
+
#endif // EIGEN2_SUPPORT
|
241
|
+
|
242
|
+
template<unsigned int Mode> struct TriangularViewReturnType { typedef TriangularView<Derived, Mode> Type; };
|
243
|
+
template<unsigned int Mode> struct ConstTriangularViewReturnType { typedef const TriangularView<const Derived, Mode> Type; };
|
244
|
+
|
245
|
+
template<unsigned int Mode> typename TriangularViewReturnType<Mode>::Type triangularView();
|
246
|
+
template<unsigned int Mode> typename ConstTriangularViewReturnType<Mode>::Type triangularView() const;
|
247
|
+
|
248
|
+
template<unsigned int UpLo> struct SelfAdjointViewReturnType { typedef SelfAdjointView<Derived, UpLo> Type; };
|
249
|
+
template<unsigned int UpLo> struct ConstSelfAdjointViewReturnType { typedef const SelfAdjointView<const Derived, UpLo> Type; };
|
250
|
+
|
251
|
+
template<unsigned int UpLo> typename SelfAdjointViewReturnType<UpLo>::Type selfadjointView();
|
252
|
+
template<unsigned int UpLo> typename ConstSelfAdjointViewReturnType<UpLo>::Type selfadjointView() const;
|
253
|
+
|
254
|
+
const SparseView<Derived> sparseView(const Scalar& m_reference = Scalar(0),
|
255
|
+
const typename NumTraits<Scalar>::Real& m_epsilon = NumTraits<Scalar>::dummy_precision()) const;
|
256
|
+
static const IdentityReturnType Identity();
|
257
|
+
static const IdentityReturnType Identity(Index rows, Index cols);
|
258
|
+
static const BasisReturnType Unit(Index size, Index i);
|
259
|
+
static const BasisReturnType Unit(Index i);
|
260
|
+
static const BasisReturnType UnitX();
|
261
|
+
static const BasisReturnType UnitY();
|
262
|
+
static const BasisReturnType UnitZ();
|
263
|
+
static const BasisReturnType UnitW();
|
264
|
+
|
265
|
+
const DiagonalWrapper<const Derived> asDiagonal() const;
|
266
|
+
const PermutationWrapper<const Derived> asPermutation() const;
|
267
|
+
|
268
|
+
Derived& setIdentity();
|
269
|
+
Derived& setIdentity(Index rows, Index cols);
|
270
|
+
|
271
|
+
bool isIdentity(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
272
|
+
bool isDiagonal(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
273
|
+
|
274
|
+
bool isUpperTriangular(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
275
|
+
bool isLowerTriangular(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
276
|
+
|
277
|
+
template<typename OtherDerived>
|
278
|
+
bool isOrthogonal(const MatrixBase<OtherDerived>& other,
|
279
|
+
const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
280
|
+
bool isUnitary(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
281
|
+
|
282
|
+
/** \returns true if each coefficients of \c *this and \a other are all exactly equal.
|
283
|
+
* \warning When using floating point scalar values you probably should rather use a
|
284
|
+
* fuzzy comparison such as isApprox()
|
285
|
+
* \sa isApprox(), operator!= */
|
286
|
+
template<typename OtherDerived>
|
287
|
+
inline bool operator==(const MatrixBase<OtherDerived>& other) const
|
288
|
+
{ return cwiseEqual(other).all(); }
|
289
|
+
|
290
|
+
/** \returns true if at least one pair of coefficients of \c *this and \a other are not exactly equal to each other.
|
291
|
+
* \warning When using floating point scalar values you probably should rather use a
|
292
|
+
* fuzzy comparison such as isApprox()
|
293
|
+
* \sa isApprox(), operator== */
|
294
|
+
template<typename OtherDerived>
|
295
|
+
inline bool operator!=(const MatrixBase<OtherDerived>& other) const
|
296
|
+
{ return cwiseNotEqual(other).any(); }
|
297
|
+
|
298
|
+
NoAlias<Derived,Eigen::MatrixBase > noalias();
|
299
|
+
|
300
|
+
inline const ForceAlignedAccess<Derived> forceAlignedAccess() const;
|
301
|
+
inline ForceAlignedAccess<Derived> forceAlignedAccess();
|
302
|
+
template<bool Enable> inline typename internal::add_const_on_value_type<typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type>::type forceAlignedAccessIf() const;
|
303
|
+
template<bool Enable> inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf();
|
304
|
+
|
305
|
+
Scalar trace() const;
|
306
|
+
|
307
|
+
/////////// Array module ///////////
|
308
|
+
|
309
|
+
template<int p> RealScalar lpNorm() const;
|
310
|
+
|
311
|
+
MatrixBase<Derived>& matrix() { return *this; }
|
312
|
+
const MatrixBase<Derived>& matrix() const { return *this; }
|
313
|
+
|
314
|
+
/** \returns an \link Eigen::ArrayBase Array \endlink expression of this matrix
|
315
|
+
* \sa ArrayBase::matrix() */
|
316
|
+
ArrayWrapper<Derived> array() { return derived(); }
|
317
|
+
const ArrayWrapper<const Derived> array() const { return derived(); }
|
318
|
+
|
319
|
+
/////////// LU module ///////////
|
320
|
+
|
321
|
+
const FullPivLU<PlainObject> fullPivLu() const;
|
322
|
+
const PartialPivLU<PlainObject> partialPivLu() const;
|
323
|
+
|
324
|
+
#if EIGEN2_SUPPORT_STAGE < STAGE20_RESOLVE_API_CONFLICTS
|
325
|
+
const LU<PlainObject> lu() const;
|
326
|
+
#endif
|
327
|
+
|
328
|
+
#ifdef EIGEN2_SUPPORT
|
329
|
+
const LU<PlainObject> eigen2_lu() const;
|
330
|
+
#endif
|
331
|
+
|
332
|
+
#if EIGEN2_SUPPORT_STAGE > STAGE20_RESOLVE_API_CONFLICTS
|
333
|
+
const PartialPivLU<PlainObject> lu() const;
|
334
|
+
#endif
|
335
|
+
|
336
|
+
#ifdef EIGEN2_SUPPORT
|
337
|
+
template<typename ResultType>
|
338
|
+
void computeInverse(MatrixBase<ResultType> *result) const {
|
339
|
+
*result = this->inverse();
|
340
|
+
}
|
341
|
+
#endif
|
342
|
+
|
343
|
+
const internal::inverse_impl<Derived> inverse() const;
|
344
|
+
template<typename ResultType>
|
345
|
+
void computeInverseAndDetWithCheck(
|
346
|
+
ResultType& inverse,
|
347
|
+
typename ResultType::Scalar& determinant,
|
348
|
+
bool& invertible,
|
349
|
+
const RealScalar& absDeterminantThreshold = NumTraits<Scalar>::dummy_precision()
|
350
|
+
) const;
|
351
|
+
template<typename ResultType>
|
352
|
+
void computeInverseWithCheck(
|
353
|
+
ResultType& inverse,
|
354
|
+
bool& invertible,
|
355
|
+
const RealScalar& absDeterminantThreshold = NumTraits<Scalar>::dummy_precision()
|
356
|
+
) const;
|
357
|
+
Scalar determinant() const;
|
358
|
+
|
359
|
+
/////////// Cholesky module ///////////
|
360
|
+
|
361
|
+
const LLT<PlainObject> llt() const;
|
362
|
+
const LDLT<PlainObject> ldlt() const;
|
363
|
+
|
364
|
+
/////////// QR module ///////////
|
365
|
+
|
366
|
+
const HouseholderQR<PlainObject> householderQr() const;
|
367
|
+
const ColPivHouseholderQR<PlainObject> colPivHouseholderQr() const;
|
368
|
+
const FullPivHouseholderQR<PlainObject> fullPivHouseholderQr() const;
|
369
|
+
|
370
|
+
#ifdef EIGEN2_SUPPORT
|
371
|
+
const QR<PlainObject> qr() const;
|
372
|
+
#endif
|
373
|
+
|
374
|
+
EigenvaluesReturnType eigenvalues() const;
|
375
|
+
RealScalar operatorNorm() const;
|
376
|
+
|
377
|
+
/////////// SVD module ///////////
|
378
|
+
|
379
|
+
JacobiSVD<PlainObject> jacobiSvd(unsigned int computationOptions = 0) const;
|
380
|
+
|
381
|
+
#ifdef EIGEN2_SUPPORT
|
382
|
+
SVD<PlainObject> svd() const;
|
383
|
+
#endif
|
384
|
+
|
385
|
+
/////////// Geometry module ///////////
|
386
|
+
|
387
|
+
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
388
|
+
/// \internal helper struct to form the return type of the cross product
|
389
|
+
template<typename OtherDerived> struct cross_product_return_type {
|
390
|
+
typedef typename internal::scalar_product_traits<typename internal::traits<Derived>::Scalar,typename internal::traits<OtherDerived>::Scalar>::ReturnType Scalar;
|
391
|
+
typedef Matrix<Scalar,MatrixBase::RowsAtCompileTime,MatrixBase::ColsAtCompileTime> type;
|
392
|
+
};
|
393
|
+
#endif // EIGEN_PARSED_BY_DOXYGEN
|
394
|
+
template<typename OtherDerived>
|
395
|
+
typename cross_product_return_type<OtherDerived>::type
|
396
|
+
cross(const MatrixBase<OtherDerived>& other) const;
|
397
|
+
template<typename OtherDerived>
|
398
|
+
PlainObject cross3(const MatrixBase<OtherDerived>& other) const;
|
399
|
+
PlainObject unitOrthogonal(void) const;
|
400
|
+
Matrix<Scalar,3,1> eulerAngles(Index a0, Index a1, Index a2) const;
|
401
|
+
|
402
|
+
#if EIGEN2_SUPPORT_STAGE > STAGE20_RESOLVE_API_CONFLICTS
|
403
|
+
ScalarMultipleReturnType operator*(const UniformScaling<Scalar>& s) const;
|
404
|
+
// put this as separate enum value to work around possible GCC 4.3 bug (?)
|
405
|
+
enum { HomogeneousReturnTypeDirection = ColsAtCompileTime==1?Vertical:Horizontal };
|
406
|
+
typedef Homogeneous<Derived, HomogeneousReturnTypeDirection> HomogeneousReturnType;
|
407
|
+
HomogeneousReturnType homogeneous() const;
|
408
|
+
#endif
|
409
|
+
|
410
|
+
enum {
|
411
|
+
SizeMinusOne = SizeAtCompileTime==Dynamic ? Dynamic : SizeAtCompileTime-1
|
412
|
+
};
|
413
|
+
typedef Block<const Derived,
|
414
|
+
internal::traits<Derived>::ColsAtCompileTime==1 ? SizeMinusOne : 1,
|
415
|
+
internal::traits<Derived>::ColsAtCompileTime==1 ? 1 : SizeMinusOne> ConstStartMinusOne;
|
416
|
+
typedef CwiseUnaryOp<internal::scalar_quotient1_op<typename internal::traits<Derived>::Scalar>,
|
417
|
+
const ConstStartMinusOne > HNormalizedReturnType;
|
418
|
+
|
419
|
+
const HNormalizedReturnType hnormalized() const;
|
420
|
+
|
421
|
+
////////// Householder module ///////////
|
422
|
+
|
423
|
+
void makeHouseholderInPlace(Scalar& tau, RealScalar& beta);
|
424
|
+
template<typename EssentialPart>
|
425
|
+
void makeHouseholder(EssentialPart& essential,
|
426
|
+
Scalar& tau, RealScalar& beta) const;
|
427
|
+
template<typename EssentialPart>
|
428
|
+
void applyHouseholderOnTheLeft(const EssentialPart& essential,
|
429
|
+
const Scalar& tau,
|
430
|
+
Scalar* workspace);
|
431
|
+
template<typename EssentialPart>
|
432
|
+
void applyHouseholderOnTheRight(const EssentialPart& essential,
|
433
|
+
const Scalar& tau,
|
434
|
+
Scalar* workspace);
|
435
|
+
|
436
|
+
///////// Jacobi module /////////
|
437
|
+
|
438
|
+
template<typename OtherScalar>
|
439
|
+
void applyOnTheLeft(Index p, Index q, const JacobiRotation<OtherScalar>& j);
|
440
|
+
template<typename OtherScalar>
|
441
|
+
void applyOnTheRight(Index p, Index q, const JacobiRotation<OtherScalar>& j);
|
442
|
+
|
443
|
+
///////// SparseCore module /////////
|
444
|
+
|
445
|
+
template<typename OtherDerived>
|
446
|
+
EIGEN_STRONG_INLINE const typename SparseMatrixBase<OtherDerived>::template CwiseProductDenseReturnType<Derived>::Type
|
447
|
+
cwiseProduct(const SparseMatrixBase<OtherDerived> &other) const
|
448
|
+
{
|
449
|
+
return other.cwiseProduct(derived());
|
450
|
+
}
|
451
|
+
|
452
|
+
///////// MatrixFunctions module /////////
|
453
|
+
|
454
|
+
typedef typename internal::stem_function<Scalar>::type StemFunction;
|
455
|
+
const MatrixExponentialReturnValue<Derived> exp() const;
|
456
|
+
const MatrixFunctionReturnValue<Derived> matrixFunction(StemFunction f) const;
|
457
|
+
const MatrixFunctionReturnValue<Derived> cosh() const;
|
458
|
+
const MatrixFunctionReturnValue<Derived> sinh() const;
|
459
|
+
const MatrixFunctionReturnValue<Derived> cos() const;
|
460
|
+
const MatrixFunctionReturnValue<Derived> sin() const;
|
461
|
+
const MatrixSquareRootReturnValue<Derived> sqrt() const;
|
462
|
+
const MatrixLogarithmReturnValue<Derived> log() const;
|
463
|
+
const MatrixPowerReturnValue<Derived> pow(const RealScalar& p) const;
|
464
|
+
|
465
|
+
#ifdef EIGEN2_SUPPORT
|
466
|
+
template<typename ProductDerived, typename Lhs, typename Rhs>
|
467
|
+
Derived& operator+=(const Flagged<ProductBase<ProductDerived, Lhs,Rhs>, 0,
|
468
|
+
EvalBeforeAssigningBit>& other);
|
469
|
+
|
470
|
+
template<typename ProductDerived, typename Lhs, typename Rhs>
|
471
|
+
Derived& operator-=(const Flagged<ProductBase<ProductDerived, Lhs,Rhs>, 0,
|
472
|
+
EvalBeforeAssigningBit>& other);
|
473
|
+
|
474
|
+
/** \deprecated because .lazy() is deprecated
|
475
|
+
* Overloaded for cache friendly product evaluation */
|
476
|
+
template<typename OtherDerived>
|
477
|
+
Derived& lazyAssign(const Flagged<OtherDerived, 0, EvalBeforeAssigningBit>& other)
|
478
|
+
{ return lazyAssign(other._expression()); }
|
479
|
+
|
480
|
+
template<unsigned int Added>
|
481
|
+
const Flagged<Derived, Added, 0> marked() const;
|
482
|
+
const Flagged<Derived, 0, EvalBeforeAssigningBit> lazy() const;
|
483
|
+
|
484
|
+
inline const Cwise<Derived> cwise() const;
|
485
|
+
inline Cwise<Derived> cwise();
|
486
|
+
|
487
|
+
VectorBlock<Derived> start(Index size);
|
488
|
+
const VectorBlock<const Derived> start(Index size) const;
|
489
|
+
VectorBlock<Derived> end(Index size);
|
490
|
+
const VectorBlock<const Derived> end(Index size) const;
|
491
|
+
template<int Size> VectorBlock<Derived,Size> start();
|
492
|
+
template<int Size> const VectorBlock<const Derived,Size> start() const;
|
493
|
+
template<int Size> VectorBlock<Derived,Size> end();
|
494
|
+
template<int Size> const VectorBlock<const Derived,Size> end() const;
|
495
|
+
|
496
|
+
Minor<Derived> minor(Index row, Index col);
|
497
|
+
const Minor<Derived> minor(Index row, Index col) const;
|
498
|
+
#endif
|
499
|
+
|
500
|
+
protected:
|
501
|
+
MatrixBase() : Base() {}
|
502
|
+
|
503
|
+
private:
|
504
|
+
explicit MatrixBase(int);
|
505
|
+
MatrixBase(int,int);
|
506
|
+
template<typename OtherDerived> explicit MatrixBase(const MatrixBase<OtherDerived>&);
|
507
|
+
protected:
|
508
|
+
// mixing arrays and matrices is not legal
|
509
|
+
template<typename OtherDerived> Derived& operator+=(const ArrayBase<OtherDerived>& )
|
510
|
+
{EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;}
|
511
|
+
// mixing arrays and matrices is not legal
|
512
|
+
template<typename OtherDerived> Derived& operator-=(const ArrayBase<OtherDerived>& )
|
513
|
+
{EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;}
|
514
|
+
};
|
515
|
+
|
516
|
+
|
517
|
+
/***************************************************************************
|
518
|
+
* Implementation of matrix base methods
|
519
|
+
***************************************************************************/
|
520
|
+
|
521
|
+
/** replaces \c *this by \c *this * \a other.
|
522
|
+
*
|
523
|
+
* \returns a reference to \c *this
|
524
|
+
*
|
525
|
+
* Example: \include MatrixBase_applyOnTheRight.cpp
|
526
|
+
* Output: \verbinclude MatrixBase_applyOnTheRight.out
|
527
|
+
*/
|
528
|
+
template<typename Derived>
|
529
|
+
template<typename OtherDerived>
|
530
|
+
inline Derived&
|
531
|
+
MatrixBase<Derived>::operator*=(const EigenBase<OtherDerived> &other)
|
532
|
+
{
|
533
|
+
other.derived().applyThisOnTheRight(derived());
|
534
|
+
return derived();
|
535
|
+
}
|
536
|
+
|
537
|
+
/** replaces \c *this by \c *this * \a other. It is equivalent to MatrixBase::operator*=().
|
538
|
+
*
|
539
|
+
* Example: \include MatrixBase_applyOnTheRight.cpp
|
540
|
+
* Output: \verbinclude MatrixBase_applyOnTheRight.out
|
541
|
+
*/
|
542
|
+
template<typename Derived>
|
543
|
+
template<typename OtherDerived>
|
544
|
+
inline void MatrixBase<Derived>::applyOnTheRight(const EigenBase<OtherDerived> &other)
|
545
|
+
{
|
546
|
+
other.derived().applyThisOnTheRight(derived());
|
547
|
+
}
|
548
|
+
|
549
|
+
/** replaces \c *this by \a other * \c *this.
|
550
|
+
*
|
551
|
+
* Example: \include MatrixBase_applyOnTheLeft.cpp
|
552
|
+
* Output: \verbinclude MatrixBase_applyOnTheLeft.out
|
553
|
+
*/
|
554
|
+
template<typename Derived>
|
555
|
+
template<typename OtherDerived>
|
556
|
+
inline void MatrixBase<Derived>::applyOnTheLeft(const EigenBase<OtherDerived> &other)
|
557
|
+
{
|
558
|
+
other.derived().applyThisOnTheLeft(derived());
|
559
|
+
}
|
560
|
+
|
561
|
+
} // end namespace Eigen
|
562
|
+
|
563
|
+
#endif // EIGEN_MATRIXBASE_H
|