Sequence of Householder reflections acting on subspaces with decreasing size. More...
Public Types | |
enum | { RowsAtCompileTime , ColsAtCompileTime , MaxRowsAtCompileTime , MaxColsAtCompileTime } |
typedef HouseholderSequence< VectorsType, std::conditional_t< NumTraits< Scalar >::IsComplex, internal::remove_all_t< typename CoeffsType::ConjugateReturnType >, CoeffsType >, Side > | AdjointReturnType |
typedef HouseholderSequence< std::conditional_t< NumTraits< Scalar >::IsComplex, internal::remove_all_t< typename VectorsType::ConjugateReturnType >, VectorsType >, std::conditional_t< NumTraits< Scalar >::IsComplex, internal::remove_all_t< typename CoeffsType::ConjugateReturnType >, CoeffsType >, Side > | ConjugateReturnType |
typedef HouseholderSequence< std::add_const_t< VectorsType >, std::add_const_t< CoeffsType >, Side > | ConstHouseholderSequence |
typedef internal::traits< HouseholderSequence >::Scalar | Scalar |
typedef HouseholderSequence< std::conditional_t< NumTraits< Scalar >::IsComplex, internal::remove_all_t< typename VectorsType::ConjugateReturnType >, VectorsType >, CoeffsType, Side > | TransposeReturnType |
![]() | |
typedef Eigen::Index | Index |
The interface type of indices. More... | |
typedef internal::traits< HouseholderSequence< VectorsType, CoeffsType, Side > >::StorageKind | StorageKind |
Public Member Functions | |
AdjointReturnType | adjoint () const |
Adjoint (conjugate transpose) of the Householder sequence. More... | |
template<typename Dest > | |
void | applyThisOnTheLeft (Dest &dst, bool inputIsIdentity=false) const |
template<typename Dest , typename Workspace > | |
void | applyThisOnTheLeft (Dest &dst, Workspace &workspace, bool inputIsIdentity=false) const |
template<typename Dest > | |
void | applyThisOnTheRight (Dest &dst) const |
template<typename Dest , typename Workspace > | |
void | applyThisOnTheRight (Dest &dst, Workspace &workspace) const |
EIGEN_CONSTEXPR Index | cols () const EIGEN_NOEXCEPT |
Number of columns of transformation viewed as a matrix. More... | |
ConjugateReturnType | conjugate () const |
Complex conjugate of the Householder sequence. More... | |
template<bool Cond> | |
std::conditional_t< Cond, ConjugateReturnType, ConstHouseholderSequence > | conjugateIf () const |
const EssentialVectorType | essentialVector (Index k) const |
Essential part of a Householder vector. More... | |
template<typename Dest , typename Workspace > | |
void | evalTo (Dest &dst, Workspace &workspace) const |
template<typename DestType > | |
void | evalTo (DestType &dst) const |
HouseholderSequence (const HouseholderSequence &other) | |
Copy constructor. More... | |
HouseholderSequence (const VectorsType &v, const CoeffsType &h) | |
Constructor. More... | |
AdjointReturnType | inverse () const |
Inverse of the Householder sequence (equals the adjoint). More... | |
Index | length () const |
Returns the length of the Householder sequence. More... | |
template<typename OtherDerived > | |
internal::matrix_type_times_scalar_type< Scalar, OtherDerived >::Type | operator* (const MatrixBase< OtherDerived > &other) const |
Computes the product of a Householder sequence with a matrix. More... | |
EIGEN_CONSTEXPR Index | rows () const EIGEN_NOEXCEPT |
Number of rows of transformation viewed as a matrix. More... | |
HouseholderSequence & | setLength (Index length) |
Sets the length of the Householder sequence. More... | |
HouseholderSequence & | setShift (Index shift) |
Sets the shift of the Householder sequence. More... | |
Index | shift () const |
Returns the shift of the Householder sequence. More... | |
TransposeReturnType | transpose () const |
Transpose of the Householder sequence. More... | |
![]() | |
void | addTo (Dest &dst) const |
void | applyThisOnTheLeft (Dest &dst) const |
void | applyThisOnTheRight (Dest &dst) const |
EIGEN_CONSTEXPR Index | cols () const EIGEN_NOEXCEPT |
HouseholderSequence< VectorsType, CoeffsType, Side > & | const_cast_derived () const |
const HouseholderSequence< VectorsType, CoeffsType, Side > & | const_derived () const |
HouseholderSequence< VectorsType, CoeffsType, Side > & | derived () |
const HouseholderSequence< VectorsType, CoeffsType, Side > & | derived () const |
void | evalTo (Dest &dst) const |
EIGEN_CONSTEXPR Index | rows () const EIGEN_NOEXCEPT |
EIGEN_CONSTEXPR Index | size () const EIGEN_NOEXCEPT |
void | subTo (Dest &dst) const |
Protected Types | |
enum | { BlockSize } |
Protected Member Functions | |
bool | reverseFlag () const |
HouseholderSequence & | setReverseFlag (bool reverse) |
Protected Attributes | |
CoeffsType::Nested | m_coeffs |
Index | m_length |
bool | m_reverse |
Index | m_shift |
VectorsType::Nested | m_vectors |
Private Types | |
typedef internal::hseq_side_dependent_impl< VectorsType, CoeffsType, Side >::EssentialVectorType | EssentialVectorType |
Sequence of Householder reflections acting on subspaces with decreasing size.
This is defined in the Householder module.
VectorsType | type of matrix containing the Householder vectors |
CoeffsType | type of vector containing the Householder coefficients |
Side | either OnTheLeft (the default) or OnTheRight |
This class represents a product sequence of Householder reflections where the first Householder reflection acts on the whole space, the second Householder reflection leaves the one-dimensional subspace spanned by the first unit vector invariant, the third Householder reflection leaves the two-dimensional subspace spanned by the first two unit vectors invariant, and so on up to the last reflection which leaves all but one dimensions invariant and acts only on the last dimension. Such sequences of Householder reflections are used in several algorithms to zero out certain parts of a matrix. Indeed, the methods HessenbergDecomposition::matrixQ(), Tridiagonalization::matrixQ(), HouseholderQR::householderQ(), and ColPivHouseholderQR::householderQ() all return a HouseholderSequence.
More precisely, the class HouseholderSequence represents an
The last
Typical usages are listed below, where H is a HouseholderSequence:
In addition to the adjoint, you can also apply the inverse (=adjoint), the transpose, and the conjugate operators.
See the documentation for HouseholderSequence(const VectorsType&, const CoeffsType&) for an example.
Definition at line 121 of file HouseholderSequence.h.
typedef HouseholderSequence< VectorsType, std::conditional_t<NumTraits<Scalar>::IsComplex, internal::remove_all_t<typename CoeffsType::ConjugateReturnType>, CoeffsType>, Side > Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::AdjointReturnType |
Definition at line 151 of file HouseholderSequence.h.
typedef HouseholderSequence< std::conditional_t<NumTraits<Scalar>::IsComplex, internal::remove_all_t<typename VectorsType::ConjugateReturnType>, VectorsType>, std::conditional_t<NumTraits<Scalar>::IsComplex, internal::remove_all_t<typename CoeffsType::ConjugateReturnType>, CoeffsType>, Side > Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::ConjugateReturnType |
Definition at line 143 of file HouseholderSequence.h.
typedef HouseholderSequence< std::add_const_t<VectorsType>, std::add_const_t<CoeffsType>, Side > Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::ConstHouseholderSequence |
Definition at line 165 of file HouseholderSequence.h.
|
private |
Definition at line 124 of file HouseholderSequence.h.
typedef internal::traits<HouseholderSequence>::Scalar Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::Scalar |
Definition at line 133 of file HouseholderSequence.h.
typedef HouseholderSequence< std::conditional_t<NumTraits<Scalar>::IsComplex, internal::remove_all_t<typename VectorsType::ConjugateReturnType>, VectorsType>, CoeffsType, Side > Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::TransposeReturnType |
Definition at line 159 of file HouseholderSequence.h.
anonymous enum |
Enumerator | |
---|---|
RowsAtCompileTime | |
ColsAtCompileTime | |
MaxRowsAtCompileTime | |
MaxColsAtCompileTime |
Definition at line 127 of file HouseholderSequence.h.
|
protected |
|
inline |
Constructor.
[in] | v | Matrix containing the essential parts of the Householder vectors |
[in] | h | Vector containing the Householder coefficients |
Constructs the Householder sequence with coefficients given by h
and vectors given by v
. The i-th Householder coefficient h(i)
and the essential part of the i-th Householder vector v(k,i)
with k
> i
(the subdiagonal part of the i-th column). If v
has fewer columns than rows, then the Householder sequence contains as many Householder reflections as there are columns.
v
and h
by reference.Example:
Output:
The matrix v is: 0.68 0.597 -0.33 -0.211 0.823 0.536 0.566 -0.605 -0.444 The first Householder vector is: v_0 = 1 -0.211 0.566 The second Householder vector is: v_1 = 0 1 -0.605 The third Householder vector is: v_2 = 0 0 1 The Householder coefficients are: h = 0.108 -0.0452 0.258 The first Householder reflection is represented by H_0 = 0.892 0.0228 -0.0611 0.0228 0.995 0.0129 -0.0611 0.0129 0.965 The second Householder reflection is represented by H_1 = 1 0 0 0 1.05 -0.0273 0 -0.0273 1.02 The third Householder reflection is represented by H_2 = 1 0 0 0 1 0 0 0 0.742 Their product is H_0 H_1 H_2 = 0.892 0.0255 -0.0466 0.0228 1.04 -0.0105 -0.0611 -0.0129 0.728 If we construct a HouseholderSequence from v and h and convert it to a matrix, we get: 0.892 0.0255 -0.0466 0.0228 1.04 -0.0105 -0.0611 -0.0129 0.728
Definition at line 185 of file HouseholderSequence.h.
|
inline |
|
inline |
Adjoint (conjugate transpose) of the Householder sequence.
Definition at line 268 of file HouseholderSequence.h.
|
inline |
Definition at line 363 of file HouseholderSequence.h.
|
inline |
Definition at line 371 of file HouseholderSequence.h.
|
inline |
Definition at line 343 of file HouseholderSequence.h.
|
inline |
Definition at line 351 of file HouseholderSequence.h.
|
inline |
Number of columns of transformation viewed as a matrix.
This equals the dimension of the space that the transformation acts on.
Definition at line 214 of file HouseholderSequence.h.
|
inline |
Complex conjugate of the Householder sequence.
Definition at line 247 of file HouseholderSequence.h.
|
inline |
*this
if Cond==true, returns *this
otherwise. Definition at line 261 of file HouseholderSequence.h.
|
inline |
Essential part of a Householder vector.
[in] | k | Index of Householder reflection |
This function returns the essential part of the Householder vector
The index k
+ shift(), corresponding to the k-th column of the matrix v
passed to the constructor.
Definition at line 231 of file HouseholderSequence.h.
|
inline |
Definition at line 292 of file HouseholderSequence.h.
|
inline |
Definition at line 282 of file HouseholderSequence.h.
|
inline |
Inverse of the Householder sequence (equals the adjoint).
Definition at line 277 of file HouseholderSequence.h.
|
inline |
Returns the length of the Householder sequence.
Definition at line 483 of file HouseholderSequence.h.
|
inline |
Computes the product of a Householder sequence with a matrix.
[in] | other | Matrix being multiplied. |
This function computes *this
and other
.
Definition at line 438 of file HouseholderSequence.h.
|
inlineprotected |
Definition at line 509 of file HouseholderSequence.h.
|
inline |
Number of rows of transformation viewed as a matrix.
This equals the dimension of the space that the transformation acts on.
Definition at line 207 of file HouseholderSequence.h.
|
inline |
Sets the length of the Householder sequence.
[in] | length | New value for the length. |
By default, the length v
passed to the constructor, or the number of rows if that is smaller. After this function is called, the length equals length
.
Definition at line 458 of file HouseholderSequence.h.
|
inlineprotected |
Definition at line 503 of file HouseholderSequence.h.
|
inline |
Sets the shift of the Householder sequence.
[in] | shift | New value for the shift. |
By default, a HouseholderSequence object represents v
passed to the constructor corresponds to the i-th Householder reflection. After this function is called, the object represents v
corresponds to the (shift+i)-th Householder reflection.
Definition at line 476 of file HouseholderSequence.h.
|
inline |
Returns the shift of the Householder sequence.
Definition at line 486 of file HouseholderSequence.h.
|
inline |
Transpose of the Householder sequence.
Definition at line 238 of file HouseholderSequence.h.
|
protected |
Definition at line 512 of file HouseholderSequence.h.
|
protected |
Definition at line 514 of file HouseholderSequence.h.
|
protected |
Definition at line 513 of file HouseholderSequence.h.
|
protected |
Definition at line 515 of file HouseholderSequence.h.
|
protected |
Definition at line 511 of file HouseholderSequence.h.