11#ifndef EIGEN_HESSENBERGDECOMPOSITION_H
12#define EIGEN_HESSENBERGDECOMPOSITION_H
18template<
typename MatrixType>
struct HessenbergDecompositionMatrixHReturnType;
19template<
typename MatrixType>
65 Size = MatrixType::RowsAtCompileTime,
68 MaxSize = MatrixType::MaxRowsAtCompileTime,
73 typedef typename MatrixType::Scalar
Scalar;
118 template<
typename InputType>
151 template<
typename InputType>
293template<
typename MatrixType>
297 Index n = matA.rows();
299 for (
Index i = 0; i<n-1; ++i)
302 Index remainingSize = n-i-1;
305 matA.col(i).tail(remainingSize).makeHouseholderInPlace(
h,
beta);
306 matA.col(i).coeffRef(i+1) =
beta;
307 hCoeffs.coeffRef(i) =
h;
313 matA.bottomRightCorner(remainingSize, remainingSize)
314 .applyHouseholderOnTheLeft(matA.col(i).tail(remainingSize-1),
h, &temp.coeffRef(0));
317 matA.rightCols(remainingSize)
318 .applyHouseholderOnTheRight(matA.col(i).tail(remainingSize-1), numext::conj(
h), &temp.coeffRef(0));
340:
public ReturnByValue<HessenbergDecompositionMatrixHReturnType<MatrixType> >
354 template <
typename ResultType>
357 result = m_hess.packedMatrix();
360 result.bottomLeftCorner(n-2, n-2).template triangularView<Lower>().setZero();
363 Index rows()
const {
return m_hess.packedMatrix().rows(); }
364 Index cols()
const {
return m_hess.packedMatrix().cols(); }
#define eigen_assert(x)
Definition: Macros.h:1047
constexpr common_return_t< T1, T2 > beta(const T1 a, const T2 b) noexcept
Compile-time beta function.
Definition: beta.hpp:36
\eigenvalues_module
Definition: HessenbergDecomposition.h:58
HessenbergDecomposition & compute(const EigenBase< InputType > &matrix)
Computes Hessenberg decomposition of given matrix.
Definition: HessenbergDecomposition.h:152
HouseholderSequenceType matrixQ() const
Reconstructs the orthogonal matrix Q in the decomposition.
Definition: HessenbergDecomposition.h:234
const MatrixType & packedMatrix() const
Returns the internal representation of the decomposition.
Definition: HessenbergDecomposition.h:214
bool m_isInitialized
Definition: HessenbergDecomposition.h:278
Matrix< Scalar, SizeMinusOne, 1, Options &~RowMajor, MaxSizeMinusOne, 1 > CoeffVectorType
Type for vector of Householder coefficients.
Definition: HessenbergDecomposition.h:82
VectorType m_temp
Definition: HessenbergDecomposition.h:277
CoeffVectorType m_hCoeffs
Definition: HessenbergDecomposition.h:276
HouseholderSequence< MatrixType, typename internal::remove_all< typename CoeffVectorType::ConjugateReturnType >::type > HouseholderSequenceType
Return type of matrixQ()
Definition: HessenbergDecomposition.h:85
Eigen::Index Index
Definition: HessenbergDecomposition.h:74
MatrixHReturnType matrixH() const
Constructs the Hessenberg matrix H in the decomposition.
Definition: HessenbergDecomposition.h:262
_MatrixType MatrixType
Synonym for the template parameter _MatrixType.
Definition: HessenbergDecomposition.h:62
MatrixType::Scalar Scalar
Scalar type for matrices of type MatrixType.
Definition: HessenbergDecomposition.h:73
MatrixType m_matrix
Definition: HessenbergDecomposition.h:275
@ MaxSizeMinusOne
Definition: HessenbergDecomposition.h:69
@ Size
Definition: HessenbergDecomposition.h:65
@ Options
Definition: HessenbergDecomposition.h:67
@ SizeMinusOne
Definition: HessenbergDecomposition.h:66
@ MaxSize
Definition: HessenbergDecomposition.h:68
internal::HessenbergDecompositionMatrixHReturnType< MatrixType > MatrixHReturnType
Definition: HessenbergDecomposition.h:87
HessenbergDecomposition(const EigenBase< InputType > &matrix)
Constructor; computes Hessenberg decomposition of given matrix.
Definition: HessenbergDecomposition.h:119
HessenbergDecomposition(Index size=Size==Dynamic ? 2 :Size)
Default constructor; the decomposition will be computed later.
Definition: HessenbergDecomposition.h:100
const CoeffVectorType & householderCoefficients() const
Returns the Householder coefficients.
Definition: HessenbergDecomposition.h:179
\householder_module
Definition: HouseholderSequence.h:121
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Resizes *this to a rows x cols matrix.
Definition: PlainObjectBase.h:271
Definition: ReturnByValue.h:52
@ RowMajor
Storage order is row major (see TopicStorageOrders).
Definition: Constants.h:321
EIGEN_CONSTEXPR Index size(const T &x)
Definition: Meta.h:479
Namespace containing all symbols from the Eigen library.
Definition: MatrixExponential.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time,...
Definition: Constants.h:22
result
Definition: format.h:2556
Definition: Eigen_Colamd.h:50
static constexpr const unit_t< compound_unit< energy::joule, time::seconds > > h(6.626070040e-34)
Planck constant.
Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor Matrix...
Definition: EigenBase.h:30
EIGEN_DEVICE_FUNC Derived & derived()
Definition: EigenBase.h:46
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: EigenBase.h:60
Holds information about the various numeric (i.e.
Definition: NumTraits.h:233
\eigenvalues_module
Definition: HessenbergDecomposition.h:341
Index cols() const
Definition: HessenbergDecomposition.h:364
void evalTo(ResultType &result) const
Hessenberg matrix in decomposition.
Definition: HessenbergDecomposition.h:355
HessenbergDecompositionMatrixHReturnType(const HessenbergDecomposition< MatrixType > &hess)
Constructor.
Definition: HessenbergDecomposition.h:347
const HessenbergDecomposition< MatrixType > & m_hess
Definition: HessenbergDecomposition.h:367
Index rows() const
Definition: HessenbergDecomposition.h:363
MatrixType ReturnType
Definition: HessenbergDecomposition.h:22
Definition: ForwardDeclarations.h:17