@smake/eigen 1.0.1 → 1.1.0
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/COPYING.APACHE +203 -0
- package/eigen/COPYING.BSD +1 -1
- package/eigen/COPYING.MINPACK +51 -52
- package/eigen/Eigen/Cholesky +0 -1
- package/eigen/Eigen/Core +108 -266
- package/eigen/Eigen/Eigenvalues +0 -1
- package/eigen/Eigen/Geometry +3 -6
- package/eigen/Eigen/Householder +0 -1
- package/eigen/Eigen/Jacobi +0 -1
- package/eigen/Eigen/KLUSupport +41 -0
- package/eigen/Eigen/LU +2 -5
- package/eigen/Eigen/OrderingMethods +0 -3
- package/eigen/Eigen/PaStiXSupport +1 -0
- package/eigen/Eigen/PardisoSupport +0 -0
- package/eigen/Eigen/QR +0 -1
- package/eigen/Eigen/QtAlignedMalloc +0 -1
- package/eigen/Eigen/SVD +0 -1
- package/eigen/Eigen/Sparse +0 -2
- package/eigen/Eigen/SparseCholesky +0 -8
- package/eigen/Eigen/SparseLU +4 -0
- package/eigen/Eigen/src/Cholesky/LDLT.h +42 -27
- package/eigen/Eigen/src/Cholesky/LLT.h +39 -23
- package/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +90 -47
- package/eigen/Eigen/src/Core/ArithmeticSequence.h +413 -0
- package/eigen/Eigen/src/Core/Array.h +99 -11
- package/eigen/Eigen/src/Core/ArrayBase.h +1 -1
- package/eigen/Eigen/src/Core/ArrayWrapper.h +21 -21
- package/eigen/Eigen/src/Core/Assign.h +1 -1
- package/eigen/Eigen/src/Core/AssignEvaluator.h +125 -50
- package/eigen/Eigen/src/Core/Assign_MKL.h +10 -10
- package/eigen/Eigen/src/Core/BandMatrix.h +16 -16
- package/eigen/Eigen/src/Core/Block.h +56 -60
- package/eigen/Eigen/src/Core/BooleanRedux.h +29 -31
- package/eigen/Eigen/src/Core/CommaInitializer.h +7 -3
- package/eigen/Eigen/src/Core/CoreEvaluators.h +325 -272
- package/eigen/Eigen/src/Core/CoreIterators.h +5 -0
- package/eigen/Eigen/src/Core/CwiseBinaryOp.h +21 -22
- package/eigen/Eigen/src/Core/CwiseNullaryOp.h +153 -18
- package/eigen/Eigen/src/Core/CwiseUnaryOp.h +6 -6
- package/eigen/Eigen/src/Core/CwiseUnaryView.h +12 -10
- package/eigen/Eigen/src/Core/DenseBase.h +128 -39
- package/eigen/Eigen/src/Core/DenseCoeffsBase.h +25 -21
- package/eigen/Eigen/src/Core/DenseStorage.h +150 -68
- package/eigen/Eigen/src/Core/Diagonal.h +21 -23
- package/eigen/Eigen/src/Core/DiagonalMatrix.h +50 -2
- package/eigen/Eigen/src/Core/DiagonalProduct.h +1 -1
- package/eigen/Eigen/src/Core/Dot.h +10 -10
- package/eigen/Eigen/src/Core/EigenBase.h +10 -9
- package/eigen/Eigen/src/Core/ForceAlignedAccess.h +8 -4
- package/eigen/Eigen/src/Core/Fuzzy.h +3 -3
- package/eigen/Eigen/src/Core/GeneralProduct.h +20 -10
- package/eigen/Eigen/src/Core/GenericPacketMath.h +597 -147
- package/eigen/Eigen/src/Core/GlobalFunctions.h +40 -33
- package/eigen/Eigen/src/Core/IO.h +40 -7
- package/eigen/Eigen/src/Core/IndexedView.h +237 -0
- package/eigen/Eigen/src/Core/Inverse.h +9 -10
- package/eigen/Eigen/src/Core/Map.h +7 -7
- package/eigen/Eigen/src/Core/MapBase.h +5 -3
- package/eigen/Eigen/src/Core/MathFunctions.h +756 -120
- package/eigen/Eigen/src/Core/MathFunctionsImpl.h +118 -19
- package/eigen/Eigen/src/Core/Matrix.h +131 -25
- package/eigen/Eigen/src/Core/MatrixBase.h +19 -2
- package/eigen/Eigen/src/Core/NestByValue.h +25 -50
- package/eigen/Eigen/src/Core/NoAlias.h +4 -3
- package/eigen/Eigen/src/Core/NumTraits.h +107 -20
- package/eigen/Eigen/src/Core/PartialReduxEvaluator.h +232 -0
- package/eigen/Eigen/src/Core/PermutationMatrix.h +3 -3
- package/eigen/Eigen/src/Core/PlainObjectBase.h +145 -54
- package/eigen/Eigen/src/Core/Product.h +30 -25
- package/eigen/Eigen/src/Core/ProductEvaluators.h +183 -142
- package/eigen/Eigen/src/Core/Random.h +37 -1
- package/eigen/Eigen/src/Core/Redux.h +180 -170
- package/eigen/Eigen/src/Core/Ref.h +118 -21
- package/eigen/Eigen/src/Core/Replicate.h +8 -8
- package/eigen/Eigen/src/Core/Reshaped.h +454 -0
- package/eigen/Eigen/src/Core/ReturnByValue.h +7 -5
- package/eigen/Eigen/src/Core/Reverse.h +18 -12
- package/eigen/Eigen/src/Core/Select.h +8 -6
- package/eigen/Eigen/src/Core/SelfAdjointView.h +33 -20
- package/eigen/Eigen/src/Core/Solve.h +14 -14
- package/eigen/Eigen/src/Core/SolveTriangular.h +13 -13
- package/eigen/Eigen/src/Core/SolverBase.h +41 -3
- package/eigen/Eigen/src/Core/StableNorm.h +100 -70
- package/eigen/Eigen/src/Core/StlIterators.h +463 -0
- package/eigen/Eigen/src/Core/Stride.h +9 -4
- package/eigen/Eigen/src/Core/Swap.h +5 -4
- package/eigen/Eigen/src/Core/Transpose.h +86 -27
- package/eigen/Eigen/src/Core/Transpositions.h +26 -8
- package/eigen/Eigen/src/Core/TriangularMatrix.h +88 -72
- package/eigen/Eigen/src/Core/VectorBlock.h +5 -5
- package/eigen/Eigen/src/Core/VectorwiseOp.h +159 -70
- package/eigen/Eigen/src/Core/Visitor.h +137 -29
- package/eigen/Eigen/src/Core/arch/AVX/Complex.h +50 -129
- package/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +126 -337
- package/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +1092 -155
- package/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +65 -1
- package/eigen/Eigen/src/Core/arch/AVX512/Complex.h +422 -0
- package/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +186 -213
- package/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1250 -252
- package/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +89 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +152 -165
- package/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +19 -251
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2937 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +221 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +629 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +2042 -392
- package/eigen/Eigen/src/Core/arch/CUDA/Complex.h +235 -80
- package/eigen/Eigen/src/Core/arch/Default/BFloat16.h +700 -0
- package/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +102 -14
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1649 -0
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +110 -0
- package/eigen/Eigen/src/Core/arch/Default/Half.h +942 -0
- package/eigen/Eigen/src/Core/arch/Default/Settings.h +1 -1
- package/eigen/Eigen/src/Core/arch/Default/TypeCasting.h +120 -0
- package/eigen/Eigen/src/Core/arch/{CUDA → GPU}/MathFunctions.h +16 -4
- package/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +1685 -0
- package/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +80 -0
- package/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
- package/eigen/Eigen/src/Core/arch/MSA/Complex.h +648 -0
- package/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +387 -0
- package/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +1233 -0
- package/eigen/Eigen/src/Core/arch/NEON/Complex.h +313 -219
- package/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +183 -0
- package/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +54 -70
- package/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +4376 -549
- package/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +1419 -0
- package/eigen/Eigen/src/Core/arch/SSE/Complex.h +59 -179
- package/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +65 -428
- package/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +893 -283
- package/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +65 -0
- package/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +44 -0
- package/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +752 -0
- package/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +49 -0
- package/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +232 -0
- package/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +301 -0
- package/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +670 -0
- package/eigen/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +694 -0
- package/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +85 -0
- package/eigen/Eigen/src/Core/arch/ZVector/Complex.h +212 -183
- package/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +101 -5
- package/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +510 -395
- package/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +11 -2
- package/eigen/Eigen/src/Core/functors/BinaryFunctors.h +112 -46
- package/eigen/Eigen/src/Core/functors/NullaryFunctors.h +31 -30
- package/eigen/Eigen/src/Core/functors/StlFunctors.h +32 -2
- package/eigen/Eigen/src/Core/functors/UnaryFunctors.h +354 -15
- package/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1073 -585
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +29 -7
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +4 -4
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +1 -1
- package/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +382 -483
- package/eigen/Eigen/src/Core/products/Parallelizer.h +23 -9
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +23 -6
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +8 -6
- package/eigen/Eigen/src/Core/products/SelfadjointProduct.h +2 -2
- package/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +5 -4
- package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +3 -3
- package/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +5 -3
- package/eigen/Eigen/src/Core/products/TriangularSolverVector.h +13 -10
- package/eigen/Eigen/src/Core/util/BlasUtil.h +208 -124
- package/eigen/Eigen/src/Core/util/ConfigureVectorization.h +512 -0
- package/eigen/Eigen/src/Core/util/Constants.h +25 -9
- package/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +14 -2
- package/eigen/Eigen/src/Core/util/ForwardDeclarations.h +28 -4
- package/eigen/Eigen/src/Core/util/IndexedViewHelper.h +186 -0
- package/eigen/Eigen/src/Core/util/IntegralConstant.h +272 -0
- package/eigen/Eigen/src/Core/util/MKL_support.h +8 -1
- package/eigen/Eigen/src/Core/util/Macros.h +661 -250
- package/eigen/Eigen/src/Core/util/Memory.h +222 -52
- package/eigen/Eigen/src/Core/util/Meta.h +349 -105
- package/eigen/Eigen/src/Core/util/ReshapedHelper.h +51 -0
- package/eigen/Eigen/src/Core/util/StaticAssert.h +8 -5
- package/eigen/Eigen/src/Core/util/SymbolicIndex.h +293 -0
- package/eigen/Eigen/src/Core/util/XprHelper.h +48 -30
- package/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +1 -1
- package/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +1 -1
- package/eigen/Eigen/src/Eigenvalues/EigenSolver.h +2 -2
- package/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +1 -1
- package/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +2 -2
- package/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +2 -2
- package/eigen/Eigen/src/Eigenvalues/RealQZ.h +9 -6
- package/eigen/Eigen/src/Eigenvalues/RealSchur.h +10 -5
- package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +75 -42
- package/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +20 -15
- package/eigen/Eigen/src/Geometry/AlignedBox.h +99 -5
- package/eigen/Eigen/src/Geometry/AngleAxis.h +4 -4
- package/eigen/Eigen/src/Geometry/EulerAngles.h +3 -3
- package/eigen/Eigen/src/Geometry/Homogeneous.h +15 -11
- package/eigen/Eigen/src/Geometry/Hyperplane.h +1 -1
- package/eigen/Eigen/src/Geometry/OrthoMethods.h +3 -2
- package/eigen/Eigen/src/Geometry/ParametrizedLine.h +39 -2
- package/eigen/Eigen/src/Geometry/Quaternion.h +52 -14
- package/eigen/Eigen/src/Geometry/Rotation2D.h +3 -3
- package/eigen/Eigen/src/Geometry/Scaling.h +22 -4
- package/eigen/Eigen/src/Geometry/Transform.h +86 -65
- package/eigen/Eigen/src/Geometry/Translation.h +6 -6
- package/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +168 -0
- package/eigen/Eigen/src/Householder/BlockHouseholder.h +9 -2
- package/eigen/Eigen/src/Householder/Householder.h +8 -4
- package/eigen/Eigen/src/Householder/HouseholderSequence.h +123 -48
- package/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +15 -15
- package/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +7 -23
- package/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +5 -22
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +41 -47
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +51 -60
- package/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +70 -20
- package/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +2 -20
- package/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +11 -9
- package/eigen/Eigen/src/Jacobi/Jacobi.h +31 -10
- package/eigen/Eigen/src/KLUSupport/KLUSupport.h +358 -0
- package/eigen/Eigen/src/LU/Determinant.h +35 -19
- package/eigen/Eigen/src/LU/FullPivLU.h +29 -43
- package/eigen/Eigen/src/LU/InverseImpl.h +25 -8
- package/eigen/Eigen/src/LU/PartialPivLU.h +67 -57
- package/eigen/Eigen/src/LU/arch/InverseSize4.h +351 -0
- package/eigen/Eigen/src/OrderingMethods/Amd.h +7 -17
- package/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +297 -277
- package/eigen/Eigen/src/OrderingMethods/Ordering.h +6 -10
- package/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +1 -1
- package/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +10 -9
- package/eigen/Eigen/src/QR/ColPivHouseholderQR.h +41 -20
- package/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +100 -27
- package/eigen/Eigen/src/QR/FullPivHouseholderQR.h +59 -22
- package/eigen/Eigen/src/QR/HouseholderQR.h +48 -23
- package/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +25 -3
- package/eigen/Eigen/src/SVD/BDCSVD.h +137 -48
- package/eigen/Eigen/src/SVD/JacobiSVD.h +22 -14
- package/eigen/Eigen/src/SVD/SVDBase.h +82 -21
- package/eigen/Eigen/src/SVD/UpperBidiagonalization.h +3 -3
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +16 -8
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +11 -36
- package/eigen/Eigen/src/SparseCore/CompressedStorage.h +16 -0
- package/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +6 -6
- package/eigen/Eigen/src/SparseCore/SparseAssign.h +81 -27
- package/eigen/Eigen/src/SparseCore/SparseBlock.h +25 -57
- package/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +40 -11
- package/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +11 -15
- package/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +2 -2
- package/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +30 -8
- package/eigen/Eigen/src/SparseCore/SparseMatrix.h +124 -10
- package/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +5 -12
- package/eigen/Eigen/src/SparseCore/SparseProduct.h +13 -1
- package/eigen/Eigen/src/SparseCore/SparseRef.h +7 -7
- package/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +3 -0
- package/eigen/Eigen/src/SparseCore/SparseUtil.h +8 -0
- package/eigen/Eigen/src/SparseCore/SparseVector.h +1 -1
- package/eigen/Eigen/src/SparseLU/SparseLU.h +160 -10
- package/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +1 -1
- package/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +76 -2
- package/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +2 -2
- package/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +1 -1
- package/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +1 -1
- package/eigen/Eigen/src/SparseQR/SparseQR.h +19 -6
- package/eigen/Eigen/src/StlSupport/StdDeque.h +2 -14
- package/eigen/Eigen/src/StlSupport/StdList.h +2 -2
- package/eigen/Eigen/src/StlSupport/StdVector.h +2 -2
- package/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +6 -8
- package/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +175 -39
- package/eigen/Eigen/src/misc/lapacke.h +5 -4
- package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +27 -1
- package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +155 -11
- package/eigen/Eigen/src/plugins/BlockMethods.h +626 -242
- package/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.h +14 -0
- package/eigen/Eigen/src/plugins/IndexedViewMethods.h +262 -0
- package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +4 -4
- package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +10 -0
- package/eigen/Eigen/src/plugins/ReshapedMethods.h +149 -0
- package/eigen/README.md +2 -0
- package/lib/LibEigen.d.ts +4 -0
- package/lib/LibEigen.js +14 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +7 -3
- package/package.json +2 -10
- package/eigen/Eigen/CMakeLists.txt +0 -19
- package/eigen/Eigen/src/Core/arch/CUDA/Half.h +0 -675
- package/eigen/Eigen/src/Core/arch/CUDA/PacketMath.h +0 -333
- package/eigen/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +0 -1124
- package/eigen/Eigen/src/Core/arch/CUDA/TypeCasting.h +0 -212
- package/eigen/Eigen/src/Geometry/arch/Geometry_SSE.h +0 -161
- package/eigen/Eigen/src/LU/arch/Inverse_SSE.h +0 -338
- package/lib/eigen.d.ts +0 -2
- package/lib/eigen.js +0 -15
|
@@ -39,6 +39,7 @@ template<int n> struct decrement_size
|
|
|
39
39
|
* MatrixBase::applyHouseholderOnTheRight()
|
|
40
40
|
*/
|
|
41
41
|
template<typename Derived>
|
|
42
|
+
EIGEN_DEVICE_FUNC
|
|
42
43
|
void MatrixBase<Derived>::makeHouseholderInPlace(Scalar& tau, RealScalar& beta)
|
|
43
44
|
{
|
|
44
45
|
VectorBlock<Derived, internal::decrement_size<Base::SizeAtCompileTime>::ret> essentialPart(derived(), 1, size()-1);
|
|
@@ -62,6 +63,7 @@ void MatrixBase<Derived>::makeHouseholderInPlace(Scalar& tau, RealScalar& beta)
|
|
|
62
63
|
*/
|
|
63
64
|
template<typename Derived>
|
|
64
65
|
template<typename EssentialPart>
|
|
66
|
+
EIGEN_DEVICE_FUNC
|
|
65
67
|
void MatrixBase<Derived>::makeHouseholder(
|
|
66
68
|
EssentialPart& essential,
|
|
67
69
|
Scalar& tau,
|
|
@@ -103,13 +105,14 @@ void MatrixBase<Derived>::makeHouseholder(
|
|
|
103
105
|
* \param essential the essential part of the vector \c v
|
|
104
106
|
* \param tau the scaling factor of the Householder transformation
|
|
105
107
|
* \param workspace a pointer to working space with at least
|
|
106
|
-
* this->cols()
|
|
108
|
+
* this->cols() entries
|
|
107
109
|
*
|
|
108
110
|
* \sa MatrixBase::makeHouseholder(), MatrixBase::makeHouseholderInPlace(),
|
|
109
111
|
* MatrixBase::applyHouseholderOnTheRight()
|
|
110
112
|
*/
|
|
111
113
|
template<typename Derived>
|
|
112
114
|
template<typename EssentialPart>
|
|
115
|
+
EIGEN_DEVICE_FUNC
|
|
113
116
|
void MatrixBase<Derived>::applyHouseholderOnTheLeft(
|
|
114
117
|
const EssentialPart& essential,
|
|
115
118
|
const Scalar& tau,
|
|
@@ -140,13 +143,14 @@ void MatrixBase<Derived>::applyHouseholderOnTheLeft(
|
|
|
140
143
|
* \param essential the essential part of the vector \c v
|
|
141
144
|
* \param tau the scaling factor of the Householder transformation
|
|
142
145
|
* \param workspace a pointer to working space with at least
|
|
143
|
-
* this->
|
|
146
|
+
* this->rows() entries
|
|
144
147
|
*
|
|
145
148
|
* \sa MatrixBase::makeHouseholder(), MatrixBase::makeHouseholderInPlace(),
|
|
146
149
|
* MatrixBase::applyHouseholderOnTheLeft()
|
|
147
150
|
*/
|
|
148
151
|
template<typename Derived>
|
|
149
152
|
template<typename EssentialPart>
|
|
153
|
+
EIGEN_DEVICE_FUNC
|
|
150
154
|
void MatrixBase<Derived>::applyHouseholderOnTheRight(
|
|
151
155
|
const EssentialPart& essential,
|
|
152
156
|
const Scalar& tau,
|
|
@@ -160,10 +164,10 @@ void MatrixBase<Derived>::applyHouseholderOnTheRight(
|
|
|
160
164
|
{
|
|
161
165
|
Map<typename internal::plain_col_type<PlainObject>::type> tmp(workspace,rows());
|
|
162
166
|
Block<Derived, Derived::RowsAtCompileTime, EssentialPart::SizeAtCompileTime> right(derived(), 0, 1, rows(), cols()-1);
|
|
163
|
-
tmp.noalias() = right * essential
|
|
167
|
+
tmp.noalias() = right * essential;
|
|
164
168
|
tmp += this->col(0);
|
|
165
169
|
this->col(0) -= tau * tmp;
|
|
166
|
-
right.noalias() -= tau * tmp * essential.
|
|
170
|
+
right.noalias() -= tau * tmp * essential.adjoint();
|
|
167
171
|
}
|
|
168
172
|
}
|
|
169
173
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#ifndef EIGEN_HOUSEHOLDER_SEQUENCE_H
|
|
12
12
|
#define EIGEN_HOUSEHOLDER_SEQUENCE_H
|
|
13
13
|
|
|
14
|
-
namespace Eigen {
|
|
14
|
+
namespace Eigen {
|
|
15
15
|
|
|
16
16
|
/** \ingroup Householder_Module
|
|
17
17
|
* \householder_module
|
|
@@ -34,8 +34,8 @@ namespace Eigen {
|
|
|
34
34
|
* form \f$ H = \prod_{i=0}^{n-1} H_i \f$ where the i-th Householder reflection is \f$ H_i = I - h_i v_i
|
|
35
35
|
* v_i^* \f$. The i-th Householder coefficient \f$ h_i \f$ is a scalar and the i-th Householder vector \f$
|
|
36
36
|
* v_i \f$ is a vector of the form
|
|
37
|
-
* \f[
|
|
38
|
-
* v_i = [\underbrace{0, \ldots, 0}_{i-1\mbox{ zeros}}, 1, \underbrace{*, \ldots,*}_{n-i\mbox{ arbitrary entries}} ].
|
|
37
|
+
* \f[
|
|
38
|
+
* v_i = [\underbrace{0, \ldots, 0}_{i-1\mbox{ zeros}}, 1, \underbrace{*, \ldots,*}_{n-i\mbox{ arbitrary entries}} ].
|
|
39
39
|
* \f]
|
|
40
40
|
* The last \f$ n-i \f$ entries of \f$ v_i \f$ are called the essential part of the Householder vector.
|
|
41
41
|
*
|
|
@@ -87,7 +87,7 @@ struct hseq_side_dependent_impl
|
|
|
87
87
|
{
|
|
88
88
|
typedef Block<const VectorsType, Dynamic, 1> EssentialVectorType;
|
|
89
89
|
typedef HouseholderSequence<VectorsType, CoeffsType, OnTheLeft> HouseholderSequenceType;
|
|
90
|
-
static inline const EssentialVectorType essentialVector(const HouseholderSequenceType& h, Index k)
|
|
90
|
+
static EIGEN_DEVICE_FUNC inline const EssentialVectorType essentialVector(const HouseholderSequenceType& h, Index k)
|
|
91
91
|
{
|
|
92
92
|
Index start = k+1+h.m_shift;
|
|
93
93
|
return Block<const VectorsType,Dynamic,1>(h.m_vectors, start, k, h.rows()-start, 1);
|
|
@@ -120,7 +120,7 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
|
|
|
120
120
|
: public EigenBase<HouseholderSequence<VectorsType,CoeffsType,Side> >
|
|
121
121
|
{
|
|
122
122
|
typedef typename internal::hseq_side_dependent_impl<VectorsType,CoeffsType,Side>::EssentialVectorType EssentialVectorType;
|
|
123
|
-
|
|
123
|
+
|
|
124
124
|
public:
|
|
125
125
|
enum {
|
|
126
126
|
RowsAtCompileTime = internal::traits<HouseholderSequence>::RowsAtCompileTime,
|
|
@@ -140,6 +140,28 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
|
|
|
140
140
|
Side
|
|
141
141
|
> ConjugateReturnType;
|
|
142
142
|
|
|
143
|
+
typedef HouseholderSequence<
|
|
144
|
+
VectorsType,
|
|
145
|
+
typename internal::conditional<NumTraits<Scalar>::IsComplex,
|
|
146
|
+
typename internal::remove_all<typename CoeffsType::ConjugateReturnType>::type,
|
|
147
|
+
CoeffsType>::type,
|
|
148
|
+
Side
|
|
149
|
+
> AdjointReturnType;
|
|
150
|
+
|
|
151
|
+
typedef HouseholderSequence<
|
|
152
|
+
typename internal::conditional<NumTraits<Scalar>::IsComplex,
|
|
153
|
+
typename internal::remove_all<typename VectorsType::ConjugateReturnType>::type,
|
|
154
|
+
VectorsType>::type,
|
|
155
|
+
CoeffsType,
|
|
156
|
+
Side
|
|
157
|
+
> TransposeReturnType;
|
|
158
|
+
|
|
159
|
+
typedef HouseholderSequence<
|
|
160
|
+
typename internal::add_const<VectorsType>::type,
|
|
161
|
+
typename internal::add_const<CoeffsType>::type,
|
|
162
|
+
Side
|
|
163
|
+
> ConstHouseholderSequence;
|
|
164
|
+
|
|
143
165
|
/** \brief Constructor.
|
|
144
166
|
* \param[in] v %Matrix containing the essential parts of the Householder vectors
|
|
145
167
|
* \param[in] h Vector containing the Householder coefficients
|
|
@@ -157,33 +179,37 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
|
|
|
157
179
|
*
|
|
158
180
|
* \sa setLength(), setShift()
|
|
159
181
|
*/
|
|
182
|
+
EIGEN_DEVICE_FUNC
|
|
160
183
|
HouseholderSequence(const VectorsType& v, const CoeffsType& h)
|
|
161
|
-
: m_vectors(v), m_coeffs(h),
|
|
184
|
+
: m_vectors(v), m_coeffs(h), m_reverse(false), m_length(v.diagonalSize()),
|
|
162
185
|
m_shift(0)
|
|
163
186
|
{
|
|
164
187
|
}
|
|
165
188
|
|
|
166
189
|
/** \brief Copy constructor. */
|
|
190
|
+
EIGEN_DEVICE_FUNC
|
|
167
191
|
HouseholderSequence(const HouseholderSequence& other)
|
|
168
192
|
: m_vectors(other.m_vectors),
|
|
169
193
|
m_coeffs(other.m_coeffs),
|
|
170
|
-
|
|
194
|
+
m_reverse(other.m_reverse),
|
|
171
195
|
m_length(other.m_length),
|
|
172
196
|
m_shift(other.m_shift)
|
|
173
197
|
{
|
|
174
198
|
}
|
|
175
199
|
|
|
176
200
|
/** \brief Number of rows of transformation viewed as a matrix.
|
|
177
|
-
* \returns Number of rows
|
|
201
|
+
* \returns Number of rows
|
|
178
202
|
* \details This equals the dimension of the space that the transformation acts on.
|
|
179
203
|
*/
|
|
180
|
-
|
|
204
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
205
|
+
Index rows() const EIGEN_NOEXCEPT { return Side==OnTheLeft ? m_vectors.rows() : m_vectors.cols(); }
|
|
181
206
|
|
|
182
207
|
/** \brief Number of columns of transformation viewed as a matrix.
|
|
183
208
|
* \returns Number of columns
|
|
184
209
|
* \details This equals the dimension of the space that the transformation acts on.
|
|
185
210
|
*/
|
|
186
|
-
|
|
211
|
+
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
|
|
212
|
+
Index cols() const EIGEN_NOEXCEPT { return rows(); }
|
|
187
213
|
|
|
188
214
|
/** \brief Essential part of a Householder vector.
|
|
189
215
|
* \param[in] k Index of Householder reflection
|
|
@@ -191,14 +217,15 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
|
|
|
191
217
|
*
|
|
192
218
|
* This function returns the essential part of the Householder vector \f$ v_i \f$. This is a vector of
|
|
193
219
|
* length \f$ n-i \f$ containing the last \f$ n-i \f$ entries of the vector
|
|
194
|
-
* \f[
|
|
195
|
-
* v_i = [\underbrace{0, \ldots, 0}_{i-1\mbox{ zeros}}, 1, \underbrace{*, \ldots,*}_{n-i\mbox{ arbitrary entries}} ].
|
|
220
|
+
* \f[
|
|
221
|
+
* v_i = [\underbrace{0, \ldots, 0}_{i-1\mbox{ zeros}}, 1, \underbrace{*, \ldots,*}_{n-i\mbox{ arbitrary entries}} ].
|
|
196
222
|
* \f]
|
|
197
223
|
* The index \f$ i \f$ equals \p k + shift(), corresponding to the k-th column of the matrix \p v
|
|
198
224
|
* passed to the constructor.
|
|
199
225
|
*
|
|
200
226
|
* \sa setShift(), shift()
|
|
201
227
|
*/
|
|
228
|
+
EIGEN_DEVICE_FUNC
|
|
202
229
|
const EssentialVectorType essentialVector(Index k) const
|
|
203
230
|
{
|
|
204
231
|
eigen_assert(k >= 0 && k < m_length);
|
|
@@ -206,31 +233,51 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
|
|
|
206
233
|
}
|
|
207
234
|
|
|
208
235
|
/** \brief %Transpose of the Householder sequence. */
|
|
209
|
-
|
|
236
|
+
TransposeReturnType transpose() const
|
|
210
237
|
{
|
|
211
|
-
return
|
|
238
|
+
return TransposeReturnType(m_vectors.conjugate(), m_coeffs)
|
|
239
|
+
.setReverseFlag(!m_reverse)
|
|
240
|
+
.setLength(m_length)
|
|
241
|
+
.setShift(m_shift);
|
|
212
242
|
}
|
|
213
243
|
|
|
214
244
|
/** \brief Complex conjugate of the Householder sequence. */
|
|
215
245
|
ConjugateReturnType conjugate() const
|
|
216
246
|
{
|
|
217
247
|
return ConjugateReturnType(m_vectors.conjugate(), m_coeffs.conjugate())
|
|
218
|
-
.
|
|
248
|
+
.setReverseFlag(m_reverse)
|
|
219
249
|
.setLength(m_length)
|
|
220
250
|
.setShift(m_shift);
|
|
221
251
|
}
|
|
222
252
|
|
|
253
|
+
/** \returns an expression of the complex conjugate of \c *this if Cond==true,
|
|
254
|
+
* returns \c *this otherwise.
|
|
255
|
+
*/
|
|
256
|
+
template<bool Cond>
|
|
257
|
+
EIGEN_DEVICE_FUNC
|
|
258
|
+
inline typename internal::conditional<Cond,ConjugateReturnType,ConstHouseholderSequence>::type
|
|
259
|
+
conjugateIf() const
|
|
260
|
+
{
|
|
261
|
+
typedef typename internal::conditional<Cond,ConjugateReturnType,ConstHouseholderSequence>::type ReturnType;
|
|
262
|
+
return ReturnType(m_vectors.template conjugateIf<Cond>(), m_coeffs.template conjugateIf<Cond>());
|
|
263
|
+
}
|
|
264
|
+
|
|
223
265
|
/** \brief Adjoint (conjugate transpose) of the Householder sequence. */
|
|
224
|
-
|
|
266
|
+
AdjointReturnType adjoint() const
|
|
225
267
|
{
|
|
226
|
-
return
|
|
268
|
+
return AdjointReturnType(m_vectors, m_coeffs.conjugate())
|
|
269
|
+
.setReverseFlag(!m_reverse)
|
|
270
|
+
.setLength(m_length)
|
|
271
|
+
.setShift(m_shift);
|
|
227
272
|
}
|
|
228
273
|
|
|
229
274
|
/** \brief Inverse of the Householder sequence (equals the adjoint). */
|
|
230
|
-
|
|
275
|
+
AdjointReturnType inverse() const { return adjoint(); }
|
|
231
276
|
|
|
232
277
|
/** \internal */
|
|
233
|
-
template<typename DestType>
|
|
278
|
+
template<typename DestType>
|
|
279
|
+
inline EIGEN_DEVICE_FUNC
|
|
280
|
+
void evalTo(DestType& dst) const
|
|
234
281
|
{
|
|
235
282
|
Matrix<Scalar, DestType::RowsAtCompileTime, 1,
|
|
236
283
|
AutoAlign|ColMajor, DestType::MaxRowsAtCompileTime, 1> workspace(rows());
|
|
@@ -239,6 +286,7 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
|
|
|
239
286
|
|
|
240
287
|
/** \internal */
|
|
241
288
|
template<typename Dest, typename Workspace>
|
|
289
|
+
EIGEN_DEVICE_FUNC
|
|
242
290
|
void evalTo(Dest& dst, Workspace& workspace) const
|
|
243
291
|
{
|
|
244
292
|
workspace.resize(rows());
|
|
@@ -251,7 +299,7 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
|
|
|
251
299
|
for(Index k = vecs-1; k >= 0; --k)
|
|
252
300
|
{
|
|
253
301
|
Index cornerSize = rows() - k - m_shift;
|
|
254
|
-
if(
|
|
302
|
+
if(m_reverse)
|
|
255
303
|
dst.bottomRightCorner(cornerSize, cornerSize)
|
|
256
304
|
.applyHouseholderOnTheRight(essentialVector(k), m_coeffs.coeff(k), workspace.data());
|
|
257
305
|
else
|
|
@@ -265,18 +313,26 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
|
|
|
265
313
|
for(Index k = 0; k<cols()-vecs ; ++k)
|
|
266
314
|
dst.col(k).tail(rows()-k-1).setZero();
|
|
267
315
|
}
|
|
316
|
+
else if(m_length>BlockSize)
|
|
317
|
+
{
|
|
318
|
+
dst.setIdentity(rows(), rows());
|
|
319
|
+
if(m_reverse)
|
|
320
|
+
applyThisOnTheLeft(dst,workspace,true);
|
|
321
|
+
else
|
|
322
|
+
applyThisOnTheLeft(dst,workspace,true);
|
|
323
|
+
}
|
|
268
324
|
else
|
|
269
325
|
{
|
|
270
326
|
dst.setIdentity(rows(), rows());
|
|
271
327
|
for(Index k = vecs-1; k >= 0; --k)
|
|
272
328
|
{
|
|
273
329
|
Index cornerSize = rows() - k - m_shift;
|
|
274
|
-
if(
|
|
330
|
+
if(m_reverse)
|
|
275
331
|
dst.bottomRightCorner(cornerSize, cornerSize)
|
|
276
|
-
.applyHouseholderOnTheRight(essentialVector(k), m_coeffs.coeff(k),
|
|
332
|
+
.applyHouseholderOnTheRight(essentialVector(k), m_coeffs.coeff(k), workspace.data());
|
|
277
333
|
else
|
|
278
334
|
dst.bottomRightCorner(cornerSize, cornerSize)
|
|
279
|
-
.applyHouseholderOnTheLeft(essentialVector(k), m_coeffs.coeff(k),
|
|
335
|
+
.applyHouseholderOnTheLeft(essentialVector(k), m_coeffs.coeff(k), workspace.data());
|
|
280
336
|
}
|
|
281
337
|
}
|
|
282
338
|
}
|
|
@@ -295,42 +351,52 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
|
|
|
295
351
|
workspace.resize(dst.rows());
|
|
296
352
|
for(Index k = 0; k < m_length; ++k)
|
|
297
353
|
{
|
|
298
|
-
Index actual_k =
|
|
354
|
+
Index actual_k = m_reverse ? m_length-k-1 : k;
|
|
299
355
|
dst.rightCols(rows()-m_shift-actual_k)
|
|
300
356
|
.applyHouseholderOnTheRight(essentialVector(actual_k), m_coeffs.coeff(actual_k), workspace.data());
|
|
301
357
|
}
|
|
302
358
|
}
|
|
303
359
|
|
|
304
360
|
/** \internal */
|
|
305
|
-
template<typename Dest> inline void applyThisOnTheLeft(Dest& dst) const
|
|
361
|
+
template<typename Dest> inline void applyThisOnTheLeft(Dest& dst, bool inputIsIdentity = false) const
|
|
306
362
|
{
|
|
307
363
|
Matrix<Scalar,1,Dest::ColsAtCompileTime,RowMajor,1,Dest::MaxColsAtCompileTime> workspace;
|
|
308
|
-
applyThisOnTheLeft(dst, workspace);
|
|
364
|
+
applyThisOnTheLeft(dst, workspace, inputIsIdentity);
|
|
309
365
|
}
|
|
310
366
|
|
|
311
367
|
/** \internal */
|
|
312
368
|
template<typename Dest, typename Workspace>
|
|
313
|
-
inline void applyThisOnTheLeft(Dest& dst, Workspace& workspace) const
|
|
369
|
+
inline void applyThisOnTheLeft(Dest& dst, Workspace& workspace, bool inputIsIdentity = false) const
|
|
314
370
|
{
|
|
315
|
-
|
|
371
|
+
if(inputIsIdentity && m_reverse)
|
|
372
|
+
inputIsIdentity = false;
|
|
316
373
|
// if the entries are large enough, then apply the reflectors by block
|
|
317
374
|
if(m_length>=BlockSize && dst.cols()>1)
|
|
318
375
|
{
|
|
319
|
-
|
|
376
|
+
// Make sure we have at least 2 useful blocks, otherwise it is point-less:
|
|
377
|
+
Index blockSize = m_length<Index(2*BlockSize) ? (m_length+1)/2 : Index(BlockSize);
|
|
378
|
+
for(Index i = 0; i < m_length; i+=blockSize)
|
|
320
379
|
{
|
|
321
|
-
Index end =
|
|
322
|
-
Index k =
|
|
380
|
+
Index end = m_reverse ? (std::min)(m_length,i+blockSize) : m_length-i;
|
|
381
|
+
Index k = m_reverse ? i : (std::max)(Index(0),end-blockSize);
|
|
323
382
|
Index bs = end-k;
|
|
324
383
|
Index start = k + m_shift;
|
|
325
|
-
|
|
384
|
+
|
|
326
385
|
typedef Block<typename internal::remove_all<VectorsType>::type,Dynamic,Dynamic> SubVectorsType;
|
|
327
386
|
SubVectorsType sub_vecs1(m_vectors.const_cast_derived(), Side==OnTheRight ? k : start,
|
|
328
387
|
Side==OnTheRight ? start : k,
|
|
329
388
|
Side==OnTheRight ? bs : m_vectors.rows()-start,
|
|
330
389
|
Side==OnTheRight ? m_vectors.cols()-start : bs);
|
|
331
390
|
typename internal::conditional<Side==OnTheRight, Transpose<SubVectorsType>, SubVectorsType&>::type sub_vecs(sub_vecs1);
|
|
332
|
-
|
|
333
|
-
|
|
391
|
+
|
|
392
|
+
Index dstStart = dst.rows()-rows()+m_shift+k;
|
|
393
|
+
Index dstRows = rows()-m_shift-k;
|
|
394
|
+
Block<Dest,Dynamic,Dynamic> sub_dst(dst,
|
|
395
|
+
dstStart,
|
|
396
|
+
inputIsIdentity ? dstStart : 0,
|
|
397
|
+
dstRows,
|
|
398
|
+
inputIsIdentity ? dstRows : dst.cols());
|
|
399
|
+
apply_block_householder_on_the_left(sub_dst, sub_vecs, m_coeffs.segment(k, bs), !m_reverse);
|
|
334
400
|
}
|
|
335
401
|
}
|
|
336
402
|
else
|
|
@@ -338,8 +404,9 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
|
|
|
338
404
|
workspace.resize(dst.cols());
|
|
339
405
|
for(Index k = 0; k < m_length; ++k)
|
|
340
406
|
{
|
|
341
|
-
Index actual_k =
|
|
342
|
-
|
|
407
|
+
Index actual_k = m_reverse ? k : m_length-k-1;
|
|
408
|
+
Index dstStart = rows()-m_shift-actual_k;
|
|
409
|
+
dst.bottomRightCorner(dstStart, inputIsIdentity ? dstStart : dst.cols())
|
|
343
410
|
.applyHouseholderOnTheLeft(essentialVector(actual_k), m_coeffs.coeff(actual_k), workspace.data());
|
|
344
411
|
}
|
|
345
412
|
}
|
|
@@ -357,7 +424,7 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
|
|
|
357
424
|
{
|
|
358
425
|
typename internal::matrix_type_times_scalar_type<Scalar, OtherDerived>::Type
|
|
359
426
|
res(other.template cast<typename internal::matrix_type_times_scalar_type<Scalar,OtherDerived>::ResultScalar>());
|
|
360
|
-
applyThisOnTheLeft(res);
|
|
427
|
+
applyThisOnTheLeft(res, internal::is_identity<OtherDerived>::value && res.rows()==res.cols());
|
|
361
428
|
return res;
|
|
362
429
|
}
|
|
363
430
|
|
|
@@ -372,6 +439,7 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
|
|
|
372
439
|
*
|
|
373
440
|
* \sa length()
|
|
374
441
|
*/
|
|
442
|
+
EIGEN_DEVICE_FUNC
|
|
375
443
|
HouseholderSequence& setLength(Index length)
|
|
376
444
|
{
|
|
377
445
|
m_length = length;
|
|
@@ -389,13 +457,17 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
|
|
|
389
457
|
*
|
|
390
458
|
* \sa shift()
|
|
391
459
|
*/
|
|
460
|
+
EIGEN_DEVICE_FUNC
|
|
392
461
|
HouseholderSequence& setShift(Index shift)
|
|
393
462
|
{
|
|
394
463
|
m_shift = shift;
|
|
395
464
|
return *this;
|
|
396
465
|
}
|
|
397
466
|
|
|
467
|
+
EIGEN_DEVICE_FUNC
|
|
398
468
|
Index length() const { return m_length; } /**< \brief Returns the length of the Householder sequence. */
|
|
469
|
+
|
|
470
|
+
EIGEN_DEVICE_FUNC
|
|
399
471
|
Index shift() const { return m_shift; } /**< \brief Returns the shift of the Householder sequence. */
|
|
400
472
|
|
|
401
473
|
/* Necessary for .adjoint() and .conjugate() */
|
|
@@ -403,27 +475,30 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
|
|
|
403
475
|
|
|
404
476
|
protected:
|
|
405
477
|
|
|
406
|
-
/** \
|
|
407
|
-
* \
|
|
478
|
+
/** \internal
|
|
479
|
+
* \brief Sets the reverse flag.
|
|
480
|
+
* \param [in] reverse New value of the reverse flag.
|
|
408
481
|
*
|
|
409
|
-
* By default, the
|
|
410
|
-
* \f$ H^
|
|
482
|
+
* By default, the reverse flag is not set. If the reverse flag is set, then this object represents
|
|
483
|
+
* \f$ H^r = H_{n-1} \ldots H_1 H_0 \f$ instead of \f$ H = H_0 H_1 \ldots H_{n-1} \f$.
|
|
484
|
+
* \note For real valued HouseholderSequence this is equivalent to transposing \f$ H \f$.
|
|
411
485
|
*
|
|
412
|
-
* \sa
|
|
486
|
+
* \sa reverseFlag(), transpose(), adjoint()
|
|
413
487
|
*/
|
|
414
|
-
HouseholderSequence&
|
|
488
|
+
HouseholderSequence& setReverseFlag(bool reverse)
|
|
415
489
|
{
|
|
416
|
-
|
|
490
|
+
m_reverse = reverse;
|
|
417
491
|
return *this;
|
|
418
492
|
}
|
|
419
493
|
|
|
420
|
-
bool
|
|
494
|
+
bool reverseFlag() const { return m_reverse; } /**< \internal \brief Returns the reverse flag. */
|
|
421
495
|
|
|
422
496
|
typename VectorsType::Nested m_vectors;
|
|
423
497
|
typename CoeffsType::Nested m_coeffs;
|
|
424
|
-
bool
|
|
498
|
+
bool m_reverse;
|
|
425
499
|
Index m_length;
|
|
426
500
|
Index m_shift;
|
|
501
|
+
enum { BlockSize = 48 };
|
|
427
502
|
};
|
|
428
503
|
|
|
429
504
|
/** \brief Computes the product of a matrix with a Householder sequence.
|
|
@@ -444,7 +519,7 @@ typename internal::matrix_type_times_scalar_type<typename VectorsType::Scalar,Ot
|
|
|
444
519
|
}
|
|
445
520
|
|
|
446
521
|
/** \ingroup Householder_Module \householder_module
|
|
447
|
-
* \brief Convenience function for constructing a Householder sequence.
|
|
522
|
+
* \brief Convenience function for constructing a Householder sequence.
|
|
448
523
|
* \returns A HouseholderSequence constructed from the specified arguments.
|
|
449
524
|
*/
|
|
450
525
|
template<typename VectorsType, typename CoeffsType>
|
|
@@ -454,7 +529,7 @@ HouseholderSequence<VectorsType,CoeffsType> householderSequence(const VectorsTyp
|
|
|
454
529
|
}
|
|
455
530
|
|
|
456
531
|
/** \ingroup Householder_Module \householder_module
|
|
457
|
-
* \brief Convenience function for constructing a Householder sequence.
|
|
532
|
+
* \brief Convenience function for constructing a Householder sequence.
|
|
458
533
|
* \returns A HouseholderSequence constructed from the specified arguments.
|
|
459
534
|
* \details This function differs from householderSequence() in that the template argument \p OnTheSide of
|
|
460
535
|
* the constructed HouseholderSequence is set to OnTheRight, instead of the default OnTheLeft.
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
#ifndef EIGEN_BASIC_PRECONDITIONERS_H
|
|
11
11
|
#define EIGEN_BASIC_PRECONDITIONERS_H
|
|
12
12
|
|
|
13
|
-
namespace Eigen {
|
|
13
|
+
namespace Eigen {
|
|
14
14
|
|
|
15
15
|
/** \ingroup IterativeLinearSolvers_Module
|
|
16
16
|
* \brief A preconditioner based on the digonal entries
|
|
@@ -52,15 +52,15 @@ class DiagonalPreconditioner
|
|
|
52
52
|
compute(mat);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
Index rows() const { return m_invdiag.size(); }
|
|
56
|
-
Index cols() const { return m_invdiag.size(); }
|
|
57
|
-
|
|
55
|
+
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_invdiag.size(); }
|
|
56
|
+
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_invdiag.size(); }
|
|
57
|
+
|
|
58
58
|
template<typename MatType>
|
|
59
59
|
DiagonalPreconditioner& analyzePattern(const MatType& )
|
|
60
60
|
{
|
|
61
61
|
return *this;
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
|
|
64
64
|
template<typename MatType>
|
|
65
65
|
DiagonalPreconditioner& factorize(const MatType& mat)
|
|
66
66
|
{
|
|
@@ -77,7 +77,7 @@ class DiagonalPreconditioner
|
|
|
77
77
|
m_isInitialized = true;
|
|
78
78
|
return *this;
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
|
|
81
81
|
template<typename MatType>
|
|
82
82
|
DiagonalPreconditioner& compute(const MatType& mat)
|
|
83
83
|
{
|
|
@@ -99,7 +99,7 @@ class DiagonalPreconditioner
|
|
|
99
99
|
&& "DiagonalPreconditioner::solve(): invalid number of rows of the right hand side matrix b");
|
|
100
100
|
return Solve<DiagonalPreconditioner, Rhs>(*this, b.derived());
|
|
101
101
|
}
|
|
102
|
-
|
|
102
|
+
|
|
103
103
|
ComputationInfo info() { return Success; }
|
|
104
104
|
|
|
105
105
|
protected:
|
|
@@ -121,7 +121,7 @@ class DiagonalPreconditioner
|
|
|
121
121
|
* \implsparsesolverconcept
|
|
122
122
|
*
|
|
123
123
|
* The diagonal entries are pre-inverted and stored into a dense vector.
|
|
124
|
-
*
|
|
124
|
+
*
|
|
125
125
|
* \sa class LeastSquaresConjugateGradient, class DiagonalPreconditioner
|
|
126
126
|
*/
|
|
127
127
|
template <typename _Scalar>
|
|
@@ -146,7 +146,7 @@ class LeastSquareDiagonalPreconditioner : public DiagonalPreconditioner<_Scalar>
|
|
|
146
146
|
{
|
|
147
147
|
return *this;
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
|
|
150
150
|
template<typename MatType>
|
|
151
151
|
LeastSquareDiagonalPreconditioner& factorize(const MatType& mat)
|
|
152
152
|
{
|
|
@@ -178,13 +178,13 @@ class LeastSquareDiagonalPreconditioner : public DiagonalPreconditioner<_Scalar>
|
|
|
178
178
|
Base::m_isInitialized = true;
|
|
179
179
|
return *this;
|
|
180
180
|
}
|
|
181
|
-
|
|
181
|
+
|
|
182
182
|
template<typename MatType>
|
|
183
183
|
LeastSquareDiagonalPreconditioner& compute(const MatType& mat)
|
|
184
184
|
{
|
|
185
185
|
return factorize(mat);
|
|
186
186
|
}
|
|
187
|
-
|
|
187
|
+
|
|
188
188
|
ComputationInfo info() { return Success; }
|
|
189
189
|
|
|
190
190
|
protected:
|
|
@@ -205,19 +205,19 @@ class IdentityPreconditioner
|
|
|
205
205
|
|
|
206
206
|
template<typename MatrixType>
|
|
207
207
|
explicit IdentityPreconditioner(const MatrixType& ) {}
|
|
208
|
-
|
|
208
|
+
|
|
209
209
|
template<typename MatrixType>
|
|
210
210
|
IdentityPreconditioner& analyzePattern(const MatrixType& ) { return *this; }
|
|
211
|
-
|
|
211
|
+
|
|
212
212
|
template<typename MatrixType>
|
|
213
213
|
IdentityPreconditioner& factorize(const MatrixType& ) { return *this; }
|
|
214
214
|
|
|
215
215
|
template<typename MatrixType>
|
|
216
216
|
IdentityPreconditioner& compute(const MatrixType& ) { return *this; }
|
|
217
|
-
|
|
217
|
+
|
|
218
218
|
template<typename Rhs>
|
|
219
219
|
inline const Rhs& solve(const Rhs& b) const { return b; }
|
|
220
|
-
|
|
220
|
+
|
|
221
221
|
ComputationInfo info() { return Success; }
|
|
222
222
|
};
|
|
223
223
|
|
|
@@ -191,32 +191,16 @@ public:
|
|
|
191
191
|
|
|
192
192
|
/** \internal */
|
|
193
193
|
template<typename Rhs,typename Dest>
|
|
194
|
-
void
|
|
194
|
+
void _solve_vector_with_guess_impl(const Rhs& b, Dest& x) const
|
|
195
195
|
{
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
typename Dest::ColXpr xj(x,j);
|
|
203
|
-
if(!internal::bicgstab(matrix(), b.col(j), xj, Base::m_preconditioner, m_iterations, m_error))
|
|
204
|
-
failed = true;
|
|
205
|
-
}
|
|
206
|
-
m_info = failed ? NumericalIssue
|
|
196
|
+
m_iterations = Base::maxIterations();
|
|
197
|
+
m_error = Base::m_tolerance;
|
|
198
|
+
|
|
199
|
+
bool ret = internal::bicgstab(matrix(), b, x, Base::m_preconditioner, m_iterations, m_error);
|
|
200
|
+
|
|
201
|
+
m_info = (!ret) ? NumericalIssue
|
|
207
202
|
: m_error <= Base::m_tolerance ? Success
|
|
208
203
|
: NoConvergence;
|
|
209
|
-
m_isInitialized = true;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/** \internal */
|
|
213
|
-
using Base::_solve_impl;
|
|
214
|
-
template<typename Rhs,typename Dest>
|
|
215
|
-
void _solve_impl(const MatrixBase<Rhs>& b, Dest& x) const
|
|
216
|
-
{
|
|
217
|
-
x.resize(this->rows(),b.cols());
|
|
218
|
-
x.setZero();
|
|
219
|
-
_solve_with_guess_impl(b,x);
|
|
220
204
|
}
|
|
221
205
|
|
|
222
206
|
protected:
|
|
@@ -51,7 +51,7 @@ void conjugate_gradient(const MatrixType& mat, const Rhs& rhs, Dest& x,
|
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
const RealScalar considerAsZero = (std::numeric_limits<RealScalar>::min)();
|
|
54
|
-
RealScalar threshold = numext::maxi(tol*tol*rhsNorm2,considerAsZero);
|
|
54
|
+
RealScalar threshold = numext::maxi(RealScalar(tol*tol*rhsNorm2),considerAsZero);
|
|
55
55
|
RealScalar residualNorm2 = residual.squaredNorm();
|
|
56
56
|
if (residualNorm2 < threshold)
|
|
57
57
|
{
|
|
@@ -195,7 +195,7 @@ public:
|
|
|
195
195
|
|
|
196
196
|
/** \internal */
|
|
197
197
|
template<typename Rhs,typename Dest>
|
|
198
|
-
void
|
|
198
|
+
void _solve_vector_with_guess_impl(const Rhs& b, Dest& x) const
|
|
199
199
|
{
|
|
200
200
|
typedef typename Base::MatrixWrapper MatrixWrapper;
|
|
201
201
|
typedef typename Base::ActualMatrixType ActualMatrixType;
|
|
@@ -211,31 +211,14 @@ public:
|
|
|
211
211
|
RowMajorWrapper,
|
|
212
212
|
typename MatrixWrapper::template ConstSelfAdjointViewReturnType<UpLo>::Type
|
|
213
213
|
>::type SelfAdjointWrapper;
|
|
214
|
+
|
|
214
215
|
m_iterations = Base::maxIterations();
|
|
215
216
|
m_error = Base::m_tolerance;
|
|
216
217
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
m_iterations = Base::maxIterations();
|
|
220
|
-
m_error = Base::m_tolerance;
|
|
221
|
-
|
|
222
|
-
typename Dest::ColXpr xj(x,j);
|
|
223
|
-
RowMajorWrapper row_mat(matrix());
|
|
224
|
-
internal::conjugate_gradient(SelfAdjointWrapper(row_mat), b.col(j), xj, Base::m_preconditioner, m_iterations, m_error);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
m_isInitialized = true;
|
|
218
|
+
RowMajorWrapper row_mat(matrix());
|
|
219
|
+
internal::conjugate_gradient(SelfAdjointWrapper(row_mat), b, x, Base::m_preconditioner, m_iterations, m_error);
|
|
228
220
|
m_info = m_error <= Base::m_tolerance ? Success : NoConvergence;
|
|
229
221
|
}
|
|
230
|
-
|
|
231
|
-
/** \internal */
|
|
232
|
-
using Base::_solve_impl;
|
|
233
|
-
template<typename Rhs,typename Dest>
|
|
234
|
-
void _solve_impl(const MatrixBase<Rhs>& b, Dest& x) const
|
|
235
|
-
{
|
|
236
|
-
x.setZero();
|
|
237
|
-
_solve_with_guess_impl(b.derived(),x);
|
|
238
|
-
}
|
|
239
222
|
|
|
240
223
|
protected:
|
|
241
224
|
|