11 #ifndef EIGEN_HESSENBERGDECOMPOSITION_H
12 #define EIGEN_HESSENBERGDECOMPOSITION_H
20 template<
typename MatrixType>
struct HessenbergDecompositionMatrixHReturnType;
21 template<
typename MatrixType>
22 struct traits<HessenbergDecompositionMatrixHReturnType<
MatrixType> >
67 Size = MatrixType::RowsAtCompileTime,
70 MaxSize = MatrixType::MaxRowsAtCompileTime,
120 template<
typename InputType>
153 template<
typename InputType>
295 template<
typename MatrixType>
307 matA.col(
i).tail(remainingSize).makeHouseholderInPlace(h, beta);
308 matA.col(
i).coeffRef(
i+1) = beta;
315 matA.bottomRightCorner(remainingSize, remainingSize)
316 .applyHouseholderOnTheLeft(
matA.col(
i).tail(remainingSize-1), h, &temp.
coeffRef(0));
319 matA.rightCols(remainingSize)
341 template<
typename MatrixType>
struct HessenbergDecompositionMatrixHReturnType
342 :
public ReturnByValue<HessenbergDecompositionMatrixHReturnType<MatrixType> >
356 template <
typename ResultType>
357 inline void evalTo(ResultType& result)
const
359 result = m_hess.packedMatrix();
362 result.bottomLeftCorner(
n-2,
n-2).template triangularView<Lower>().setZero();
365 Index rows()
const {
return m_hess.packedMatrix().rows(); }
366 Index cols()
const {
return m_hess.packedMatrix().cols(); }
369 const HessenbergDecomposition<MatrixType>& m_hess;
Matrix< float, 1, Dynamic > MatrixType
internal::traits< Derived >::Scalar Scalar
Reduces a square matrix to Hessenberg form by an orthogonal similarity transformation.
Matrix< Scalar, SizeMinusOne, 1, Options &~RowMajor, MaxSizeMinusOne, 1 > CoeffVectorType
Type for vector of Householder coefficients.
const CoeffVectorType & householderCoefficients() const
Returns the Householder coefficients.
HessenbergDecomposition(Index size=Size==Dynamic ? 2 :Size)
Default constructor; the decomposition will be computed later.
MatrixType::Scalar Scalar
Scalar type for matrices of type MatrixType.
HessenbergDecomposition & compute(const EigenBase< InputType > &matrix)
Computes Hessenberg decomposition of given matrix.
HessenbergDecomposition(const EigenBase< InputType > &matrix)
Constructor; computes Hessenberg decomposition of given matrix.
static void _compute(MatrixType &matA, CoeffVectorType &hCoeffs, VectorType &temp)
MatrixHReturnType matrixH() const
Constructs the Hessenberg matrix H in the decomposition.
HouseholderSequenceType matrixQ() const
Reconstructs the orthogonal matrix Q in the decomposition.
const MatrixType & packedMatrix() const
Returns the internal representation of the decomposition.
HouseholderSequence< MatrixType, internal::remove_all_t< typename CoeffVectorType::ConjugateReturnType > > HouseholderSequenceType
Return type of matrixQ()
internal::HessenbergDecompositionMatrixHReturnType< MatrixType > MatrixHReturnType
CoeffVectorType m_hCoeffs
NumTraits< Scalar >::Real RealScalar
Matrix< Scalar, 1, Size, int(Options)|int(RowMajor), 1, MaxSize > VectorType
MatrixType_ MatrixType
Synonym for the template parameter MatrixType_.
Sequence of Householder reflections acting on subspaces with decreasing size.
constexpr void resize(Index rows, Index cols)
constexpr Scalar & coeffRef(Index rowId, Index colId)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_conjugate_op< typename Derived::Scalar >, const Derived > conj(const Eigen::ArrayBase< Derived > &x)
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.