@smake/eigen 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/eigen/Eigen/AccelerateSupport +52 -0
- package/eigen/Eigen/Cholesky +18 -20
- package/eigen/Eigen/CholmodSupport +28 -28
- package/eigen/Eigen/Core +187 -120
- package/eigen/Eigen/Eigenvalues +16 -13
- package/eigen/Eigen/Geometry +18 -18
- package/eigen/Eigen/Householder +9 -7
- package/eigen/Eigen/IterativeLinearSolvers +8 -4
- package/eigen/Eigen/Jacobi +14 -13
- package/eigen/Eigen/KLUSupport +23 -21
- package/eigen/Eigen/LU +15 -16
- package/eigen/Eigen/MetisSupport +12 -12
- package/eigen/Eigen/OrderingMethods +54 -51
- package/eigen/Eigen/PaStiXSupport +23 -21
- package/eigen/Eigen/PardisoSupport +17 -14
- package/eigen/Eigen/QR +18 -20
- package/eigen/Eigen/QtAlignedMalloc +5 -12
- package/eigen/Eigen/SPQRSupport +21 -14
- package/eigen/Eigen/SVD +23 -17
- package/eigen/Eigen/Sparse +1 -2
- package/eigen/Eigen/SparseCholesky +18 -15
- package/eigen/Eigen/SparseCore +18 -17
- package/eigen/Eigen/SparseLU +9 -9
- package/eigen/Eigen/SparseQR +16 -14
- package/eigen/Eigen/StdDeque +5 -2
- package/eigen/Eigen/StdList +5 -2
- package/eigen/Eigen/StdVector +5 -2
- package/eigen/Eigen/SuperLUSupport +30 -24
- package/eigen/Eigen/ThreadPool +80 -0
- package/eigen/Eigen/UmfPackSupport +19 -17
- package/eigen/Eigen/Version +14 -0
- package/eigen/Eigen/src/AccelerateSupport/AccelerateSupport.h +423 -0
- package/eigen/Eigen/src/AccelerateSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Cholesky/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Cholesky/LDLT.h +366 -405
- package/eigen/Eigen/src/Cholesky/LLT.h +323 -367
- package/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h +81 -56
- package/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +585 -529
- package/eigen/Eigen/src/CholmodSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Core/ArithmeticSequence.h +143 -317
- package/eigen/Eigen/src/Core/Array.h +329 -370
- package/eigen/Eigen/src/Core/ArrayBase.h +190 -203
- package/eigen/Eigen/src/Core/ArrayWrapper.h +126 -170
- package/eigen/Eigen/src/Core/Assign.h +30 -40
- package/eigen/Eigen/src/Core/AssignEvaluator.h +651 -604
- package/eigen/Eigen/src/Core/Assign_MKL.h +125 -120
- package/eigen/Eigen/src/Core/BandMatrix.h +267 -282
- package/eigen/Eigen/src/Core/Block.h +371 -390
- package/eigen/Eigen/src/Core/CommaInitializer.h +85 -100
- package/eigen/Eigen/src/Core/ConditionEstimator.h +51 -53
- package/eigen/Eigen/src/Core/CoreEvaluators.h +1214 -937
- package/eigen/Eigen/src/Core/CoreIterators.h +72 -63
- package/eigen/Eigen/src/Core/CwiseBinaryOp.h +112 -129
- package/eigen/Eigen/src/Core/CwiseNullaryOp.h +676 -702
- package/eigen/Eigen/src/Core/CwiseTernaryOp.h +77 -103
- package/eigen/Eigen/src/Core/CwiseUnaryOp.h +55 -67
- package/eigen/Eigen/src/Core/CwiseUnaryView.h +127 -92
- package/eigen/Eigen/src/Core/DenseBase.h +630 -658
- package/eigen/Eigen/src/Core/DenseCoeffsBase.h +511 -628
- package/eigen/Eigen/src/Core/DenseStorage.h +511 -590
- package/eigen/Eigen/src/Core/DeviceWrapper.h +153 -0
- package/eigen/Eigen/src/Core/Diagonal.h +168 -207
- package/eigen/Eigen/src/Core/DiagonalMatrix.h +346 -317
- package/eigen/Eigen/src/Core/DiagonalProduct.h +12 -10
- package/eigen/Eigen/src/Core/Dot.h +167 -217
- package/eigen/Eigen/src/Core/EigenBase.h +74 -85
- package/eigen/Eigen/src/Core/Fill.h +138 -0
- package/eigen/Eigen/src/Core/FindCoeff.h +464 -0
- package/eigen/Eigen/src/Core/ForceAlignedAccess.h +90 -113
- package/eigen/Eigen/src/Core/Fuzzy.h +82 -105
- package/eigen/Eigen/src/Core/GeneralProduct.h +315 -261
- package/eigen/Eigen/src/Core/GenericPacketMath.h +1182 -520
- package/eigen/Eigen/src/Core/GlobalFunctions.h +193 -157
- package/eigen/Eigen/src/Core/IO.h +131 -156
- package/eigen/Eigen/src/Core/IndexedView.h +209 -125
- package/eigen/Eigen/src/Core/InnerProduct.h +260 -0
- package/eigen/Eigen/src/Core/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Core/Inverse.h +50 -59
- package/eigen/Eigen/src/Core/Map.h +123 -141
- package/eigen/Eigen/src/Core/MapBase.h +255 -282
- package/eigen/Eigen/src/Core/MathFunctions.h +1247 -1201
- package/eigen/Eigen/src/Core/MathFunctionsImpl.h +162 -99
- package/eigen/Eigen/src/Core/Matrix.h +463 -494
- package/eigen/Eigen/src/Core/MatrixBase.h +468 -470
- package/eigen/Eigen/src/Core/NestByValue.h +58 -52
- package/eigen/Eigen/src/Core/NoAlias.h +79 -86
- package/eigen/Eigen/src/Core/NumTraits.h +206 -206
- package/eigen/Eigen/src/Core/PartialReduxEvaluator.h +163 -142
- package/eigen/Eigen/src/Core/PermutationMatrix.h +461 -511
- package/eigen/Eigen/src/Core/PlainObjectBase.h +858 -972
- package/eigen/Eigen/src/Core/Product.h +246 -130
- package/eigen/Eigen/src/Core/ProductEvaluators.h +779 -671
- package/eigen/Eigen/src/Core/Random.h +153 -164
- package/eigen/Eigen/src/Core/RandomImpl.h +262 -0
- package/eigen/Eigen/src/Core/RealView.h +250 -0
- package/eigen/Eigen/src/Core/Redux.h +334 -314
- package/eigen/Eigen/src/Core/Ref.h +259 -257
- package/eigen/Eigen/src/Core/Replicate.h +92 -104
- package/eigen/Eigen/src/Core/Reshaped.h +215 -271
- package/eigen/Eigen/src/Core/ReturnByValue.h +47 -55
- package/eigen/Eigen/src/Core/Reverse.h +133 -148
- package/eigen/Eigen/src/Core/Select.h +68 -140
- package/eigen/Eigen/src/Core/SelfAdjointView.h +254 -290
- package/eigen/Eigen/src/Core/SelfCwiseBinaryOp.h +23 -20
- package/eigen/Eigen/src/Core/SkewSymmetricMatrix3.h +382 -0
- package/eigen/Eigen/src/Core/Solve.h +88 -102
- package/eigen/Eigen/src/Core/SolveTriangular.h +126 -124
- package/eigen/Eigen/src/Core/SolverBase.h +132 -133
- package/eigen/Eigen/src/Core/StableNorm.h +113 -147
- package/eigen/Eigen/src/Core/StlIterators.h +404 -248
- package/eigen/Eigen/src/Core/Stride.h +90 -92
- package/eigen/Eigen/src/Core/Swap.h +70 -39
- package/eigen/Eigen/src/Core/Transpose.h +258 -295
- package/eigen/Eigen/src/Core/Transpositions.h +270 -333
- package/eigen/Eigen/src/Core/TriangularMatrix.h +642 -743
- package/eigen/Eigen/src/Core/VectorBlock.h +59 -72
- package/eigen/Eigen/src/Core/VectorwiseOp.h +653 -704
- package/eigen/Eigen/src/Core/Visitor.h +464 -308
- package/eigen/Eigen/src/Core/arch/AVX/Complex.h +380 -187
- package/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +65 -163
- package/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +2145 -638
- package/eigen/Eigen/src/Core/arch/AVX/Reductions.h +353 -0
- package/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +253 -60
- package/eigen/Eigen/src/Core/arch/AVX512/Complex.h +278 -228
- package/eigen/Eigen/src/Core/arch/AVX512/GemmKernel.h +1245 -0
- package/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +48 -269
- package/eigen/Eigen/src/Core/arch/AVX512/MathFunctionsFP16.h +75 -0
- package/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1597 -754
- package/eigen/Eigen/src/Core/arch/AVX512/PacketMathFP16.h +1413 -0
- package/eigen/Eigen/src/Core/arch/AVX512/Reductions.h +297 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TrsmKernel.h +1167 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc +1219 -0
- package/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +229 -41
- package/eigen/Eigen/src/Core/arch/AVX512/TypeCastingFP16.h +130 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +420 -184
- package/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +40 -49
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2962 -2213
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +196 -212
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +713 -441
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h +742 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.inc +2818 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +2380 -1362
- package/eigen/Eigen/src/Core/arch/AltiVec/TypeCasting.h +153 -0
- package/eigen/Eigen/src/Core/arch/Default/BFloat16.h +390 -224
- package/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +78 -67
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1784 -799
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +167 -50
- package/eigen/Eigen/src/Core/arch/Default/Half.h +528 -379
- package/eigen/Eigen/src/Core/arch/Default/Settings.h +10 -12
- package/eigen/Eigen/src/Core/arch/GPU/Complex.h +244 -0
- package/eigen/Eigen/src/Core/arch/GPU/MathFunctions.h +41 -40
- package/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +550 -523
- package/eigen/Eigen/src/Core/arch/GPU/Tuple.h +268 -0
- package/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +27 -30
- package/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +8 -8
- package/eigen/Eigen/src/Core/arch/HVX/PacketMath.h +1088 -0
- package/eigen/Eigen/src/Core/arch/LSX/Complex.h +520 -0
- package/eigen/Eigen/src/Core/arch/LSX/GeneralBlockPanelKernel.h +23 -0
- package/eigen/Eigen/src/Core/arch/LSX/MathFunctions.h +43 -0
- package/eigen/Eigen/src/Core/arch/LSX/PacketMath.h +2866 -0
- package/eigen/Eigen/src/Core/arch/LSX/TypeCasting.h +526 -0
- package/eigen/Eigen/src/Core/arch/MSA/Complex.h +54 -82
- package/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +84 -92
- package/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +51 -47
- package/eigen/Eigen/src/Core/arch/NEON/Complex.h +454 -306
- package/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +175 -115
- package/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +23 -30
- package/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +4366 -2857
- package/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +616 -393
- package/eigen/Eigen/src/Core/arch/NEON/UnaryFunctors.h +57 -0
- package/eigen/Eigen/src/Core/arch/SSE/Complex.h +350 -198
- package/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +38 -149
- package/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +1791 -912
- package/eigen/Eigen/src/Core/arch/SSE/Reductions.h +324 -0
- package/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +128 -40
- package/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +10 -6
- package/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +156 -234
- package/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +6 -3
- package/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +27 -32
- package/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +119 -117
- package/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +325 -419
- package/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +15 -17
- package/eigen/Eigen/src/Core/arch/ZVector/Complex.h +325 -181
- package/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +94 -83
- package/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +811 -458
- package/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +121 -124
- package/eigen/Eigen/src/Core/functors/BinaryFunctors.h +576 -370
- package/eigen/Eigen/src/Core/functors/NullaryFunctors.h +194 -109
- package/eigen/Eigen/src/Core/functors/StlFunctors.h +95 -112
- package/eigen/Eigen/src/Core/functors/TernaryFunctors.h +34 -7
- package/eigen/Eigen/src/Core/functors/UnaryFunctors.h +1038 -749
- package/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1883 -1375
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +312 -370
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +189 -176
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +84 -81
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +154 -73
- package/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +292 -337
- package/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +80 -77
- package/eigen/Eigen/src/Core/products/Parallelizer.h +207 -105
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +327 -388
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +206 -224
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +138 -147
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +58 -61
- package/eigen/Eigen/src/Core/products/SelfadjointProduct.h +71 -71
- package/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +48 -47
- package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +294 -369
- package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +246 -238
- package/eigen/Eigen/src/Core/products/TriangularMatrixVector.h +244 -247
- package/eigen/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +212 -192
- package/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +328 -277
- package/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +108 -109
- package/eigen/Eigen/src/Core/products/TriangularSolverVector.h +68 -94
- package/eigen/Eigen/src/Core/util/Assert.h +158 -0
- package/eigen/Eigen/src/Core/util/BlasUtil.h +342 -303
- package/eigen/Eigen/src/Core/util/ConfigureVectorization.h +348 -317
- package/eigen/Eigen/src/Core/util/Constants.h +297 -262
- package/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +130 -90
- package/eigen/Eigen/src/Core/util/EmulateArray.h +270 -0
- package/eigen/Eigen/src/Core/util/ForwardDeclarations.h +449 -247
- package/eigen/Eigen/src/Core/util/GpuHipCudaDefines.inc +101 -0
- package/eigen/Eigen/src/Core/util/GpuHipCudaUndefines.inc +45 -0
- package/eigen/Eigen/src/Core/util/IndexedViewHelper.h +417 -116
- package/eigen/Eigen/src/Core/util/IntegralConstant.h +211 -204
- package/eigen/Eigen/src/Core/util/MKL_support.h +39 -37
- package/eigen/Eigen/src/Core/util/Macros.h +655 -773
- package/eigen/Eigen/src/Core/util/MaxSizeVector.h +139 -0
- package/eigen/Eigen/src/Core/util/Memory.h +970 -748
- package/eigen/Eigen/src/Core/util/Meta.h +581 -633
- package/eigen/Eigen/src/Core/util/MoreMeta.h +638 -0
- package/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +32 -19
- package/eigen/Eigen/src/Core/util/ReshapedHelper.h +17 -17
- package/eigen/Eigen/src/Core/util/Serializer.h +209 -0
- package/eigen/Eigen/src/Core/util/StaticAssert.h +50 -166
- package/eigen/Eigen/src/Core/util/SymbolicIndex.h +377 -225
- package/eigen/Eigen/src/Core/util/XprHelper.h +784 -547
- package/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +246 -277
- package/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +299 -319
- package/eigen/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +52 -48
- package/eigen/Eigen/src/Eigenvalues/EigenSolver.h +413 -456
- package/eigen/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +309 -325
- package/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +157 -171
- package/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +292 -310
- package/eigen/Eigen/src/Eigenvalues/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +89 -105
- package/eigen/Eigen/src/Eigenvalues/RealQZ.h +537 -607
- package/eigen/Eigen/src/Eigenvalues/RealSchur.h +342 -381
- package/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +41 -35
- package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +541 -595
- package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +47 -44
- package/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +430 -462
- package/eigen/Eigen/src/Geometry/AlignedBox.h +226 -227
- package/eigen/Eigen/src/Geometry/AngleAxis.h +131 -133
- package/eigen/Eigen/src/Geometry/EulerAngles.h +163 -74
- package/eigen/Eigen/src/Geometry/Homogeneous.h +285 -333
- package/eigen/Eigen/src/Geometry/Hyperplane.h +151 -160
- package/eigen/Eigen/src/Geometry/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Geometry/OrthoMethods.h +168 -146
- package/eigen/Eigen/src/Geometry/ParametrizedLine.h +127 -127
- package/eigen/Eigen/src/Geometry/Quaternion.h +566 -506
- package/eigen/Eigen/src/Geometry/Rotation2D.h +107 -105
- package/eigen/Eigen/src/Geometry/RotationBase.h +148 -145
- package/eigen/Eigen/src/Geometry/Scaling.h +113 -106
- package/eigen/Eigen/src/Geometry/Transform.h +858 -936
- package/eigen/Eigen/src/Geometry/Translation.h +94 -92
- package/eigen/Eigen/src/Geometry/Umeyama.h +79 -84
- package/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +90 -104
- package/eigen/Eigen/src/Householder/BlockHouseholder.h +51 -46
- package/eigen/Eigen/src/Householder/Householder.h +102 -124
- package/eigen/Eigen/src/Householder/HouseholderSequence.h +412 -453
- package/eigen/Eigen/src/Householder/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +149 -162
- package/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +124 -119
- package/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +92 -104
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +251 -243
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +224 -228
- package/eigen/Eigen/src/IterativeLinearSolvers/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +178 -227
- package/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +79 -84
- package/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +54 -60
- package/eigen/Eigen/src/Jacobi/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/Jacobi/Jacobi.h +252 -308
- package/eigen/Eigen/src/KLUSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/KLUSupport/KLUSupport.h +208 -227
- package/eigen/Eigen/src/LU/Determinant.h +50 -69
- package/eigen/Eigen/src/LU/FullPivLU.h +545 -596
- package/eigen/Eigen/src/LU/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/LU/InverseImpl.h +206 -285
- package/eigen/Eigen/src/LU/PartialPivLU.h +390 -428
- package/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h +54 -40
- package/eigen/Eigen/src/LU/arch/InverseSize4.h +72 -70
- package/eigen/Eigen/src/MetisSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/MetisSupport/MetisSupport.h +81 -93
- package/eigen/Eigen/src/OrderingMethods/Amd.h +243 -265
- package/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +831 -1004
- package/eigen/Eigen/src/OrderingMethods/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/OrderingMethods/Ordering.h +112 -119
- package/eigen/Eigen/src/PaStiXSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +524 -570
- package/eigen/Eigen/src/PardisoSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +385 -430
- package/eigen/Eigen/src/QR/ColPivHouseholderQR.h +479 -479
- package/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +120 -56
- package/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +166 -153
- package/eigen/Eigen/src/QR/FullPivHouseholderQR.h +495 -475
- package/eigen/Eigen/src/QR/HouseholderQR.h +394 -285
- package/eigen/Eigen/src/QR/HouseholderQR_LAPACKE.h +32 -23
- package/eigen/Eigen/src/QR/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SPQRSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +244 -264
- package/eigen/Eigen/src/SVD/BDCSVD.h +817 -713
- package/eigen/Eigen/src/SVD/BDCSVD_LAPACKE.h +174 -0
- package/eigen/Eigen/src/SVD/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SVD/JacobiSVD.h +577 -543
- package/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h +85 -49
- package/eigen/Eigen/src/SVD/SVDBase.h +242 -182
- package/eigen/Eigen/src/SVD/UpperBidiagonalization.h +200 -235
- package/eigen/Eigen/src/SparseCholesky/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +765 -594
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +308 -94
- package/eigen/Eigen/src/SparseCore/AmbiVector.h +202 -251
- package/eigen/Eigen/src/SparseCore/CompressedStorage.h +184 -252
- package/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +134 -178
- package/eigen/Eigen/src/SparseCore/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseCore/SparseAssign.h +149 -140
- package/eigen/Eigen/src/SparseCore/SparseBlock.h +403 -440
- package/eigen/Eigen/src/SparseCore/SparseColEtree.h +100 -112
- package/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +525 -303
- package/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +555 -339
- package/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +100 -108
- package/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +169 -197
- package/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h +71 -71
- package/eigen/Eigen/src/SparseCore/SparseDot.h +49 -47
- package/eigen/Eigen/src/SparseCore/SparseFuzzy.h +13 -11
- package/eigen/Eigen/src/SparseCore/SparseMap.h +243 -253
- package/eigen/Eigen/src/SparseCore/SparseMatrix.h +1603 -1245
- package/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +403 -350
- package/eigen/Eigen/src/SparseCore/SparsePermutation.h +186 -115
- package/eigen/Eigen/src/SparseCore/SparseProduct.h +94 -97
- package/eigen/Eigen/src/SparseCore/SparseRedux.h +22 -24
- package/eigen/Eigen/src/SparseCore/SparseRef.h +268 -295
- package/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +370 -416
- package/eigen/Eigen/src/SparseCore/SparseSolverBase.h +78 -87
- package/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +81 -95
- package/eigen/Eigen/src/SparseCore/SparseTranspose.h +62 -71
- package/eigen/Eigen/src/SparseCore/SparseTriangularView.h +132 -144
- package/eigen/Eigen/src/SparseCore/SparseUtil.h +138 -115
- package/eigen/Eigen/src/SparseCore/SparseVector.h +426 -372
- package/eigen/Eigen/src/SparseCore/SparseView.h +164 -193
- package/eigen/Eigen/src/SparseCore/TriangularSolver.h +129 -170
- package/eigen/Eigen/src/SparseLU/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseLU/SparseLU.h +756 -710
- package/eigen/Eigen/src/SparseLU/SparseLUImpl.h +61 -48
- package/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +102 -118
- package/eigen/Eigen/src/SparseLU/SparseLU_Structs.h +38 -35
- package/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +245 -301
- package/eigen/Eigen/src/SparseLU/SparseLU_Utils.h +44 -49
- package/eigen/Eigen/src/SparseLU/SparseLU_column_bmod.h +104 -108
- package/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +89 -100
- package/eigen/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +57 -58
- package/eigen/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +43 -55
- package/eigen/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +74 -71
- package/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +124 -132
- package/eigen/Eigen/src/SparseLU/SparseLU_panel_dfs.h +136 -159
- package/eigen/Eigen/src/SparseLU/SparseLU_pivotL.h +51 -52
- package/eigen/Eigen/src/SparseLU/SparseLU_pruneL.h +67 -73
- package/eigen/Eigen/src/SparseLU/SparseLU_relax_snode.h +24 -26
- package/eigen/Eigen/src/SparseQR/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SparseQR/SparseQR.h +450 -502
- package/eigen/Eigen/src/StlSupport/StdDeque.h +28 -93
- package/eigen/Eigen/src/StlSupport/StdList.h +28 -84
- package/eigen/Eigen/src/StlSupport/StdVector.h +28 -108
- package/eigen/Eigen/src/StlSupport/details.h +48 -50
- package/eigen/Eigen/src/SuperLUSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +634 -730
- package/eigen/Eigen/src/ThreadPool/Barrier.h +70 -0
- package/eigen/Eigen/src/ThreadPool/CoreThreadPoolDevice.h +336 -0
- package/eigen/Eigen/src/ThreadPool/EventCount.h +241 -0
- package/eigen/Eigen/src/ThreadPool/ForkJoin.h +140 -0
- package/eigen/Eigen/src/ThreadPool/InternalHeaderCheck.h +4 -0
- package/eigen/Eigen/src/ThreadPool/NonBlockingThreadPool.h +587 -0
- package/eigen/Eigen/src/ThreadPool/RunQueue.h +230 -0
- package/eigen/Eigen/src/ThreadPool/ThreadCancel.h +21 -0
- package/eigen/Eigen/src/ThreadPool/ThreadEnvironment.h +43 -0
- package/eigen/Eigen/src/ThreadPool/ThreadLocal.h +289 -0
- package/eigen/Eigen/src/ThreadPool/ThreadPoolInterface.h +50 -0
- package/eigen/Eigen/src/ThreadPool/ThreadYield.h +16 -0
- package/eigen/Eigen/src/UmfPackSupport/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +428 -464
- package/eigen/Eigen/src/misc/Image.h +41 -43
- package/eigen/Eigen/src/misc/InternalHeaderCheck.h +3 -0
- package/eigen/Eigen/src/misc/Kernel.h +39 -41
- package/eigen/Eigen/src/misc/RealSvd2x2.h +19 -21
- package/eigen/Eigen/src/misc/blas.h +83 -426
- package/eigen/Eigen/src/misc/lapacke.h +9972 -16179
- package/eigen/Eigen/src/misc/lapacke_helpers.h +163 -0
- package/eigen/Eigen/src/misc/lapacke_mangling.h +4 -5
- package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.inc +344 -0
- package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.inc +544 -0
- package/eigen/Eigen/src/plugins/{BlockMethods.h → BlockMethods.inc} +434 -506
- package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.inc +116 -0
- package/eigen/Eigen/src/plugins/{CommonCwiseUnaryOps.h → CommonCwiseUnaryOps.inc} +58 -68
- package/eigen/Eigen/src/plugins/IndexedViewMethods.inc +192 -0
- package/eigen/Eigen/src/plugins/InternalHeaderCheck.inc +3 -0
- package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.inc +331 -0
- package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.inc +118 -0
- package/eigen/Eigen/src/plugins/ReshapedMethods.inc +133 -0
- package/package.json +1 -1
- package/eigen/COPYING.APACHE +0 -203
- package/eigen/COPYING.BSD +0 -26
- package/eigen/COPYING.GPL +0 -674
- package/eigen/COPYING.LGPL +0 -502
- package/eigen/COPYING.MINPACK +0 -51
- package/eigen/COPYING.MPL2 +0 -373
- package/eigen/COPYING.README +0 -18
- package/eigen/Eigen/src/Core/BooleanRedux.h +0 -162
- package/eigen/Eigen/src/Core/arch/CUDA/Complex.h +0 -258
- package/eigen/Eigen/src/Core/arch/Default/TypeCasting.h +0 -120
- package/eigen/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +0 -694
- package/eigen/Eigen/src/Core/util/NonMPL2.h +0 -3
- package/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h +0 -67
- package/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +0 -280
- package/eigen/Eigen/src/misc/lapack.h +0 -152
- package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +0 -358
- package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +0 -696
- package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.h +0 -115
- package/eigen/Eigen/src/plugins/IndexedViewMethods.h +0 -262
- package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +0 -152
- package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +0 -95
- package/eigen/Eigen/src/plugins/ReshapedMethods.h +0 -149
- package/eigen/README.md +0 -5
|
@@ -12,1023 +12,922 @@
|
|
|
12
12
|
#define EIGEN_DENSESTORAGEBASE_H
|
|
13
13
|
|
|
14
14
|
#if defined(EIGEN_INITIALIZE_MATRICES_BY_ZERO)
|
|
15
|
-
#
|
|
16
|
-
#
|
|
15
|
+
#define EIGEN_INITIALIZE_COEFFS
|
|
16
|
+
#define EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED \
|
|
17
|
+
for (Index i = 0; i < base().size(); ++i) coeffRef(i) = Scalar(0);
|
|
17
18
|
#elif defined(EIGEN_INITIALIZE_MATRICES_BY_NAN)
|
|
18
|
-
#
|
|
19
|
-
#
|
|
19
|
+
#define EIGEN_INITIALIZE_COEFFS
|
|
20
|
+
#define EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED \
|
|
21
|
+
for (Index i = 0; i < base().size(); ++i) coeffRef(i) = std::numeric_limits<Scalar>::quiet_NaN();
|
|
20
22
|
#else
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
+
#undef EIGEN_INITIALIZE_COEFFS
|
|
24
|
+
#define EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
|
|
23
25
|
#endif
|
|
24
26
|
|
|
27
|
+
// IWYU pragma: private
|
|
28
|
+
#include "./InternalHeaderCheck.h"
|
|
29
|
+
|
|
25
30
|
namespace Eigen {
|
|
26
31
|
|
|
27
32
|
namespace internal {
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
#ifndef EIGEN_NO_DEBUG
|
|
35
|
+
template <int MaxSizeAtCompileTime, int MaxRowsAtCompileTime, int MaxColsAtCompileTime>
|
|
36
|
+
struct check_rows_cols_for_overflow {
|
|
37
|
+
EIGEN_STATIC_ASSERT(MaxRowsAtCompileTime* MaxColsAtCompileTime == MaxSizeAtCompileTime,
|
|
38
|
+
YOU MADE A PROGRAMMING MISTAKE)
|
|
39
|
+
template <typename Index>
|
|
40
|
+
EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE constexpr void run(Index, Index) {}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
template <int MaxRowsAtCompileTime>
|
|
44
|
+
struct check_rows_cols_for_overflow<Dynamic, MaxRowsAtCompileTime, Dynamic> {
|
|
45
|
+
template <typename Index>
|
|
46
|
+
EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE constexpr void run(Index, Index cols) {
|
|
47
|
+
constexpr Index MaxIndex = NumTraits<Index>::highest();
|
|
48
|
+
bool error = cols > (MaxIndex / MaxRowsAtCompileTime);
|
|
49
|
+
if (error) throw_std_bad_alloc();
|
|
34
50
|
}
|
|
35
51
|
};
|
|
36
52
|
|
|
37
|
-
template
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
static EIGEN_ALWAYS_INLINE void run(Index rows, Index
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Index max_index = (std::size_t(1) << (8 * sizeof(Index) - 1)) - 1; // assume Index is signed
|
|
45
|
-
bool error = (rows == 0 || cols == 0) ? false
|
|
46
|
-
: (rows > max_index / cols);
|
|
47
|
-
if (error)
|
|
48
|
-
throw_std_bad_alloc();
|
|
53
|
+
template <int MaxColsAtCompileTime>
|
|
54
|
+
struct check_rows_cols_for_overflow<Dynamic, Dynamic, MaxColsAtCompileTime> {
|
|
55
|
+
template <typename Index>
|
|
56
|
+
EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE constexpr void run(Index rows, Index) {
|
|
57
|
+
constexpr Index MaxIndex = NumTraits<Index>::highest();
|
|
58
|
+
bool error = rows > (MaxIndex / MaxColsAtCompileTime);
|
|
59
|
+
if (error) throw_std_bad_alloc();
|
|
49
60
|
}
|
|
50
61
|
};
|
|
51
62
|
|
|
52
|
-
template
|
|
53
|
-
|
|
63
|
+
template <>
|
|
64
|
+
struct check_rows_cols_for_overflow<Dynamic, Dynamic, Dynamic> {
|
|
65
|
+
template <typename Index>
|
|
66
|
+
EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE constexpr void run(Index rows, Index cols) {
|
|
67
|
+
constexpr Index MaxIndex = NumTraits<Index>::highest();
|
|
68
|
+
bool error = cols == 0 ? false : (rows > (MaxIndex / cols));
|
|
69
|
+
if (error) throw_std_bad_alloc();
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
#endif
|
|
73
|
+
|
|
74
|
+
template <typename Derived, typename OtherDerived = Derived,
|
|
54
75
|
bool IsVector = bool(Derived::IsVectorAtCompileTime) && bool(OtherDerived::IsVectorAtCompileTime)>
|
|
55
76
|
struct conservative_resize_like_impl;
|
|
56
77
|
|
|
57
|
-
template<typename MatrixTypeA, typename MatrixTypeB, bool SwapPointers>
|
|
78
|
+
template <typename MatrixTypeA, typename MatrixTypeB, bool SwapPointers>
|
|
79
|
+
struct matrix_swap_impl;
|
|
58
80
|
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
|
62
|
-
namespace doxygen {
|
|
63
|
-
|
|
64
|
-
// This is a workaround to doxygen not being able to understand the inheritance logic
|
|
65
|
-
// when it is hidden by the dense_xpr_base helper struct.
|
|
66
|
-
// Moreover, doxygen fails to include members that are not documented in the declaration body of
|
|
67
|
-
// MatrixBase if we inherits MatrixBase<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >,
|
|
68
|
-
// this is why we simply inherits MatrixBase, though this does not make sense.
|
|
69
|
-
|
|
70
|
-
/** This class is just a workaround for Doxygen and it does not not actually exist. */
|
|
71
|
-
template<typename Derived> struct dense_xpr_base_dispatcher;
|
|
72
|
-
/** This class is just a workaround for Doxygen and it does not not actually exist. */
|
|
73
|
-
template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
|
|
74
|
-
struct dense_xpr_base_dispatcher<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
|
|
75
|
-
: public MatrixBase {};
|
|
76
|
-
/** This class is just a workaround for Doxygen and it does not not actually exist. */
|
|
77
|
-
template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
|
|
78
|
-
struct dense_xpr_base_dispatcher<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
|
|
79
|
-
: public ArrayBase {};
|
|
80
|
-
|
|
81
|
-
} // namespace doxygen
|
|
81
|
+
} // end namespace internal
|
|
82
82
|
|
|
83
83
|
/** \class PlainObjectBase
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
template<typename Derived>
|
|
95
|
-
class PlainObjectBase : public
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
typedef
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
return m_storage.data()[colId + rowId * m_storage.cols()];
|
|
179
|
-
else // column-major
|
|
180
|
-
return m_storage.data()[rowId + colId * m_storage.rows()];
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/** This is an overloaded version of DenseCoeffsBase<Derived,WriteAccessors>::coeffRef(Index) const
|
|
184
|
-
* provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts.
|
|
185
|
-
*
|
|
186
|
-
* See DenseCoeffsBase<Derived,WriteAccessors>::coeffRef(Index) const for details. */
|
|
187
|
-
EIGEN_DEVICE_FUNC
|
|
188
|
-
EIGEN_STRONG_INLINE Scalar& coeffRef(Index index)
|
|
189
|
-
{
|
|
190
|
-
return m_storage.data()[index];
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/** This is the const version of coeffRef(Index,Index) which is thus synonym of coeff(Index,Index).
|
|
194
|
-
* It is provided for convenience. */
|
|
195
|
-
EIGEN_DEVICE_FUNC
|
|
196
|
-
EIGEN_STRONG_INLINE const Scalar& coeffRef(Index rowId, Index colId) const
|
|
197
|
-
{
|
|
198
|
-
if(Flags & RowMajorBit)
|
|
199
|
-
return m_storage.data()[colId + rowId * m_storage.cols()];
|
|
200
|
-
else // column-major
|
|
201
|
-
return m_storage.data()[rowId + colId * m_storage.rows()];
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/** This is the const version of coeffRef(Index) which is thus synonym of coeff(Index).
|
|
205
|
-
* It is provided for convenience. */
|
|
206
|
-
EIGEN_DEVICE_FUNC
|
|
207
|
-
EIGEN_STRONG_INLINE const Scalar& coeffRef(Index index) const
|
|
208
|
-
{
|
|
209
|
-
return m_storage.data()[index];
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/** \internal */
|
|
213
|
-
template<int LoadMode>
|
|
214
|
-
EIGEN_STRONG_INLINE PacketScalar packet(Index rowId, Index colId) const
|
|
215
|
-
{
|
|
216
|
-
return internal::ploadt<PacketScalar, LoadMode>
|
|
217
|
-
(m_storage.data() + (Flags & RowMajorBit
|
|
218
|
-
? colId + rowId * m_storage.cols()
|
|
219
|
-
: rowId + colId * m_storage.rows()));
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/** \internal */
|
|
223
|
-
template<int LoadMode>
|
|
224
|
-
EIGEN_STRONG_INLINE PacketScalar packet(Index index) const
|
|
225
|
-
{
|
|
226
|
-
return internal::ploadt<PacketScalar, LoadMode>(m_storage.data() + index);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
/** \internal */
|
|
230
|
-
template<int StoreMode>
|
|
231
|
-
EIGEN_STRONG_INLINE void writePacket(Index rowId, Index colId, const PacketScalar& val)
|
|
232
|
-
{
|
|
233
|
-
internal::pstoret<Scalar, PacketScalar, StoreMode>
|
|
234
|
-
(m_storage.data() + (Flags & RowMajorBit
|
|
235
|
-
? colId + rowId * m_storage.cols()
|
|
236
|
-
: rowId + colId * m_storage.rows()), val);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/** \internal */
|
|
240
|
-
template<int StoreMode>
|
|
241
|
-
EIGEN_STRONG_INLINE void writePacket(Index index, const PacketScalar& val)
|
|
242
|
-
{
|
|
243
|
-
internal::pstoret<Scalar, PacketScalar, StoreMode>(m_storage.data() + index, val);
|
|
244
|
-
}
|
|
84
|
+
* \ingroup Core_Module
|
|
85
|
+
* \brief %Dense storage base class for matrices and arrays.
|
|
86
|
+
*
|
|
87
|
+
* This class can be extended with the help of the plugin mechanism described on the page
|
|
88
|
+
* \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_PLAINOBJECTBASE_PLUGIN.
|
|
89
|
+
*
|
|
90
|
+
* \tparam Derived is the derived type, e.g., a Matrix or Array
|
|
91
|
+
*
|
|
92
|
+
* \sa \ref TopicClassHierarchy
|
|
93
|
+
*/
|
|
94
|
+
template <typename Derived>
|
|
95
|
+
class PlainObjectBase : public internal::dense_xpr_base<Derived>::type {
|
|
96
|
+
public:
|
|
97
|
+
enum { Options = internal::traits<Derived>::Options };
|
|
98
|
+
typedef typename internal::dense_xpr_base<Derived>::type Base;
|
|
99
|
+
|
|
100
|
+
typedef typename internal::traits<Derived>::StorageKind StorageKind;
|
|
101
|
+
typedef typename internal::traits<Derived>::Scalar Scalar;
|
|
102
|
+
|
|
103
|
+
typedef typename internal::packet_traits<Scalar>::type PacketScalar;
|
|
104
|
+
typedef typename NumTraits<Scalar>::Real RealScalar;
|
|
105
|
+
typedef Derived DenseType;
|
|
106
|
+
|
|
107
|
+
using Base::ColsAtCompileTime;
|
|
108
|
+
using Base::Flags;
|
|
109
|
+
using Base::IsVectorAtCompileTime;
|
|
110
|
+
using Base::MaxColsAtCompileTime;
|
|
111
|
+
using Base::MaxRowsAtCompileTime;
|
|
112
|
+
using Base::MaxSizeAtCompileTime;
|
|
113
|
+
using Base::RowsAtCompileTime;
|
|
114
|
+
using Base::SizeAtCompileTime;
|
|
115
|
+
|
|
116
|
+
typedef Eigen::Map<Derived, Unaligned> MapType;
|
|
117
|
+
typedef const Eigen::Map<const Derived, Unaligned> ConstMapType;
|
|
118
|
+
typedef Eigen::Map<Derived, AlignedMax> AlignedMapType;
|
|
119
|
+
typedef const Eigen::Map<const Derived, AlignedMax> ConstAlignedMapType;
|
|
120
|
+
template <typename StrideType>
|
|
121
|
+
struct StridedMapType {
|
|
122
|
+
typedef Eigen::Map<Derived, Unaligned, StrideType> type;
|
|
123
|
+
};
|
|
124
|
+
template <typename StrideType>
|
|
125
|
+
struct StridedConstMapType {
|
|
126
|
+
typedef Eigen::Map<const Derived, Unaligned, StrideType> type;
|
|
127
|
+
};
|
|
128
|
+
template <typename StrideType>
|
|
129
|
+
struct StridedAlignedMapType {
|
|
130
|
+
typedef Eigen::Map<Derived, AlignedMax, StrideType> type;
|
|
131
|
+
};
|
|
132
|
+
template <typename StrideType>
|
|
133
|
+
struct StridedConstAlignedMapType {
|
|
134
|
+
typedef Eigen::Map<const Derived, AlignedMax, StrideType> type;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
protected:
|
|
138
|
+
DenseStorage<Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Options> m_storage;
|
|
139
|
+
|
|
140
|
+
public:
|
|
141
|
+
enum { NeedsToAlign = (SizeAtCompileTime != Dynamic) && (internal::traits<Derived>::Alignment > 0) };
|
|
142
|
+
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign)
|
|
143
|
+
|
|
144
|
+
EIGEN_STATIC_ASSERT(internal::check_implication(MaxRowsAtCompileTime == 1 && MaxColsAtCompileTime != 1,
|
|
145
|
+
(int(Options) & RowMajor) == RowMajor),
|
|
146
|
+
INVALID_MATRIX_TEMPLATE_PARAMETERS)
|
|
147
|
+
EIGEN_STATIC_ASSERT(internal::check_implication(MaxColsAtCompileTime == 1 && MaxRowsAtCompileTime != 1,
|
|
148
|
+
(int(Options) & RowMajor) == 0),
|
|
149
|
+
INVALID_MATRIX_TEMPLATE_PARAMETERS)
|
|
150
|
+
EIGEN_STATIC_ASSERT((RowsAtCompileTime == Dynamic) || (RowsAtCompileTime >= 0), INVALID_MATRIX_TEMPLATE_PARAMETERS)
|
|
151
|
+
EIGEN_STATIC_ASSERT((ColsAtCompileTime == Dynamic) || (ColsAtCompileTime >= 0), INVALID_MATRIX_TEMPLATE_PARAMETERS)
|
|
152
|
+
EIGEN_STATIC_ASSERT((MaxRowsAtCompileTime == Dynamic) || (MaxRowsAtCompileTime >= 0),
|
|
153
|
+
INVALID_MATRIX_TEMPLATE_PARAMETERS)
|
|
154
|
+
EIGEN_STATIC_ASSERT((MaxColsAtCompileTime == Dynamic) || (MaxColsAtCompileTime >= 0),
|
|
155
|
+
INVALID_MATRIX_TEMPLATE_PARAMETERS)
|
|
156
|
+
EIGEN_STATIC_ASSERT((MaxRowsAtCompileTime == RowsAtCompileTime || RowsAtCompileTime == Dynamic),
|
|
157
|
+
INVALID_MATRIX_TEMPLATE_PARAMETERS)
|
|
158
|
+
EIGEN_STATIC_ASSERT((MaxColsAtCompileTime == ColsAtCompileTime || ColsAtCompileTime == Dynamic),
|
|
159
|
+
INVALID_MATRIX_TEMPLATE_PARAMETERS)
|
|
160
|
+
EIGEN_STATIC_ASSERT(((Options & (DontAlign | RowMajor)) == Options), INVALID_MATRIX_TEMPLATE_PARAMETERS)
|
|
161
|
+
|
|
162
|
+
EIGEN_DEVICE_FUNC Base& base() { return *static_cast<Base*>(this); }
|
|
163
|
+
EIGEN_DEVICE_FUNC const Base& base() const { return *static_cast<const Base*>(this); }
|
|
164
|
+
|
|
165
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const noexcept { return m_storage.rows(); }
|
|
166
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const noexcept { return m_storage.cols(); }
|
|
167
|
+
|
|
168
|
+
/** This is an overloaded version of DenseCoeffsBase<Derived,ReadOnlyAccessors>::coeff(Index,Index) const
|
|
169
|
+
* provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts.
|
|
170
|
+
*
|
|
171
|
+
* See DenseCoeffsBase<Derived,ReadOnlyAccessors>::coeff(Index) const for details. */
|
|
172
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const Scalar& coeff(Index rowId, Index colId) const {
|
|
173
|
+
if (Flags & RowMajorBit)
|
|
174
|
+
return m_storage.data()[colId + rowId * m_storage.cols()];
|
|
175
|
+
else // column-major
|
|
176
|
+
return m_storage.data()[rowId + colId * m_storage.rows()];
|
|
177
|
+
}
|
|
245
178
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
/** Resizes \c *this to a \a rows x \a cols matrix.
|
|
255
|
-
*
|
|
256
|
-
* This method is intended for dynamic-size matrices, although it is legal to call it on any
|
|
257
|
-
* matrix as long as fixed dimensions are left unchanged. If you only want to change the number
|
|
258
|
-
* of rows and/or of columns, you can use resize(NoChange_t, Index), resize(Index, NoChange_t).
|
|
259
|
-
*
|
|
260
|
-
* If the current number of coefficients of \c *this exactly matches the
|
|
261
|
-
* product \a rows * \a cols, then no memory allocation is performed and
|
|
262
|
-
* the current values are left unchanged. In all other cases, including
|
|
263
|
-
* shrinking, the data is reallocated and all previous values are lost.
|
|
264
|
-
*
|
|
265
|
-
* Example: \include Matrix_resize_int_int.cpp
|
|
266
|
-
* Output: \verbinclude Matrix_resize_int_int.out
|
|
267
|
-
*
|
|
268
|
-
* \sa resize(Index) for vectors, resize(NoChange_t, Index), resize(Index, NoChange_t)
|
|
269
|
-
*/
|
|
270
|
-
EIGEN_DEVICE_FUNC
|
|
271
|
-
EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
|
|
272
|
-
{
|
|
273
|
-
eigen_assert( EIGEN_IMPLIES(RowsAtCompileTime!=Dynamic,rows==RowsAtCompileTime)
|
|
274
|
-
&& EIGEN_IMPLIES(ColsAtCompileTime!=Dynamic,cols==ColsAtCompileTime)
|
|
275
|
-
&& EIGEN_IMPLIES(RowsAtCompileTime==Dynamic && MaxRowsAtCompileTime!=Dynamic,rows<=MaxRowsAtCompileTime)
|
|
276
|
-
&& EIGEN_IMPLIES(ColsAtCompileTime==Dynamic && MaxColsAtCompileTime!=Dynamic,cols<=MaxColsAtCompileTime)
|
|
277
|
-
&& rows>=0 && cols>=0 && "Invalid sizes when resizing a matrix or array.");
|
|
278
|
-
internal::check_rows_cols_for_overflow<MaxSizeAtCompileTime>::run(rows, cols);
|
|
279
|
-
#ifdef EIGEN_INITIALIZE_COEFFS
|
|
280
|
-
Index size = rows*cols;
|
|
281
|
-
bool size_changed = size != this->size();
|
|
282
|
-
m_storage.resize(size, rows, cols);
|
|
283
|
-
if(size_changed) EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
|
|
284
|
-
#else
|
|
285
|
-
m_storage.resize(rows*cols, rows, cols);
|
|
286
|
-
#endif
|
|
287
|
-
}
|
|
179
|
+
/** This is an overloaded version of DenseCoeffsBase<Derived,ReadOnlyAccessors>::coeff(Index) const
|
|
180
|
+
* provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts.
|
|
181
|
+
*
|
|
182
|
+
* See DenseCoeffsBase<Derived,ReadOnlyAccessors>::coeff(Index) const for details. */
|
|
183
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const Scalar& coeff(Index index) const {
|
|
184
|
+
return m_storage.data()[index];
|
|
185
|
+
}
|
|
288
186
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
*
|
|
298
|
-
|
|
299
|
-
*/
|
|
300
|
-
EIGEN_DEVICE_FUNC
|
|
301
|
-
inline void resize(Index size)
|
|
302
|
-
{
|
|
303
|
-
EIGEN_STATIC_ASSERT_VECTOR_ONLY(PlainObjectBase)
|
|
304
|
-
eigen_assert(((SizeAtCompileTime == Dynamic && (MaxSizeAtCompileTime==Dynamic || size<=MaxSizeAtCompileTime)) || SizeAtCompileTime == size) && size>=0);
|
|
305
|
-
#ifdef EIGEN_INITIALIZE_COEFFS
|
|
306
|
-
bool size_changed = size != this->size();
|
|
307
|
-
#endif
|
|
308
|
-
if(RowsAtCompileTime == 1)
|
|
309
|
-
m_storage.resize(size, 1, size);
|
|
310
|
-
else
|
|
311
|
-
m_storage.resize(size, size, 1);
|
|
312
|
-
#ifdef EIGEN_INITIALIZE_COEFFS
|
|
313
|
-
if(size_changed) EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
|
|
314
|
-
#endif
|
|
315
|
-
}
|
|
187
|
+
/** This is an overloaded version of DenseCoeffsBase<Derived,WriteAccessors>::coeffRef(Index,Index) const
|
|
188
|
+
* provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts.
|
|
189
|
+
*
|
|
190
|
+
* See DenseCoeffsBase<Derived,WriteAccessors>::coeffRef(Index,Index) const for details. */
|
|
191
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& coeffRef(Index rowId, Index colId) {
|
|
192
|
+
if (Flags & RowMajorBit)
|
|
193
|
+
return m_storage.data()[colId + rowId * m_storage.cols()];
|
|
194
|
+
else // column-major
|
|
195
|
+
return m_storage.data()[rowId + colId * m_storage.rows()];
|
|
196
|
+
}
|
|
316
197
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
198
|
+
/** This is an overloaded version of DenseCoeffsBase<Derived,WriteAccessors>::coeffRef(Index) const
|
|
199
|
+
* provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts.
|
|
200
|
+
*
|
|
201
|
+
* See DenseCoeffsBase<Derived,WriteAccessors>::coeffRef(Index) const for details. */
|
|
202
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& coeffRef(Index index) { return m_storage.data()[index]; }
|
|
203
|
+
|
|
204
|
+
/** This is the const version of coeffRef(Index,Index) which is thus synonym of coeff(Index,Index).
|
|
205
|
+
* It is provided for convenience. */
|
|
206
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const Scalar& coeffRef(Index rowId, Index colId) const {
|
|
207
|
+
if (Flags & RowMajorBit)
|
|
208
|
+
return m_storage.data()[colId + rowId * m_storage.cols()];
|
|
209
|
+
else // column-major
|
|
210
|
+
return m_storage.data()[rowId + colId * m_storage.rows()];
|
|
211
|
+
}
|
|
330
212
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
*
|
|
337
|
-
* \sa resize(Index,Index)
|
|
338
|
-
*/
|
|
339
|
-
EIGEN_DEVICE_FUNC
|
|
340
|
-
inline void resize(Index rows, NoChange_t)
|
|
341
|
-
{
|
|
342
|
-
resize(rows, cols());
|
|
343
|
-
}
|
|
213
|
+
/** This is the const version of coeffRef(Index) which is thus synonym of coeff(Index).
|
|
214
|
+
* It is provided for convenience. */
|
|
215
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const Scalar& coeffRef(Index index) const {
|
|
216
|
+
return m_storage.data()[index];
|
|
217
|
+
}
|
|
344
218
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
*/
|
|
352
|
-
template<typename OtherDerived>
|
|
353
|
-
EIGEN_DEVICE_FUNC
|
|
354
|
-
EIGEN_STRONG_INLINE void resizeLike(const EigenBase<OtherDerived>& _other)
|
|
355
|
-
{
|
|
356
|
-
const OtherDerived& other = _other.derived();
|
|
357
|
-
internal::check_rows_cols_for_overflow<MaxSizeAtCompileTime>::run(other.rows(), other.cols());
|
|
358
|
-
const Index othersize = other.rows()*other.cols();
|
|
359
|
-
if(RowsAtCompileTime == 1)
|
|
360
|
-
{
|
|
361
|
-
eigen_assert(other.rows() == 1 || other.cols() == 1);
|
|
362
|
-
resize(1, othersize);
|
|
363
|
-
}
|
|
364
|
-
else if(ColsAtCompileTime == 1)
|
|
365
|
-
{
|
|
366
|
-
eigen_assert(other.rows() == 1 || other.cols() == 1);
|
|
367
|
-
resize(othersize, 1);
|
|
368
|
-
}
|
|
369
|
-
else resize(other.rows(), other.cols());
|
|
370
|
-
}
|
|
219
|
+
/** \internal */
|
|
220
|
+
template <int LoadMode>
|
|
221
|
+
EIGEN_STRONG_INLINE PacketScalar packet(Index rowId, Index colId) const {
|
|
222
|
+
return internal::ploadt<PacketScalar, LoadMode>(
|
|
223
|
+
m_storage.data() + (Flags & RowMajorBit ? colId + rowId * m_storage.cols() : rowId + colId * m_storage.rows()));
|
|
224
|
+
}
|
|
371
225
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
*
|
|
378
|
-
* Matrices are resized relative to the top-left element. In case values need to be
|
|
379
|
-
* appended to the matrix they will be uninitialized.
|
|
380
|
-
*/
|
|
381
|
-
EIGEN_DEVICE_FUNC
|
|
382
|
-
EIGEN_STRONG_INLINE void conservativeResize(Index rows, Index cols)
|
|
383
|
-
{
|
|
384
|
-
internal::conservative_resize_like_impl<Derived>::run(*this, rows, cols);
|
|
385
|
-
}
|
|
226
|
+
/** \internal */
|
|
227
|
+
template <int LoadMode>
|
|
228
|
+
EIGEN_STRONG_INLINE PacketScalar packet(Index index) const {
|
|
229
|
+
return internal::ploadt<PacketScalar, LoadMode>(m_storage.data() + index);
|
|
230
|
+
}
|
|
386
231
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
EIGEN_DEVICE_FUNC
|
|
395
|
-
EIGEN_STRONG_INLINE void conservativeResize(Index rows, NoChange_t)
|
|
396
|
-
{
|
|
397
|
-
// Note: see the comment in conservativeResize(Index,Index)
|
|
398
|
-
conservativeResize(rows, cols());
|
|
399
|
-
}
|
|
232
|
+
/** \internal */
|
|
233
|
+
template <int StoreMode>
|
|
234
|
+
EIGEN_STRONG_INLINE void writePacket(Index rowId, Index colId, const PacketScalar& val) {
|
|
235
|
+
internal::pstoret<Scalar, PacketScalar, StoreMode>(
|
|
236
|
+
m_storage.data() + (Flags & RowMajorBit ? colId + rowId * m_storage.cols() : rowId + colId * m_storage.rows()),
|
|
237
|
+
val);
|
|
238
|
+
}
|
|
400
239
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
* In case the matrix is growing, new columns will be uninitialized.
|
|
407
|
-
*/
|
|
408
|
-
EIGEN_DEVICE_FUNC
|
|
409
|
-
EIGEN_STRONG_INLINE void conservativeResize(NoChange_t, Index cols)
|
|
410
|
-
{
|
|
411
|
-
// Note: see the comment in conservativeResize(Index,Index)
|
|
412
|
-
conservativeResize(rows(), cols);
|
|
413
|
-
}
|
|
240
|
+
/** \internal */
|
|
241
|
+
template <int StoreMode>
|
|
242
|
+
EIGEN_STRONG_INLINE void writePacket(Index index, const PacketScalar& val) {
|
|
243
|
+
internal::pstoret<Scalar, PacketScalar, StoreMode>(m_storage.data() + index, val);
|
|
244
|
+
}
|
|
414
245
|
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
246
|
+
/** \returns a const pointer to the data array of this matrix */
|
|
247
|
+
EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return m_storage.data(); }
|
|
248
|
+
|
|
249
|
+
/** \returns a pointer to the data array of this matrix */
|
|
250
|
+
EIGEN_DEVICE_FUNC constexpr Scalar* data() { return m_storage.data(); }
|
|
251
|
+
|
|
252
|
+
/** Resizes \c *this to a \a rows x \a cols matrix.
|
|
253
|
+
*
|
|
254
|
+
* This method is intended for dynamic-size matrices, although it is legal to call it on any
|
|
255
|
+
* matrix as long as fixed dimensions are left unchanged. If you only want to change the number
|
|
256
|
+
* of rows and/or of columns, you can use resize(NoChange_t, Index), resize(Index, NoChange_t).
|
|
257
|
+
*
|
|
258
|
+
* If the current number of coefficients of \c *this exactly matches the
|
|
259
|
+
* product \a rows * \a cols, then no memory allocation is performed and
|
|
260
|
+
* the current values are left unchanged. In all other cases, including
|
|
261
|
+
* shrinking, the data is reallocated and all previous values are lost.
|
|
262
|
+
*
|
|
263
|
+
* Example: \include Matrix_resize_int_int.cpp
|
|
264
|
+
* Output: \verbinclude Matrix_resize_int_int.out
|
|
265
|
+
*
|
|
266
|
+
* \sa resize(Index) for vectors, resize(NoChange_t, Index), resize(Index, NoChange_t)
|
|
267
|
+
*/
|
|
268
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void resize(Index rows, Index cols) {
|
|
269
|
+
eigen_assert(internal::check_implication(RowsAtCompileTime != Dynamic, rows == RowsAtCompileTime) &&
|
|
270
|
+
internal::check_implication(ColsAtCompileTime != Dynamic, cols == ColsAtCompileTime) &&
|
|
271
|
+
internal::check_implication(RowsAtCompileTime == Dynamic && MaxRowsAtCompileTime != Dynamic,
|
|
272
|
+
rows <= MaxRowsAtCompileTime) &&
|
|
273
|
+
internal::check_implication(ColsAtCompileTime == Dynamic && MaxColsAtCompileTime != Dynamic,
|
|
274
|
+
cols <= MaxColsAtCompileTime) &&
|
|
275
|
+
rows >= 0 && cols >= 0 && "Invalid sizes when resizing a matrix or array.");
|
|
276
|
+
#ifndef EIGEN_NO_DEBUG
|
|
277
|
+
internal::check_rows_cols_for_overflow<MaxSizeAtCompileTime, MaxRowsAtCompileTime, MaxColsAtCompileTime>::run(rows,
|
|
278
|
+
cols);
|
|
279
|
+
#endif
|
|
280
|
+
#ifdef EIGEN_INITIALIZE_COEFFS
|
|
281
|
+
Index size = rows * cols;
|
|
282
|
+
bool size_changed = size != this->size();
|
|
283
|
+
m_storage.resize(size, rows, cols);
|
|
284
|
+
if (size_changed) EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
|
|
285
|
+
#else
|
|
286
|
+
m_storage.resize(rows * cols, rows, cols);
|
|
287
|
+
#endif
|
|
288
|
+
}
|
|
428
289
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
290
|
+
/** Resizes \c *this to a vector of length \a size
|
|
291
|
+
*
|
|
292
|
+
* \only_for_vectors. This method does not work for
|
|
293
|
+
* partially dynamic matrices when the static dimension is anything other
|
|
294
|
+
* than 1. For example it will not work with Matrix<double, 2, Dynamic>.
|
|
295
|
+
*
|
|
296
|
+
* Example: \include Matrix_resize_int.cpp
|
|
297
|
+
* Output: \verbinclude Matrix_resize_int.out
|
|
298
|
+
*
|
|
299
|
+
* \sa resize(Index,Index), resize(NoChange_t, Index), resize(Index, NoChange_t)
|
|
300
|
+
*/
|
|
301
|
+
EIGEN_DEVICE_FUNC constexpr void resize(Index size) {
|
|
302
|
+
EIGEN_STATIC_ASSERT_VECTOR_ONLY(PlainObjectBase)
|
|
303
|
+
eigen_assert(((SizeAtCompileTime == Dynamic && (MaxSizeAtCompileTime == Dynamic || size <= MaxSizeAtCompileTime)) ||
|
|
304
|
+
SizeAtCompileTime == size) &&
|
|
305
|
+
size >= 0);
|
|
306
|
+
#ifdef EIGEN_INITIALIZE_COEFFS
|
|
307
|
+
bool size_changed = size != this->size();
|
|
308
|
+
#endif
|
|
309
|
+
if (RowsAtCompileTime == 1)
|
|
310
|
+
m_storage.resize(size, 1, size);
|
|
311
|
+
else
|
|
312
|
+
m_storage.resize(size, size, 1);
|
|
313
|
+
#ifdef EIGEN_INITIALIZE_COEFFS
|
|
314
|
+
if (size_changed) EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
|
|
315
|
+
#endif
|
|
316
|
+
}
|
|
444
317
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
318
|
+
/** Resizes the matrix, changing only the number of columns. For the parameter of type NoChange_t, just pass the
|
|
319
|
+
* special value \c NoChange as in the example below.
|
|
320
|
+
*
|
|
321
|
+
* Example: \include Matrix_resize_NoChange_int.cpp
|
|
322
|
+
* Output: \verbinclude Matrix_resize_NoChange_int.out
|
|
323
|
+
*
|
|
324
|
+
* \sa resize(Index,Index)
|
|
325
|
+
*/
|
|
326
|
+
EIGEN_DEVICE_FUNC constexpr void resize(NoChange_t, Index cols) { resize(rows(), cols); }
|
|
327
|
+
|
|
328
|
+
/** Resizes the matrix, changing only the number of rows. For the parameter of type NoChange_t, just pass the special
|
|
329
|
+
* value \c NoChange as in the example below.
|
|
330
|
+
*
|
|
331
|
+
* Example: \include Matrix_resize_int_NoChange.cpp
|
|
332
|
+
* Output: \verbinclude Matrix_resize_int_NoChange.out
|
|
333
|
+
*
|
|
334
|
+
* \sa resize(Index,Index)
|
|
335
|
+
*/
|
|
336
|
+
EIGEN_DEVICE_FUNC constexpr void resize(Index rows, NoChange_t) { resize(rows, cols()); }
|
|
337
|
+
|
|
338
|
+
/** Resizes \c *this to have the same dimensions as \a other.
|
|
339
|
+
* Takes care of doing all the checking that's needed.
|
|
340
|
+
*
|
|
341
|
+
* Note that copying a row-vector into a vector (and conversely) is allowed.
|
|
342
|
+
* The resizing, if any, is then done in the appropriate way so that row-vectors
|
|
343
|
+
* remain row-vectors and vectors remain vectors.
|
|
344
|
+
*/
|
|
345
|
+
template <typename OtherDerived>
|
|
346
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resizeLike(const EigenBase<OtherDerived>& _other) {
|
|
347
|
+
const OtherDerived& other = _other.derived();
|
|
348
|
+
#ifndef EIGEN_NO_DEBUG
|
|
349
|
+
internal::check_rows_cols_for_overflow<MaxSizeAtCompileTime, MaxRowsAtCompileTime, MaxColsAtCompileTime>::run(
|
|
350
|
+
other.rows(), other.cols());
|
|
351
|
+
#endif
|
|
352
|
+
const Index othersize = other.rows() * other.cols();
|
|
353
|
+
if (RowsAtCompileTime == 1) {
|
|
354
|
+
eigen_assert(other.rows() == 1 || other.cols() == 1);
|
|
355
|
+
resize(1, othersize);
|
|
356
|
+
} else if (ColsAtCompileTime == 1) {
|
|
357
|
+
eigen_assert(other.rows() == 1 || other.cols() == 1);
|
|
358
|
+
resize(othersize, 1);
|
|
359
|
+
} else
|
|
360
|
+
resize(other.rows(), other.cols());
|
|
361
|
+
}
|
|
453
362
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
363
|
+
/** Resizes the matrix to \a rows x \a cols while leaving old values untouched.
|
|
364
|
+
*
|
|
365
|
+
* The method is intended for matrices of dynamic size. If you only want to change the number
|
|
366
|
+
* of rows and/or of columns, you can use conservativeResize(NoChange_t, Index) or
|
|
367
|
+
* conservativeResize(Index, NoChange_t).
|
|
368
|
+
*
|
|
369
|
+
* Matrices are resized relative to the top-left element. In case values need to be
|
|
370
|
+
* appended to the matrix they will be uninitialized.
|
|
371
|
+
*/
|
|
372
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void conservativeResize(Index rows, Index cols) {
|
|
373
|
+
internal::conservative_resize_like_impl<Derived>::run(*this, rows, cols);
|
|
374
|
+
}
|
|
462
375
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
376
|
+
/** Resizes the matrix to \a rows x \a cols while leaving old values untouched.
|
|
377
|
+
*
|
|
378
|
+
* As opposed to conservativeResize(Index rows, Index cols), this version leaves
|
|
379
|
+
* the number of columns unchanged.
|
|
380
|
+
*
|
|
381
|
+
* In case the matrix is growing, new rows will be uninitialized.
|
|
382
|
+
*/
|
|
383
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void conservativeResize(Index rows, NoChange_t) {
|
|
384
|
+
// Note: see the comment in conservativeResize(Index,Index)
|
|
385
|
+
conservativeResize(rows, cols());
|
|
386
|
+
}
|
|
470
387
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
388
|
+
/** Resizes the matrix to \a rows x \a cols while leaving old values untouched.
|
|
389
|
+
*
|
|
390
|
+
* As opposed to conservativeResize(Index rows, Index cols), this version leaves
|
|
391
|
+
* the number of rows unchanged.
|
|
392
|
+
*
|
|
393
|
+
* In case the matrix is growing, new columns will be uninitialized.
|
|
394
|
+
*/
|
|
395
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void conservativeResize(NoChange_t, Index cols) {
|
|
396
|
+
// Note: see the comment in conservativeResize(Index,Index)
|
|
397
|
+
conservativeResize(rows(), cols);
|
|
398
|
+
}
|
|
474
399
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
400
|
+
/** Resizes the vector to \a size while retaining old values.
|
|
401
|
+
*
|
|
402
|
+
* \only_for_vectors. This method does not work for
|
|
403
|
+
* partially dynamic matrices when the static dimension is anything other
|
|
404
|
+
* than 1. For example it will not work with Matrix<double, 2, Dynamic>.
|
|
405
|
+
*
|
|
406
|
+
* When values are appended, they will be uninitialized.
|
|
407
|
+
*/
|
|
408
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void conservativeResize(Index size) {
|
|
409
|
+
internal::conservative_resize_like_impl<Derived>::run(*this, size);
|
|
410
|
+
}
|
|
481
411
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
412
|
+
/** Resizes the matrix to \a rows x \a cols of \c other, while leaving old values untouched.
|
|
413
|
+
*
|
|
414
|
+
* The method is intended for matrices of dynamic size. If you only want to change the number
|
|
415
|
+
* of rows and/or of columns, you can use conservativeResize(NoChange_t, Index) or
|
|
416
|
+
* conservativeResize(Index, NoChange_t).
|
|
417
|
+
*
|
|
418
|
+
* Matrices are resized relative to the top-left element. In case values need to be
|
|
419
|
+
* appended to the matrix they will copied from \c other.
|
|
420
|
+
*/
|
|
421
|
+
template <typename OtherDerived>
|
|
422
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void conservativeResizeLike(const DenseBase<OtherDerived>& other) {
|
|
423
|
+
internal::conservative_resize_like_impl<Derived, OtherDerived>::run(*this, other);
|
|
424
|
+
}
|
|
492
425
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
426
|
+
/** This is a special case of the templated operator=. Its purpose is to
|
|
427
|
+
* prevent a default operator= from hiding the templated operator=.
|
|
428
|
+
*/
|
|
429
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Derived& operator=(const PlainObjectBase& other) {
|
|
430
|
+
return _set(other);
|
|
431
|
+
}
|
|
499
432
|
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
}
|
|
507
|
-
#endif
|
|
433
|
+
/** \sa MatrixBase::lazyAssign() */
|
|
434
|
+
template <typename OtherDerived>
|
|
435
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& lazyAssign(const DenseBase<OtherDerived>& other) {
|
|
436
|
+
_resize_to_match(other);
|
|
437
|
+
return Base::lazyAssign(other.derived());
|
|
438
|
+
}
|
|
508
439
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
EIGEN_STRONG_INLINE PlainObjectBase(Index size, Index rows, Index cols)
|
|
515
|
-
: m_storage(size, rows, cols)
|
|
516
|
-
{
|
|
517
|
-
// _check_template_params();
|
|
518
|
-
// EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
|
|
519
|
-
}
|
|
440
|
+
template <typename OtherDerived>
|
|
441
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const ReturnByValue<OtherDerived>& func) {
|
|
442
|
+
resize(func.rows(), func.cols());
|
|
443
|
+
return Base::operator=(func);
|
|
444
|
+
}
|
|
520
445
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
template <typename... ArgTypes>
|
|
533
|
-
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
534
|
-
PlainObjectBase(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args)
|
|
535
|
-
: m_storage()
|
|
536
|
-
{
|
|
537
|
-
_check_template_params();
|
|
538
|
-
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, sizeof...(args) + 4);
|
|
539
|
-
m_storage.data()[0] = a0;
|
|
540
|
-
m_storage.data()[1] = a1;
|
|
541
|
-
m_storage.data()[2] = a2;
|
|
542
|
-
m_storage.data()[3] = a3;
|
|
543
|
-
Index i = 4;
|
|
544
|
-
auto x = {(m_storage.data()[i++] = args, 0)...};
|
|
545
|
-
static_cast<void>(x);
|
|
546
|
-
}
|
|
446
|
+
// Prevent user from trying to instantiate PlainObjectBase objects
|
|
447
|
+
// by making all its constructor protected. See bug 1074.
|
|
448
|
+
protected:
|
|
449
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr PlainObjectBase() = default;
|
|
450
|
+
/** \brief Move constructor */
|
|
451
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr PlainObjectBase(PlainObjectBase&&) = default;
|
|
452
|
+
/** \brief Move assignment operator */
|
|
453
|
+
EIGEN_DEVICE_FUNC constexpr PlainObjectBase& operator=(PlainObjectBase&& other) noexcept {
|
|
454
|
+
m_storage = std::move(other.m_storage);
|
|
455
|
+
return *this;
|
|
456
|
+
}
|
|
547
457
|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
458
|
+
/** Copy constructor */
|
|
459
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr PlainObjectBase(const PlainObjectBase&) = default;
|
|
460
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PlainObjectBase(Index size, Index rows, Index cols)
|
|
461
|
+
: m_storage(size, rows, cols) {}
|
|
462
|
+
|
|
463
|
+
/** \brief Construct a row of column vector with fixed size from an arbitrary number of coefficients.
|
|
464
|
+
*
|
|
465
|
+
* \only_for_vectors
|
|
466
|
+
*
|
|
467
|
+
* This constructor is for 1D array or vectors with more than 4 coefficients.
|
|
468
|
+
*
|
|
469
|
+
* \warning To construct a column (resp. row) vector of fixed length, the number of values passed to this
|
|
470
|
+
* constructor must match the the fixed number of rows (resp. columns) of \c *this.
|
|
471
|
+
*/
|
|
472
|
+
template <typename... ArgTypes>
|
|
473
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PlainObjectBase(const Scalar& a0, const Scalar& a1, const Scalar& a2,
|
|
474
|
+
const Scalar& a3, const ArgTypes&... args)
|
|
475
|
+
: m_storage() {
|
|
476
|
+
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, sizeof...(args) + 4);
|
|
477
|
+
m_storage.data()[0] = a0;
|
|
478
|
+
m_storage.data()[1] = a1;
|
|
479
|
+
m_storage.data()[2] = a2;
|
|
480
|
+
m_storage.data()[3] = a3;
|
|
481
|
+
Index i = 4;
|
|
482
|
+
auto x = {(m_storage.data()[i++] = args, 0)...};
|
|
483
|
+
static_cast<void>(x);
|
|
484
|
+
}
|
|
556
485
|
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
486
|
+
/** \brief Constructs a Matrix or Array and initializes it by elements given by an initializer list of initializer
|
|
487
|
+
* lists
|
|
488
|
+
*/
|
|
489
|
+
EIGEN_DEVICE_FUNC explicit constexpr EIGEN_STRONG_INLINE PlainObjectBase(
|
|
490
|
+
const std::initializer_list<std::initializer_list<Scalar>>& list)
|
|
491
|
+
: m_storage() {
|
|
492
|
+
size_t list_size = 0;
|
|
493
|
+
if (list.begin() != list.end()) {
|
|
494
|
+
list_size = list.begin()->size();
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// This is to allow syntax like VectorXi {{1, 2, 3, 4}}
|
|
498
|
+
if (ColsAtCompileTime == 1 && list.size() == 1) {
|
|
499
|
+
eigen_assert(list_size == static_cast<size_t>(RowsAtCompileTime) || RowsAtCompileTime == Dynamic);
|
|
500
|
+
resize(list_size, ColsAtCompileTime);
|
|
501
|
+
if (list.begin()->begin() != nullptr) {
|
|
502
|
+
Index index = 0;
|
|
503
|
+
for (const Scalar& e : *list.begin()) {
|
|
504
|
+
coeffRef(index++) = e;
|
|
505
|
+
}
|
|
560
506
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
eigen_assert(
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
for (const std::initializer_list<Scalar>& row : list) {
|
|
574
|
-
eigen_assert(list_size == row.size());
|
|
575
|
-
Index col_index = 0;
|
|
576
|
-
for (const Scalar& e : row) {
|
|
577
|
-
coeffRef(row_index, col_index) = e;
|
|
578
|
-
++col_index;
|
|
579
|
-
}
|
|
580
|
-
++row_index;
|
|
507
|
+
} else {
|
|
508
|
+
eigen_assert(list.size() == static_cast<size_t>(RowsAtCompileTime) || RowsAtCompileTime == Dynamic);
|
|
509
|
+
eigen_assert(list_size == static_cast<size_t>(ColsAtCompileTime) || ColsAtCompileTime == Dynamic);
|
|
510
|
+
resize(list.size(), list_size);
|
|
511
|
+
|
|
512
|
+
Index row_index = 0;
|
|
513
|
+
for (const std::initializer_list<Scalar>& row : list) {
|
|
514
|
+
eigen_assert(list_size == row.size());
|
|
515
|
+
Index col_index = 0;
|
|
516
|
+
for (const Scalar& e : row) {
|
|
517
|
+
coeffRef(row_index, col_index) = e;
|
|
518
|
+
++col_index;
|
|
581
519
|
}
|
|
520
|
+
++row_index;
|
|
582
521
|
}
|
|
583
522
|
}
|
|
584
|
-
|
|
523
|
+
}
|
|
585
524
|
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
_check_template_params();
|
|
593
|
-
resizeLike(other);
|
|
594
|
-
_set_noalias(other);
|
|
595
|
-
}
|
|
525
|
+
/** \sa PlainObjectBase::operator=(const EigenBase<OtherDerived>&) */
|
|
526
|
+
template <typename OtherDerived>
|
|
527
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PlainObjectBase(const DenseBase<OtherDerived>& other) : m_storage() {
|
|
528
|
+
resizeLike(other);
|
|
529
|
+
_set_noalias(other);
|
|
530
|
+
}
|
|
596
531
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
EIGEN_STRONG_INLINE PlainObjectBase(const ReturnByValue<OtherDerived>& other)
|
|
611
|
-
{
|
|
612
|
-
_check_template_params();
|
|
613
|
-
// FIXME this does not automatically transpose vectors if necessary
|
|
614
|
-
resize(other.rows(), other.cols());
|
|
615
|
-
other.evalTo(this->derived());
|
|
616
|
-
}
|
|
532
|
+
/** \sa PlainObjectBase::operator=(const EigenBase<OtherDerived>&) */
|
|
533
|
+
template <typename OtherDerived>
|
|
534
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PlainObjectBase(const EigenBase<OtherDerived>& other) : m_storage() {
|
|
535
|
+
resizeLike(other);
|
|
536
|
+
*this = other.derived();
|
|
537
|
+
}
|
|
538
|
+
/** \brief Copy constructor with in-place evaluation */
|
|
539
|
+
template <typename OtherDerived>
|
|
540
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PlainObjectBase(const ReturnByValue<OtherDerived>& other) {
|
|
541
|
+
// FIXME this does not automatically transpose vectors if necessary
|
|
542
|
+
resize(other.rows(), other.cols());
|
|
543
|
+
other.evalTo(this->derived());
|
|
544
|
+
}
|
|
617
545
|
|
|
618
|
-
|
|
546
|
+
public:
|
|
547
|
+
/** \brief Copies the generic expression \a other into *this.
|
|
548
|
+
* \copydetails DenseBase::operator=(const EigenBase<OtherDerived> &other)
|
|
549
|
+
*/
|
|
550
|
+
template <typename OtherDerived>
|
|
551
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const EigenBase<OtherDerived>& other) {
|
|
552
|
+
_resize_to_match(other);
|
|
553
|
+
Base::operator=(other.derived());
|
|
554
|
+
return this->derived();
|
|
555
|
+
}
|
|
619
556
|
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
557
|
+
/** \name Map
|
|
558
|
+
* These are convenience functions returning Map objects. The Map() static functions return unaligned Map objects,
|
|
559
|
+
* while the AlignedMap() functions return aligned Map objects and thus should be called only with 16-byte-aligned
|
|
560
|
+
* \a data pointers.
|
|
561
|
+
*
|
|
562
|
+
* Here is an example using strides:
|
|
563
|
+
* \include Matrix_Map_stride.cpp
|
|
564
|
+
* Output: \verbinclude Matrix_Map_stride.out
|
|
565
|
+
*
|
|
566
|
+
* \see class Map
|
|
567
|
+
*/
|
|
568
|
+
///@{
|
|
569
|
+
static inline ConstMapType Map(const Scalar* data) { return ConstMapType(data); }
|
|
570
|
+
static inline MapType Map(Scalar* data) { return MapType(data); }
|
|
571
|
+
static inline ConstMapType Map(const Scalar* data, Index size) { return ConstMapType(data, size); }
|
|
572
|
+
static inline MapType Map(Scalar* data, Index size) { return MapType(data, size); }
|
|
573
|
+
static inline ConstMapType Map(const Scalar* data, Index rows, Index cols) { return ConstMapType(data, rows, cols); }
|
|
574
|
+
static inline MapType Map(Scalar* data, Index rows, Index cols) { return MapType(data, rows, cols); }
|
|
575
|
+
|
|
576
|
+
static inline ConstAlignedMapType MapAligned(const Scalar* data) { return ConstAlignedMapType(data); }
|
|
577
|
+
static inline AlignedMapType MapAligned(Scalar* data) { return AlignedMapType(data); }
|
|
578
|
+
static inline ConstAlignedMapType MapAligned(const Scalar* data, Index size) {
|
|
579
|
+
return ConstAlignedMapType(data, size);
|
|
580
|
+
}
|
|
581
|
+
static inline AlignedMapType MapAligned(Scalar* data, Index size) { return AlignedMapType(data, size); }
|
|
582
|
+
static inline ConstAlignedMapType MapAligned(const Scalar* data, Index rows, Index cols) {
|
|
583
|
+
return ConstAlignedMapType(data, rows, cols);
|
|
584
|
+
}
|
|
585
|
+
static inline AlignedMapType MapAligned(Scalar* data, Index rows, Index cols) {
|
|
586
|
+
return AlignedMapType(data, rows, cols);
|
|
587
|
+
}
|
|
631
588
|
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
{ return ConstAlignedMapType(data, size); }
|
|
663
|
-
static inline AlignedMapType MapAligned(Scalar* data, Index size)
|
|
664
|
-
{ return AlignedMapType(data, size); }
|
|
665
|
-
static inline ConstAlignedMapType MapAligned(const Scalar* data, Index rows, Index cols)
|
|
666
|
-
{ return ConstAlignedMapType(data, rows, cols); }
|
|
667
|
-
static inline AlignedMapType MapAligned(Scalar* data, Index rows, Index cols)
|
|
668
|
-
{ return AlignedMapType(data, rows, cols); }
|
|
669
|
-
|
|
670
|
-
template<int Outer, int Inner>
|
|
671
|
-
static inline typename StridedConstMapType<Stride<Outer, Inner> >::type Map(const Scalar* data, const Stride<Outer, Inner>& stride)
|
|
672
|
-
{ return typename StridedConstMapType<Stride<Outer, Inner> >::type(data, stride); }
|
|
673
|
-
template<int Outer, int Inner>
|
|
674
|
-
static inline typename StridedMapType<Stride<Outer, Inner> >::type Map(Scalar* data, const Stride<Outer, Inner>& stride)
|
|
675
|
-
{ return typename StridedMapType<Stride<Outer, Inner> >::type(data, stride); }
|
|
676
|
-
template<int Outer, int Inner>
|
|
677
|
-
static inline typename StridedConstMapType<Stride<Outer, Inner> >::type Map(const Scalar* data, Index size, const Stride<Outer, Inner>& stride)
|
|
678
|
-
{ return typename StridedConstMapType<Stride<Outer, Inner> >::type(data, size, stride); }
|
|
679
|
-
template<int Outer, int Inner>
|
|
680
|
-
static inline typename StridedMapType<Stride<Outer, Inner> >::type Map(Scalar* data, Index size, const Stride<Outer, Inner>& stride)
|
|
681
|
-
{ return typename StridedMapType<Stride<Outer, Inner> >::type(data, size, stride); }
|
|
682
|
-
template<int Outer, int Inner>
|
|
683
|
-
static inline typename StridedConstMapType<Stride<Outer, Inner> >::type Map(const Scalar* data, Index rows, Index cols, const Stride<Outer, Inner>& stride)
|
|
684
|
-
{ return typename StridedConstMapType<Stride<Outer, Inner> >::type(data, rows, cols, stride); }
|
|
685
|
-
template<int Outer, int Inner>
|
|
686
|
-
static inline typename StridedMapType<Stride<Outer, Inner> >::type Map(Scalar* data, Index rows, Index cols, const Stride<Outer, Inner>& stride)
|
|
687
|
-
{ return typename StridedMapType<Stride<Outer, Inner> >::type(data, rows, cols, stride); }
|
|
688
|
-
|
|
689
|
-
template<int Outer, int Inner>
|
|
690
|
-
static inline typename StridedConstAlignedMapType<Stride<Outer, Inner> >::type MapAligned(const Scalar* data, const Stride<Outer, Inner>& stride)
|
|
691
|
-
{ return typename StridedConstAlignedMapType<Stride<Outer, Inner> >::type(data, stride); }
|
|
692
|
-
template<int Outer, int Inner>
|
|
693
|
-
static inline typename StridedAlignedMapType<Stride<Outer, Inner> >::type MapAligned(Scalar* data, const Stride<Outer, Inner>& stride)
|
|
694
|
-
{ return typename StridedAlignedMapType<Stride<Outer, Inner> >::type(data, stride); }
|
|
695
|
-
template<int Outer, int Inner>
|
|
696
|
-
static inline typename StridedConstAlignedMapType<Stride<Outer, Inner> >::type MapAligned(const Scalar* data, Index size, const Stride<Outer, Inner>& stride)
|
|
697
|
-
{ return typename StridedConstAlignedMapType<Stride<Outer, Inner> >::type(data, size, stride); }
|
|
698
|
-
template<int Outer, int Inner>
|
|
699
|
-
static inline typename StridedAlignedMapType<Stride<Outer, Inner> >::type MapAligned(Scalar* data, Index size, const Stride<Outer, Inner>& stride)
|
|
700
|
-
{ return typename StridedAlignedMapType<Stride<Outer, Inner> >::type(data, size, stride); }
|
|
701
|
-
template<int Outer, int Inner>
|
|
702
|
-
static inline typename StridedConstAlignedMapType<Stride<Outer, Inner> >::type MapAligned(const Scalar* data, Index rows, Index cols, const Stride<Outer, Inner>& stride)
|
|
703
|
-
{ return typename StridedConstAlignedMapType<Stride<Outer, Inner> >::type(data, rows, cols, stride); }
|
|
704
|
-
template<int Outer, int Inner>
|
|
705
|
-
static inline typename StridedAlignedMapType<Stride<Outer, Inner> >::type MapAligned(Scalar* data, Index rows, Index cols, const Stride<Outer, Inner>& stride)
|
|
706
|
-
{ return typename StridedAlignedMapType<Stride<Outer, Inner> >::type(data, rows, cols, stride); }
|
|
707
|
-
//@}
|
|
708
|
-
|
|
709
|
-
using Base::setConstant;
|
|
710
|
-
EIGEN_DEVICE_FUNC Derived& setConstant(Index size, const Scalar& val);
|
|
711
|
-
EIGEN_DEVICE_FUNC Derived& setConstant(Index rows, Index cols, const Scalar& val);
|
|
712
|
-
EIGEN_DEVICE_FUNC Derived& setConstant(NoChange_t, Index cols, const Scalar& val);
|
|
713
|
-
EIGEN_DEVICE_FUNC Derived& setConstant(Index rows, NoChange_t, const Scalar& val);
|
|
714
|
-
|
|
715
|
-
using Base::setZero;
|
|
716
|
-
EIGEN_DEVICE_FUNC Derived& setZero(Index size);
|
|
717
|
-
EIGEN_DEVICE_FUNC Derived& setZero(Index rows, Index cols);
|
|
718
|
-
EIGEN_DEVICE_FUNC Derived& setZero(NoChange_t, Index cols);
|
|
719
|
-
EIGEN_DEVICE_FUNC Derived& setZero(Index rows, NoChange_t);
|
|
720
|
-
|
|
721
|
-
using Base::setOnes;
|
|
722
|
-
EIGEN_DEVICE_FUNC Derived& setOnes(Index size);
|
|
723
|
-
EIGEN_DEVICE_FUNC Derived& setOnes(Index rows, Index cols);
|
|
724
|
-
EIGEN_DEVICE_FUNC Derived& setOnes(NoChange_t, Index cols);
|
|
725
|
-
EIGEN_DEVICE_FUNC Derived& setOnes(Index rows, NoChange_t);
|
|
726
|
-
|
|
727
|
-
using Base::setRandom;
|
|
728
|
-
Derived& setRandom(Index size);
|
|
729
|
-
Derived& setRandom(Index rows, Index cols);
|
|
730
|
-
Derived& setRandom(NoChange_t, Index cols);
|
|
731
|
-
Derived& setRandom(Index rows, NoChange_t);
|
|
732
|
-
|
|
733
|
-
#ifdef EIGEN_PLAINOBJECTBASE_PLUGIN
|
|
734
|
-
#include EIGEN_PLAINOBJECTBASE_PLUGIN
|
|
735
|
-
#endif
|
|
736
|
-
|
|
737
|
-
protected:
|
|
738
|
-
/** \internal Resizes *this in preparation for assigning \a other to it.
|
|
739
|
-
* Takes care of doing all the checking that's needed.
|
|
740
|
-
*
|
|
741
|
-
* Note that copying a row-vector into a vector (and conversely) is allowed.
|
|
742
|
-
* The resizing, if any, is then done in the appropriate way so that row-vectors
|
|
743
|
-
* remain row-vectors and vectors remain vectors.
|
|
744
|
-
*/
|
|
745
|
-
template<typename OtherDerived>
|
|
746
|
-
EIGEN_DEVICE_FUNC
|
|
747
|
-
EIGEN_STRONG_INLINE void _resize_to_match(const EigenBase<OtherDerived>& other)
|
|
748
|
-
{
|
|
749
|
-
#ifdef EIGEN_NO_AUTOMATIC_RESIZING
|
|
750
|
-
eigen_assert((this->size()==0 || (IsVectorAtCompileTime ? (this->size() == other.size())
|
|
751
|
-
: (rows() == other.rows() && cols() == other.cols())))
|
|
752
|
-
&& "Size mismatch. Automatic resizing is disabled because EIGEN_NO_AUTOMATIC_RESIZING is defined");
|
|
753
|
-
EIGEN_ONLY_USED_FOR_DEBUG(other);
|
|
754
|
-
#else
|
|
755
|
-
resizeLike(other);
|
|
756
|
-
#endif
|
|
757
|
-
}
|
|
589
|
+
template <int Outer, int Inner>
|
|
590
|
+
static inline typename StridedConstMapType<Stride<Outer, Inner>>::type Map(const Scalar* data,
|
|
591
|
+
const Stride<Outer, Inner>& stride) {
|
|
592
|
+
return typename StridedConstMapType<Stride<Outer, Inner>>::type(data, stride);
|
|
593
|
+
}
|
|
594
|
+
template <int Outer, int Inner>
|
|
595
|
+
static inline typename StridedMapType<Stride<Outer, Inner>>::type Map(Scalar* data,
|
|
596
|
+
const Stride<Outer, Inner>& stride) {
|
|
597
|
+
return typename StridedMapType<Stride<Outer, Inner>>::type(data, stride);
|
|
598
|
+
}
|
|
599
|
+
template <int Outer, int Inner>
|
|
600
|
+
static inline typename StridedConstMapType<Stride<Outer, Inner>>::type Map(const Scalar* data, Index size,
|
|
601
|
+
const Stride<Outer, Inner>& stride) {
|
|
602
|
+
return typename StridedConstMapType<Stride<Outer, Inner>>::type(data, size, stride);
|
|
603
|
+
}
|
|
604
|
+
template <int Outer, int Inner>
|
|
605
|
+
static inline typename StridedMapType<Stride<Outer, Inner>>::type Map(Scalar* data, Index size,
|
|
606
|
+
const Stride<Outer, Inner>& stride) {
|
|
607
|
+
return typename StridedMapType<Stride<Outer, Inner>>::type(data, size, stride);
|
|
608
|
+
}
|
|
609
|
+
template <int Outer, int Inner>
|
|
610
|
+
static inline typename StridedConstMapType<Stride<Outer, Inner>>::type Map(const Scalar* data, Index rows, Index cols,
|
|
611
|
+
const Stride<Outer, Inner>& stride) {
|
|
612
|
+
return typename StridedConstMapType<Stride<Outer, Inner>>::type(data, rows, cols, stride);
|
|
613
|
+
}
|
|
614
|
+
template <int Outer, int Inner>
|
|
615
|
+
static inline typename StridedMapType<Stride<Outer, Inner>>::type Map(Scalar* data, Index rows, Index cols,
|
|
616
|
+
const Stride<Outer, Inner>& stride) {
|
|
617
|
+
return typename StridedMapType<Stride<Outer, Inner>>::type(data, rows, cols, stride);
|
|
618
|
+
}
|
|
758
619
|
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
*
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
*
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
*
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
620
|
+
template <int Outer, int Inner>
|
|
621
|
+
static inline typename StridedConstAlignedMapType<Stride<Outer, Inner>>::type MapAligned(
|
|
622
|
+
const Scalar* data, const Stride<Outer, Inner>& stride) {
|
|
623
|
+
return typename StridedConstAlignedMapType<Stride<Outer, Inner>>::type(data, stride);
|
|
624
|
+
}
|
|
625
|
+
template <int Outer, int Inner>
|
|
626
|
+
static inline typename StridedAlignedMapType<Stride<Outer, Inner>>::type MapAligned(
|
|
627
|
+
Scalar* data, const Stride<Outer, Inner>& stride) {
|
|
628
|
+
return typename StridedAlignedMapType<Stride<Outer, Inner>>::type(data, stride);
|
|
629
|
+
}
|
|
630
|
+
template <int Outer, int Inner>
|
|
631
|
+
static inline typename StridedConstAlignedMapType<Stride<Outer, Inner>>::type MapAligned(
|
|
632
|
+
const Scalar* data, Index size, const Stride<Outer, Inner>& stride) {
|
|
633
|
+
return typename StridedConstAlignedMapType<Stride<Outer, Inner>>::type(data, size, stride);
|
|
634
|
+
}
|
|
635
|
+
template <int Outer, int Inner>
|
|
636
|
+
static inline typename StridedAlignedMapType<Stride<Outer, Inner>>::type MapAligned(
|
|
637
|
+
Scalar* data, Index size, const Stride<Outer, Inner>& stride) {
|
|
638
|
+
return typename StridedAlignedMapType<Stride<Outer, Inner>>::type(data, size, stride);
|
|
639
|
+
}
|
|
640
|
+
template <int Outer, int Inner>
|
|
641
|
+
static inline typename StridedConstAlignedMapType<Stride<Outer, Inner>>::type MapAligned(
|
|
642
|
+
const Scalar* data, Index rows, Index cols, const Stride<Outer, Inner>& stride) {
|
|
643
|
+
return typename StridedConstAlignedMapType<Stride<Outer, Inner>>::type(data, rows, cols, stride);
|
|
644
|
+
}
|
|
645
|
+
template <int Outer, int Inner>
|
|
646
|
+
static inline typename StridedAlignedMapType<Stride<Outer, Inner>>::type MapAligned(
|
|
647
|
+
Scalar* data, Index rows, Index cols, const Stride<Outer, Inner>& stride) {
|
|
648
|
+
return typename StridedAlignedMapType<Stride<Outer, Inner>>::type(data, rows, cols, stride);
|
|
649
|
+
}
|
|
650
|
+
///@}
|
|
651
|
+
|
|
652
|
+
using Base::setConstant;
|
|
653
|
+
EIGEN_DEVICE_FUNC Derived& setConstant(Index size, const Scalar& val);
|
|
654
|
+
EIGEN_DEVICE_FUNC Derived& setConstant(Index rows, Index cols, const Scalar& val);
|
|
655
|
+
EIGEN_DEVICE_FUNC Derived& setConstant(NoChange_t, Index cols, const Scalar& val);
|
|
656
|
+
EIGEN_DEVICE_FUNC Derived& setConstant(Index rows, NoChange_t, const Scalar& val);
|
|
657
|
+
|
|
658
|
+
using Base::setZero;
|
|
659
|
+
EIGEN_DEVICE_FUNC Derived& setZero(Index size);
|
|
660
|
+
EIGEN_DEVICE_FUNC Derived& setZero(Index rows, Index cols);
|
|
661
|
+
EIGEN_DEVICE_FUNC Derived& setZero(NoChange_t, Index cols);
|
|
662
|
+
EIGEN_DEVICE_FUNC Derived& setZero(Index rows, NoChange_t);
|
|
663
|
+
|
|
664
|
+
using Base::setOnes;
|
|
665
|
+
EIGEN_DEVICE_FUNC Derived& setOnes(Index size);
|
|
666
|
+
EIGEN_DEVICE_FUNC Derived& setOnes(Index rows, Index cols);
|
|
667
|
+
EIGEN_DEVICE_FUNC Derived& setOnes(NoChange_t, Index cols);
|
|
668
|
+
EIGEN_DEVICE_FUNC Derived& setOnes(Index rows, NoChange_t);
|
|
669
|
+
|
|
670
|
+
using Base::setRandom;
|
|
671
|
+
Derived& setRandom(Index size);
|
|
672
|
+
Derived& setRandom(Index rows, Index cols);
|
|
673
|
+
Derived& setRandom(NoChange_t, Index cols);
|
|
674
|
+
Derived& setRandom(Index rows, NoChange_t);
|
|
675
|
+
|
|
676
|
+
#ifdef EIGEN_PLAINOBJECTBASE_PLUGIN
|
|
677
|
+
#include EIGEN_PLAINOBJECTBASE_PLUGIN
|
|
678
|
+
#endif
|
|
782
679
|
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
680
|
+
protected:
|
|
681
|
+
/** \internal Resizes *this in preparation for assigning \a other to it.
|
|
682
|
+
* Takes care of doing all the checking that's needed.
|
|
683
|
+
*
|
|
684
|
+
* Note that copying a row-vector into a vector (and conversely) is allowed.
|
|
685
|
+
* The resizing, if any, is then done in the appropriate way so that row-vectors
|
|
686
|
+
* remain row-vectors and vectors remain vectors.
|
|
687
|
+
*/
|
|
688
|
+
template <typename OtherDerived>
|
|
689
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _resize_to_match(const EigenBase<OtherDerived>& other) {
|
|
690
|
+
#ifdef EIGEN_NO_AUTOMATIC_RESIZING
|
|
691
|
+
eigen_assert((this->size() == 0 || (IsVectorAtCompileTime ? (this->size() == other.size())
|
|
692
|
+
: (rows() == other.rows() && cols() == other.cols()))) &&
|
|
693
|
+
"Size mismatch. Automatic resizing is disabled because EIGEN_NO_AUTOMATIC_RESIZING is defined");
|
|
694
|
+
EIGEN_ONLY_USED_FOR_DEBUG(other);
|
|
695
|
+
#else
|
|
696
|
+
resizeLike(other);
|
|
697
|
+
#endif
|
|
698
|
+
}
|
|
800
699
|
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
700
|
+
/**
|
|
701
|
+
* \brief Copies the value of the expression \a other into \c *this with automatic resizing.
|
|
702
|
+
*
|
|
703
|
+
* *this might be resized to match the dimensions of \a other. If *this was a null matrix (not already initialized),
|
|
704
|
+
* it will be initialized.
|
|
705
|
+
*
|
|
706
|
+
* Note that copying a row-vector into a vector (and conversely) is allowed.
|
|
707
|
+
* The resizing, if any, is then done in the appropriate way so that row-vectors
|
|
708
|
+
* remain row-vectors and vectors remain vectors.
|
|
709
|
+
*
|
|
710
|
+
* \sa operator=(const MatrixBase<OtherDerived>&), _set_noalias()
|
|
711
|
+
*
|
|
712
|
+
* \internal
|
|
713
|
+
*/
|
|
714
|
+
// aliasing is dealt once in internal::call_assignment
|
|
715
|
+
// so at this stage we have to assume aliasing... and resising has to be done later.
|
|
716
|
+
template <typename OtherDerived>
|
|
717
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Derived& _set(const DenseBase<OtherDerived>& other) {
|
|
718
|
+
internal::call_assignment(this->derived(), other.derived());
|
|
719
|
+
return this->derived();
|
|
720
|
+
}
|
|
812
721
|
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
722
|
+
/** \internal Like _set() but additionally makes the assumption that no aliasing effect can happen (which
|
|
723
|
+
* is the case when creating a new matrix) so one can enforce lazy evaluation.
|
|
724
|
+
*
|
|
725
|
+
* \sa operator=(const MatrixBase<OtherDerived>&), _set()
|
|
726
|
+
*/
|
|
727
|
+
template <typename OtherDerived>
|
|
728
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Derived& _set_noalias(const DenseBase<OtherDerived>& other) {
|
|
729
|
+
// I don't think we need this resize call since the lazyAssign will anyways resize
|
|
730
|
+
// and lazyAssign will be called by the assign selector.
|
|
731
|
+
//_resize_to_match(other);
|
|
732
|
+
// the 'false' below means to enforce lazy evaluation. We don't use lazyAssign() because
|
|
733
|
+
// it wouldn't allow to copy a row-vector into a column-vector.
|
|
734
|
+
internal::call_assignment_no_alias(this->derived(), other.derived(),
|
|
735
|
+
internal::assign_op<Scalar, typename OtherDerived::Scalar>());
|
|
736
|
+
return this->derived();
|
|
737
|
+
}
|
|
821
738
|
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
{
|
|
830
|
-
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 2)
|
|
831
|
-
m_storage.data()[0] = Scalar(val0);
|
|
832
|
-
m_storage.data()[1] = Scalar(val1);
|
|
833
|
-
}
|
|
739
|
+
template <typename T0, typename T1>
|
|
740
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init2(Index rows, Index cols,
|
|
741
|
+
std::enable_if_t<Base::SizeAtCompileTime != 2, T0>* = 0) {
|
|
742
|
+
EIGEN_STATIC_ASSERT(internal::is_valid_index_type<T0>::value && internal::is_valid_index_type<T1>::value,
|
|
743
|
+
T0 AND T1 MUST BE INTEGER TYPES)
|
|
744
|
+
resize(rows, cols);
|
|
745
|
+
}
|
|
834
746
|
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
// NOTE MSVC 2008 complains if we directly put bool(NumTraits<T>::IsInteger) as the EIGEN_STATIC_ASSERT argument.
|
|
843
|
-
const bool is_integer_alike = internal::is_valid_index_type<T>::value;
|
|
844
|
-
EIGEN_UNUSED_VARIABLE(is_integer_alike);
|
|
845
|
-
EIGEN_STATIC_ASSERT(is_integer_alike,
|
|
846
|
-
FLOATING_POINT_ARGUMENT_PASSED__INTEGER_WAS_EXPECTED)
|
|
847
|
-
resize(size);
|
|
848
|
-
}
|
|
747
|
+
template <typename T0, typename T1>
|
|
748
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init2(const T0& val0, const T1& val1,
|
|
749
|
+
std::enable_if_t<Base::SizeAtCompileTime == 2, T0>* = 0) {
|
|
750
|
+
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 2)
|
|
751
|
+
m_storage.data()[0] = Scalar(val0);
|
|
752
|
+
m_storage.data()[1] = Scalar(val1);
|
|
753
|
+
}
|
|
849
754
|
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
755
|
+
template <typename T0, typename T1>
|
|
756
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init2(
|
|
757
|
+
const Index& val0, const Index& val1,
|
|
758
|
+
std::enable_if_t<(!internal::is_same<Index, Scalar>::value) && (internal::is_same<T0, Index>::value) &&
|
|
759
|
+
(internal::is_same<T1, Index>::value) && Base::SizeAtCompileTime == 2,
|
|
760
|
+
T1>* = 0) {
|
|
761
|
+
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 2)
|
|
762
|
+
m_storage.data()[0] = Scalar(val0);
|
|
763
|
+
m_storage.data()[1] = Scalar(val1);
|
|
764
|
+
}
|
|
858
765
|
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
766
|
+
// The argument is convertible to the Index type and we either have a non 1x1 Matrix, or a dynamic-sized Array,
|
|
767
|
+
// then the argument is meant to be the size of the object.
|
|
768
|
+
template <typename T>
|
|
769
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(
|
|
770
|
+
Index size,
|
|
771
|
+
std::enable_if_t<(Base::SizeAtCompileTime != 1 || !internal::is_convertible<T, Scalar>::value) &&
|
|
772
|
+
((!internal::is_same<typename internal::traits<Derived>::XprKind, ArrayXpr>::value ||
|
|
773
|
+
Base::SizeAtCompileTime == Dynamic)),
|
|
774
|
+
T>* = 0) {
|
|
775
|
+
// NOTE MSVC 2008 complains if we directly put bool(NumTraits<T>::IsInteger) as the EIGEN_STATIC_ASSERT argument.
|
|
776
|
+
const bool is_integer_alike = internal::is_valid_index_type<T>::value;
|
|
777
|
+
EIGEN_UNUSED_VARIABLE(is_integer_alike);
|
|
778
|
+
EIGEN_STATIC_ASSERT(is_integer_alike, FLOATING_POINT_ARGUMENT_PASSED__INTEGER_WAS_EXPECTED)
|
|
779
|
+
resize(size);
|
|
780
|
+
}
|
|
871
781
|
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
782
|
+
// We have a 1x1 matrix/array => the argument is interpreted as the value of the unique coefficient (case where scalar
|
|
783
|
+
// type can be implicitly converted)
|
|
784
|
+
template <typename T>
|
|
785
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(
|
|
786
|
+
const Scalar& val0,
|
|
787
|
+
std::enable_if_t<Base::SizeAtCompileTime == 1 && internal::is_convertible<T, Scalar>::value, T>* = 0) {
|
|
788
|
+
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 1)
|
|
789
|
+
m_storage.data()[0] = val0;
|
|
790
|
+
}
|
|
878
791
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
792
|
+
// We have a 1x1 matrix/array => the argument is interpreted as the value of the unique coefficient (case where scalar
|
|
793
|
+
// type match the index type)
|
|
794
|
+
template <typename T>
|
|
795
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(
|
|
796
|
+
const Index& val0,
|
|
797
|
+
std::enable_if_t<(!internal::is_same<Index, Scalar>::value) && (internal::is_same<Index, T>::value) &&
|
|
798
|
+
Base::SizeAtCompileTime == 1 && internal::is_convertible<T, Scalar>::value,
|
|
799
|
+
T*>* = 0) {
|
|
800
|
+
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 1)
|
|
801
|
+
m_storage.data()[0] = Scalar(val0);
|
|
802
|
+
}
|
|
885
803
|
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
}
|
|
804
|
+
// Initialize a fixed size matrix from a pointer to raw data
|
|
805
|
+
template <typename T>
|
|
806
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(const Scalar* data) {
|
|
807
|
+
this->_set_noalias(ConstMapType(data));
|
|
808
|
+
}
|
|
892
809
|
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
}
|
|
810
|
+
// Initialize an arbitrary matrix from a dense expression
|
|
811
|
+
template <typename T, typename OtherDerived>
|
|
812
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(const DenseBase<OtherDerived>& other) {
|
|
813
|
+
this->_set_noalias(other);
|
|
814
|
+
}
|
|
899
815
|
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
other.evalTo(this->derived());
|
|
906
|
-
}
|
|
816
|
+
// Initialize an arbitrary matrix from an object convertible to the Derived type.
|
|
817
|
+
template <typename T>
|
|
818
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(const Derived& other) {
|
|
819
|
+
this->_set_noalias(other);
|
|
820
|
+
}
|
|
907
821
|
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
}
|
|
822
|
+
// Initialize an arbitrary matrix from a generic Eigen expression
|
|
823
|
+
template <typename T, typename OtherDerived>
|
|
824
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(const EigenBase<OtherDerived>& other) {
|
|
825
|
+
this->derived() = other;
|
|
826
|
+
}
|
|
914
827
|
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
&& Base::SizeAtCompileTime!=1
|
|
921
|
-
&& internal::is_convertible<T, Scalar>::value
|
|
922
|
-
&& internal::is_same<typename internal::traits<Derived>::XprKind,ArrayXpr>::value,T>::type* = 0)
|
|
923
|
-
{
|
|
924
|
-
Base::setConstant(val0);
|
|
925
|
-
}
|
|
828
|
+
template <typename T, typename OtherDerived>
|
|
829
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(const ReturnByValue<OtherDerived>& other) {
|
|
830
|
+
resize(other.rows(), other.cols());
|
|
831
|
+
other.evalTo(this->derived());
|
|
832
|
+
}
|
|
926
833
|
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
typename internal::enable_if< (!internal::is_same<Index,Scalar>::value)
|
|
932
|
-
&& (internal::is_same<Index,T>::value)
|
|
933
|
-
&& Base::SizeAtCompileTime!=Dynamic
|
|
934
|
-
&& Base::SizeAtCompileTime!=1
|
|
935
|
-
&& internal::is_convertible<T, Scalar>::value
|
|
936
|
-
&& internal::is_same<typename internal::traits<Derived>::XprKind,ArrayXpr>::value,T*>::type* = 0)
|
|
937
|
-
{
|
|
938
|
-
Base::setConstant(val0);
|
|
939
|
-
}
|
|
834
|
+
template <typename T, typename OtherDerived, int ColsAtCompileTime>
|
|
835
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(const RotationBase<OtherDerived, ColsAtCompileTime>& r) {
|
|
836
|
+
this->derived() = r;
|
|
837
|
+
}
|
|
940
838
|
|
|
941
|
-
|
|
942
|
-
|
|
839
|
+
// For fixed-size Array<Scalar,...>
|
|
840
|
+
template <typename T>
|
|
841
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(
|
|
842
|
+
const Scalar& val0,
|
|
843
|
+
std::enable_if_t<Base::SizeAtCompileTime != Dynamic && Base::SizeAtCompileTime != 1 &&
|
|
844
|
+
internal::is_convertible<T, Scalar>::value &&
|
|
845
|
+
internal::is_same<typename internal::traits<Derived>::XprKind, ArrayXpr>::value,
|
|
846
|
+
T>* = 0) {
|
|
847
|
+
Base::setConstant(val0);
|
|
848
|
+
}
|
|
943
849
|
|
|
944
|
-
|
|
850
|
+
// For fixed-size Array<Index,...>
|
|
851
|
+
template <typename T>
|
|
852
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(
|
|
853
|
+
const Index& val0,
|
|
854
|
+
std::enable_if_t<(!internal::is_same<Index, Scalar>::value) && (internal::is_same<Index, T>::value) &&
|
|
855
|
+
Base::SizeAtCompileTime != Dynamic && Base::SizeAtCompileTime != 1 &&
|
|
856
|
+
internal::is_convertible<T, Scalar>::value &&
|
|
857
|
+
internal::is_same<typename internal::traits<Derived>::XprKind, ArrayXpr>::value,
|
|
858
|
+
T*>* = 0) {
|
|
859
|
+
Base::setConstant(val0);
|
|
860
|
+
}
|
|
945
861
|
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
* \brief Override DenseBase::swap() since for dynamic-sized matrices
|
|
949
|
-
* of same type it is enough to swap the data pointers.
|
|
950
|
-
*/
|
|
951
|
-
template<typename OtherDerived>
|
|
952
|
-
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
|
953
|
-
void swap(DenseBase<OtherDerived> & other)
|
|
954
|
-
{
|
|
955
|
-
enum { SwapPointers = internal::is_same<Derived, OtherDerived>::value && Base::SizeAtCompileTime==Dynamic };
|
|
956
|
-
internal::matrix_swap_impl<Derived, OtherDerived, bool(SwapPointers)>::run(this->derived(), other.derived());
|
|
957
|
-
}
|
|
862
|
+
template <typename MatrixTypeA, typename MatrixTypeB, bool SwapPointers>
|
|
863
|
+
friend struct internal::matrix_swap_impl;
|
|
958
864
|
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
865
|
+
public:
|
|
866
|
+
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
|
867
|
+
/** \internal
|
|
868
|
+
* \brief Override DenseBase::swap() since for dynamic-sized matrices
|
|
869
|
+
* of same type it is enough to swap the data pointers.
|
|
870
|
+
*/
|
|
871
|
+
template <typename OtherDerived>
|
|
872
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void swap(DenseBase<OtherDerived>& other) {
|
|
873
|
+
enum {SwapPointers = internal::is_same<Derived, OtherDerived>::value && Base::SizeAtCompileTime == Dynamic};
|
|
874
|
+
internal::matrix_swap_impl<Derived, OtherDerived, bool(SwapPointers)>::run(this->derived(), other.derived());
|
|
875
|
+
}
|
|
966
876
|
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
&& ((MaxRowsAtCompileTime == Dynamic) || (MaxRowsAtCompileTime >= 0))
|
|
975
|
-
&& ((MaxColsAtCompileTime == Dynamic) || (MaxColsAtCompileTime >= 0))
|
|
976
|
-
&& (MaxRowsAtCompileTime == RowsAtCompileTime || RowsAtCompileTime==Dynamic)
|
|
977
|
-
&& (MaxColsAtCompileTime == ColsAtCompileTime || ColsAtCompileTime==Dynamic)
|
|
978
|
-
&& (Options & (DontAlign|RowMajor)) == Options),
|
|
979
|
-
INVALID_MATRIX_TEMPLATE_PARAMETERS)
|
|
980
|
-
}
|
|
877
|
+
/** \internal
|
|
878
|
+
* \brief const version forwarded to DenseBase::swap
|
|
879
|
+
*/
|
|
880
|
+
template <typename OtherDerived>
|
|
881
|
+
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void swap(DenseBase<OtherDerived> const& other) {
|
|
882
|
+
Base::swap(other.derived());
|
|
883
|
+
}
|
|
981
884
|
|
|
982
|
-
|
|
885
|
+
enum {IsPlainObjectBase = 1};
|
|
983
886
|
#endif
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
887
|
+
public:
|
|
888
|
+
// These apparently need to be down here for nvcc+icc to prevent duplicate
|
|
889
|
+
// Map symbol.
|
|
890
|
+
template <typename PlainObjectType, int MapOptions, typename StrideType>
|
|
891
|
+
friend class Eigen::Map;
|
|
892
|
+
friend class Eigen::Map<Derived, Unaligned>;
|
|
893
|
+
friend class Eigen::Map<const Derived, Unaligned>;
|
|
894
|
+
#if EIGEN_MAX_ALIGN_BYTES > 0
|
|
895
|
+
// for EIGEN_MAX_ALIGN_BYTES==0, AlignedMax==Unaligned, and many compilers generate warnings for friend-ing a class
|
|
896
|
+
// twice.
|
|
897
|
+
friend class Eigen::Map<Derived, AlignedMax>;
|
|
898
|
+
friend class Eigen::Map<const Derived, AlignedMax>;
|
|
994
899
|
#endif
|
|
995
900
|
};
|
|
996
901
|
|
|
997
902
|
namespace internal {
|
|
998
903
|
|
|
999
904
|
template <typename Derived, typename OtherDerived, bool IsVector>
|
|
1000
|
-
struct conservative_resize_like_impl
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
static const bool IsRelocatable = std::is_trivially_copyable<typename Derived::Scalar>::value;
|
|
1004
|
-
#else
|
|
1005
|
-
static const bool IsRelocatable = !NumTraits<typename Derived::Scalar>::RequireInitialization;
|
|
1006
|
-
#endif
|
|
1007
|
-
static void run(DenseBase<Derived>& _this, Index rows, Index cols)
|
|
1008
|
-
{
|
|
905
|
+
struct conservative_resize_like_impl {
|
|
906
|
+
static constexpr bool IsRelocatable = std::is_trivially_copyable<typename Derived::Scalar>::value;
|
|
907
|
+
static void run(DenseBase<Derived>& _this, Index rows, Index cols) {
|
|
1009
908
|
if (_this.rows() == rows && _this.cols() == cols) return;
|
|
1010
909
|
EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(Derived)
|
|
1011
910
|
|
|
1012
|
-
if (
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
{
|
|
1016
|
-
internal::check_rows_cols_for_overflow<Derived::MaxSizeAtCompileTime>::run(rows, cols);
|
|
1017
|
-
_this.derived().m_storage.conservativeResize(rows*cols,rows,cols);
|
|
1018
|
-
}
|
|
1019
|
-
else
|
|
911
|
+
if (IsRelocatable &&
|
|
912
|
+
((Derived::IsRowMajor && _this.cols() == cols) || // row-major and we change only the number of rows
|
|
913
|
+
(!Derived::IsRowMajor && _this.rows() == rows))) // column-major and we change only the number of columns
|
|
1020
914
|
{
|
|
915
|
+
#ifndef EIGEN_NO_DEBUG
|
|
916
|
+
internal::check_rows_cols_for_overflow<Derived::MaxSizeAtCompileTime, Derived::MaxRowsAtCompileTime,
|
|
917
|
+
Derived::MaxColsAtCompileTime>::run(rows, cols);
|
|
918
|
+
#endif
|
|
919
|
+
_this.derived().m_storage.conservativeResize(rows * cols, rows, cols);
|
|
920
|
+
} else {
|
|
1021
921
|
// The storage order does not allow us to use reallocation.
|
|
1022
|
-
Derived tmp(rows,cols);
|
|
922
|
+
Derived tmp(rows, cols);
|
|
1023
923
|
const Index common_rows = numext::mini(rows, _this.rows());
|
|
1024
924
|
const Index common_cols = numext::mini(cols, _this.cols());
|
|
1025
|
-
tmp.block(0,0,common_rows,common_cols) = _this.block(0,0,common_rows,common_cols);
|
|
925
|
+
tmp.block(0, 0, common_rows, common_cols) = _this.block(0, 0, common_rows, common_cols);
|
|
1026
926
|
_this.derived().swap(tmp);
|
|
1027
927
|
}
|
|
1028
928
|
}
|
|
1029
929
|
|
|
1030
|
-
static void run(DenseBase<Derived>& _this, const DenseBase<OtherDerived>& other)
|
|
1031
|
-
{
|
|
930
|
+
static void run(DenseBase<Derived>& _this, const DenseBase<OtherDerived>& other) {
|
|
1032
931
|
if (_this.rows() == other.rows() && _this.cols() == other.cols()) return;
|
|
1033
932
|
|
|
1034
933
|
// Note: Here is space for improvement. Basically, for conservativeResize(Index,Index),
|
|
@@ -1039,25 +938,24 @@ struct conservative_resize_like_impl
|
|
|
1039
938
|
EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(Derived)
|
|
1040
939
|
EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(OtherDerived)
|
|
1041
940
|
|
|
1042
|
-
if (
|
|
1043
|
-
|
|
1044
|
-
|
|
941
|
+
if (IsRelocatable &&
|
|
942
|
+
((Derived::IsRowMajor && _this.cols() == other.cols()) || // row-major and we change only the number of rows
|
|
943
|
+
(!Derived::IsRowMajor &&
|
|
944
|
+
_this.rows() == other.rows()))) // column-major and we change only the number of columns
|
|
1045
945
|
{
|
|
1046
946
|
const Index new_rows = other.rows() - _this.rows();
|
|
1047
947
|
const Index new_cols = other.cols() - _this.cols();
|
|
1048
|
-
_this.derived().m_storage.conservativeResize(other.size(),other.rows(),other.cols());
|
|
1049
|
-
if (new_rows>0)
|
|
948
|
+
_this.derived().m_storage.conservativeResize(other.size(), other.rows(), other.cols());
|
|
949
|
+
if (new_rows > 0)
|
|
1050
950
|
_this.bottomRightCorner(new_rows, other.cols()) = other.bottomRows(new_rows);
|
|
1051
|
-
else if (new_cols>0)
|
|
951
|
+
else if (new_cols > 0)
|
|
1052
952
|
_this.bottomRightCorner(other.rows(), new_cols) = other.rightCols(new_cols);
|
|
1053
|
-
}
|
|
1054
|
-
else
|
|
1055
|
-
{
|
|
953
|
+
} else {
|
|
1056
954
|
// The storage order does not allow us to use reallocation.
|
|
1057
955
|
Derived tmp(other);
|
|
1058
956
|
const Index common_rows = numext::mini(tmp.rows(), _this.rows());
|
|
1059
957
|
const Index common_cols = numext::mini(tmp.cols(), _this.cols());
|
|
1060
|
-
tmp.block(0,0,common_rows,common_cols) = _this.block(0,0,common_rows,common_cols);
|
|
958
|
+
tmp.block(0, 0, common_rows, common_cols) = _this.block(0, 0, common_rows, common_cols);
|
|
1061
959
|
_this.derived().swap(tmp);
|
|
1062
960
|
}
|
|
1063
961
|
}
|
|
@@ -1066,63 +964,51 @@ struct conservative_resize_like_impl
|
|
|
1066
964
|
// Here, the specialization for vectors inherits from the general matrix case
|
|
1067
965
|
// to allow calling .conservativeResize(rows,cols) on vectors.
|
|
1068
966
|
template <typename Derived, typename OtherDerived>
|
|
1069
|
-
struct conservative_resize_like_impl<Derived,OtherDerived,true>
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
typedef conservative_resize_like_impl<Derived,OtherDerived,false> Base;
|
|
1073
|
-
using Base::run;
|
|
967
|
+
struct conservative_resize_like_impl<Derived, OtherDerived, true>
|
|
968
|
+
: conservative_resize_like_impl<Derived, OtherDerived, false> {
|
|
969
|
+
typedef conservative_resize_like_impl<Derived, OtherDerived, false> Base;
|
|
1074
970
|
using Base::IsRelocatable;
|
|
971
|
+
using Base::run;
|
|
1075
972
|
|
|
1076
|
-
static void run(DenseBase<Derived>& _this, Index size)
|
|
1077
|
-
|
|
1078
|
-
const Index
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
_this.derived().m_storage.conservativeResize(size,new_rows,new_cols);
|
|
973
|
+
static void run(DenseBase<Derived>& _this, Index size) {
|
|
974
|
+
const Index new_rows = Derived::RowsAtCompileTime == 1 ? 1 : size;
|
|
975
|
+
const Index new_cols = Derived::RowsAtCompileTime == 1 ? size : 1;
|
|
976
|
+
if (IsRelocatable)
|
|
977
|
+
_this.derived().m_storage.conservativeResize(size, new_rows, new_cols);
|
|
1082
978
|
else
|
|
1083
979
|
Base::run(_this.derived(), new_rows, new_cols);
|
|
1084
980
|
}
|
|
1085
981
|
|
|
1086
|
-
static void run(DenseBase<Derived>& _this, const DenseBase<OtherDerived>& other)
|
|
1087
|
-
{
|
|
982
|
+
static void run(DenseBase<Derived>& _this, const DenseBase<OtherDerived>& other) {
|
|
1088
983
|
if (_this.rows() == other.rows() && _this.cols() == other.cols()) return;
|
|
1089
984
|
|
|
1090
985
|
const Index num_new_elements = other.size() - _this.size();
|
|
1091
986
|
|
|
1092
|
-
const Index new_rows = Derived::RowsAtCompileTime==1 ? 1 : other.rows();
|
|
1093
|
-
const Index new_cols = Derived::RowsAtCompileTime==1 ? other.cols() : 1;
|
|
1094
|
-
if(IsRelocatable)
|
|
1095
|
-
_this.derived().m_storage.conservativeResize(other.size(),new_rows,new_cols);
|
|
987
|
+
const Index new_rows = Derived::RowsAtCompileTime == 1 ? 1 : other.rows();
|
|
988
|
+
const Index new_cols = Derived::RowsAtCompileTime == 1 ? other.cols() : 1;
|
|
989
|
+
if (IsRelocatable)
|
|
990
|
+
_this.derived().m_storage.conservativeResize(other.size(), new_rows, new_cols);
|
|
1096
991
|
else
|
|
1097
992
|
Base::run(_this.derived(), new_rows, new_cols);
|
|
1098
993
|
|
|
1099
|
-
if (num_new_elements > 0)
|
|
1100
|
-
_this.tail(num_new_elements) = other.tail(num_new_elements);
|
|
994
|
+
if (num_new_elements > 0) _this.tail(num_new_elements) = other.tail(num_new_elements);
|
|
1101
995
|
}
|
|
1102
996
|
};
|
|
1103
997
|
|
|
1104
|
-
template<typename MatrixTypeA, typename MatrixTypeB, bool SwapPointers>
|
|
1105
|
-
struct matrix_swap_impl
|
|
1106
|
-
{
|
|
1107
|
-
EIGEN_DEVICE_FUNC
|
|
1108
|
-
static EIGEN_STRONG_INLINE void run(MatrixTypeA& a, MatrixTypeB& b)
|
|
1109
|
-
{
|
|
1110
|
-
a.base().swap(b);
|
|
1111
|
-
}
|
|
998
|
+
template <typename MatrixTypeA, typename MatrixTypeB, bool SwapPointers>
|
|
999
|
+
struct matrix_swap_impl {
|
|
1000
|
+
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(MatrixTypeA& a, MatrixTypeB& b) { a.base().swap(b); }
|
|
1112
1001
|
};
|
|
1113
1002
|
|
|
1114
|
-
template<typename MatrixTypeA, typename MatrixTypeB>
|
|
1115
|
-
struct matrix_swap_impl<MatrixTypeA, MatrixTypeB, true>
|
|
1116
|
-
{
|
|
1117
|
-
EIGEN_DEVICE_FUNC
|
|
1118
|
-
static inline void run(MatrixTypeA& a, MatrixTypeB& b)
|
|
1119
|
-
{
|
|
1003
|
+
template <typename MatrixTypeA, typename MatrixTypeB>
|
|
1004
|
+
struct matrix_swap_impl<MatrixTypeA, MatrixTypeB, true> {
|
|
1005
|
+
EIGEN_DEVICE_FUNC static inline void run(MatrixTypeA& a, MatrixTypeB& b) {
|
|
1120
1006
|
static_cast<typename MatrixTypeA::Base&>(a).m_storage.swap(static_cast<typename MatrixTypeB::Base&>(b).m_storage);
|
|
1121
1007
|
}
|
|
1122
1008
|
};
|
|
1123
1009
|
|
|
1124
|
-
}
|
|
1010
|
+
} // end namespace internal
|
|
1125
1011
|
|
|
1126
|
-
}
|
|
1012
|
+
} // end namespace Eigen
|
|
1127
1013
|
|
|
1128
|
-
#endif
|
|
1014
|
+
#endif // EIGEN_DENSESTORAGEBASE_H
|