11 #ifndef EIGEN_HESSENBERGDECOMPOSITION_H
12 #define EIGEN_HESSENBERGDECOMPOSITION_H
21 template <
typename MatrixType>
22 struct HessenbergDecompositionMatrixHReturnType;
23 template <
typename MatrixType>
60 template <
typename MatrixType_>
67 Size = MatrixType::RowsAtCompileTime,
70 MaxSize = MatrixType::MaxRowsAtCompileTime,
117 template <
typename InputType>
146 template <
typename InputType>
279 template <
typename MatrixType>
286 Index remainingSize =
n -
i - 1;
289 matA.col(
i).tail(remainingSize).makeHouseholderInPlace(h,
beta);
297 matA.bottomRightCorner(remainingSize, remainingSize)
298 .applyHouseholderOnTheLeft(
matA.col(
i).tail(remainingSize - 1), h, &temp.
coeffRef(0));
301 matA.rightCols(remainingSize)
323 template <
typename MatrixType>
325 :
public ReturnByValue<HessenbergDecompositionMatrixHReturnType<MatrixType>> {
338 template <
typename ResultType>
339 inline void evalTo(ResultType& result)
const {
340 result = m_hess.packedMatrix();
342 if (
n > 2) result.bottomLeftCorner(
n - 2,
n - 2).template triangularView<Lower>().setZero();
345 Index rows()
const {
return m_hess.packedMatrix().rows(); }
346 Index cols()
const {
return m_hess.packedMatrix().cols(); }
AnnoyingScalar conj(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:133
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
#define eigen_assert(x)
Definition: Macros.h:910
int rows
Definition: Tutorial_commainit_02.cpp:1
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
Reduces a square matrix to Hessenberg form by an orthogonal similarity transformation.
Definition: HessenbergDecomposition.h:61
Matrix< Scalar, SizeMinusOne, 1, Options &~RowMajor, MaxSizeMinusOne, 1 > CoeffVectorType
Type for vector of Householder coefficients.
Definition: HessenbergDecomposition.h:84
const CoeffVectorType & householderCoefficients() const
Returns the Householder coefficients.
Definition: HessenbergDecomposition.h:172
HessenbergDecomposition(Index size=Size==Dynamic ? 2 :Size)
Default constructor; the decomposition will be computed later.
Definition: HessenbergDecomposition.h:103
MatrixType m_matrix
Definition: HessenbergDecomposition.h:261
@ SizeMinusOne
Definition: HessenbergDecomposition.h:68
@ MaxSizeMinusOne
Definition: HessenbergDecomposition.h:71
@ MaxSize
Definition: HessenbergDecomposition.h:70
@ Options
Definition: HessenbergDecomposition.h:69
@ Size
Definition: HessenbergDecomposition.h:67
MatrixType::Scalar Scalar
Scalar type for matrices of type MatrixType.
Definition: HessenbergDecomposition.h:75
HessenbergDecomposition & compute(const EigenBase< InputType > &matrix)
Computes Hessenberg decomposition of given matrix.
Definition: HessenbergDecomposition.h:147
HouseholderSequence< MatrixType, internal::remove_all_t< typename CoeffVectorType::ConjugateReturnType > > HouseholderSequenceType
Return type of matrixQ()
Definition: HessenbergDecomposition.h:88
HessenbergDecomposition(const EigenBase< InputType > &matrix)
Constructor; computes Hessenberg decomposition of given matrix.
Definition: HessenbergDecomposition.h:118
VectorType m_temp
Definition: HessenbergDecomposition.h:263
static void _compute(MatrixType &matA, CoeffVectorType &hCoeffs, VectorType &temp)
Definition: HessenbergDecomposition.h:280
MatrixHReturnType matrixH() const
Constructs the Hessenberg matrix H in the decomposition.
Definition: HessenbergDecomposition.h:250
HouseholderSequenceType matrixQ() const
Reconstructs the orthogonal matrix Q in the decomposition.
Definition: HessenbergDecomposition.h:225
const MatrixType & packedMatrix() const
Returns the internal representation of the decomposition.
Definition: HessenbergDecomposition.h:206
Eigen::Index Index
Definition: HessenbergDecomposition.h:76
bool m_isInitialized
Definition: HessenbergDecomposition.h:264
internal::HessenbergDecompositionMatrixHReturnType< MatrixType > MatrixHReturnType
Definition: HessenbergDecomposition.h:90
CoeffVectorType m_hCoeffs
Definition: HessenbergDecomposition.h:262
NumTraits< Scalar >::Real RealScalar
Definition: HessenbergDecomposition.h:257
Matrix< Scalar, 1, Size, int(Options)|int(RowMajor), 1, MaxSize > VectorType
Definition: HessenbergDecomposition.h:256
MatrixType_ MatrixType
Synonym for the template parameter MatrixType_.
Definition: HessenbergDecomposition.h:64
Sequence of Householder reflections acting on subspaces with decreasing size.
Definition: HouseholderSequence.h:117
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar & coeffRef(Index rowId, Index colId)
Definition: PlainObjectBase.h:217
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: PlainObjectBase.h:192
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Definition: PlainObjectBase.h:294
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: PlainObjectBase.h:191
Definition: ReturnByValue.h:50
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor >, 0, Eigen::OuterStride<> > matrix(T *data, int rows, int cols, int stride)
Definition: common.h:85
@ RowMajor
Definition: Constants.h:320
Scalar beta
Definition: level2_cplx_impl.h:36
Eigen::Matrix< Scalar, Dynamic, Dynamic, ColMajor > matA(size, size)
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
const int Dynamic
Definition: Constants.h:25
Definition: Eigen_Colamd.h:49
Definition: EigenBase.h:33
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217
Expression type for return value of HessenbergDecomposition::matrixH()
Definition: HessenbergDecomposition.h:325
Index cols() const
Definition: HessenbergDecomposition.h:346
void evalTo(ResultType &result) const
Hessenberg matrix in decomposition.
Definition: HessenbergDecomposition.h:339
HessenbergDecompositionMatrixHReturnType(const HessenbergDecomposition< MatrixType > &hess)
Constructor.
Definition: HessenbergDecomposition.h:331
const HessenbergDecomposition< MatrixType > & m_hess
Definition: HessenbergDecomposition.h:349
Index rows() const
Definition: HessenbergDecomposition.h:345
MatrixType ReturnType
Definition: HessenbergDecomposition.h:25
Definition: ForwardDeclarations.h:21