Eigen
3.3.9

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 onedimensional subspace spanned by the first unit vector invariant, the third Householder reflection leaves the twodimensional 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 \( n \times n \) matrix \( H \) of the form \( H = \prod_{i=0}^{n1} H_i \) where the ith Householder reflection is \( H_i = I  h_i v_i v_i^* \). The ith Householder coefficient \( h_i \) is a scalar and the ith Householder vector \( v_i \) is a vector of the form
\[ v_i = [\underbrace{0, \ldots, 0}_{i1\mbox{ zeros}}, 1, \underbrace{*, \ldots,*}_{ni\mbox{ arbitrary entries}} ]. \]
The last \( ni \) entries of \( v_i \) are called the essential part of the Householder vector.
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.
Public Member Functions  
ConjugateReturnType  adjoint () const 
Adjoint (conjugate transpose) of the Householder sequence.  
Index  cols () const 
Number of columns of transformation viewed as a matrix. More...  
ConjugateReturnType  conjugate () const 
Complex conjugate of the Householder sequence.  
const EssentialVectorType  essentialVector (Index k) const 
Essential part of a Householder vector. More...  
HouseholderSequence (const HouseholderSequence &other)  
Copy constructor.  
HouseholderSequence (const VectorsType &v, const CoeffsType &h)  
Constructor. More...  
ConjugateReturnType  inverse () const 
Inverse of the Householder sequence (equals the adjoint).  
Index  length () const 
Returns the length of the Householder sequence.  
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...  
Index  rows () const 
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.  
HouseholderSequence  transpose () const 
Transpose of the Householder sequence.  
Public Member Functions inherited from Eigen::EigenBase< HouseholderSequence< VectorsType, CoeffsType, Side > >  
Index  cols () const 
HouseholderSequence< VectorsType, CoeffsType, Side > &  derived () 
const HouseholderSequence< VectorsType, CoeffsType, Side > &  derived () const 
Index  rows () const 
Index  size () const 
Protected Member Functions  
HouseholderSequence &  setTrans (bool trans) 
Sets the transpose flag. More...  
bool  trans () const 
Returns the transpose flag.  
Additional Inherited Members  
Public Types inherited from Eigen::EigenBase< HouseholderSequence< VectorsType, CoeffsType, Side > >  
typedef Eigen::Index  Index 
The interface type of indices. More...  

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 ith Householder coefficient \( h_i \) is given by h(i)
and the essential part of the ith Householder vector \( v_i \) is given by v(k,i)
with k
> i
(the subdiagonal part of the ith 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: 1 0.0827 0.906 0.737 0.0655 0.358 0.511 0.562 0.359 The first Householder vector is: v_0 = 1 0.737 0.511 The second Householder vector is: v_1 = 0 1 0.562 The third Householder vector is: v_2 = 0 0 1 The Householder coefficients are: h = 0.869 0.233 0.0388 The first Householder reflection is represented by H_0 = 0.131 0.641 0.444 0.641 0.528 0.328 0.444 0.328 0.773 The second Householder reflection is represented by H_1 = 1 0 0 0 1.23 0.131 0 0.131 1.07 The third Householder reflection is represented by H_2 = 1 0 0 0 1 0 0 0 0.961 Their product is H_0 H_1 H_2 = 0.131 0.848 0.539 0.641 0.608 0.272 0.444 0.303 0.756 If we construct a HouseholderSequence from v and h and convert it to a matrix, we get: 0.131 0.848 0.539 0.641 0.608 0.272 0.444 0.303 0.756

inline 
Number of columns of transformation viewed as a matrix.

inline 
Essential part of a Householder vector.
[in]  k  Index of Householder reflection 
This function returns the essential part of the Householder vector \( v_i \). This is a vector of length \( ni \) containing the last \( ni \) entries of the vector
\[ v_i = [\underbrace{0, \ldots, 0}_{i1\mbox{ zeros}}, 1, \underbrace{*, \ldots,*}_{ni\mbox{ arbitrary entries}} ]. \]
The index \( i \) equals k
+ shift(), corresponding to the kth column of the matrix v
passed to the constructor.

inline 
Computes the product of a Householder sequence with a matrix.
[in]  other  Matrix being multiplied. 
This function computes \( HM \) where \( H \) is the Householder sequence represented by *this
and \( M \) is the matrix other
.

inline 
Number of rows of transformation viewed as a matrix.

inline 
Sets the length of the Householder sequence.
[in]  length  New value for the length. 
By default, the length \( n \) of the Householder sequence \( H = H_0 H_1 \ldots H_{n1} \) is set to the number of columns of the matrix v
passed to the constructor, or the number of rows if that is smaller. After this function is called, the length equals length
.

inline 
Sets the shift of the Householder sequence.
[in]  shift  New value for the shift. 
By default, a HouseholderSequence object represents \( H = H_0 H_1 \ldots H_{n1} \) and the ith column of the matrix v
passed to the constructor corresponds to the ith Householder reflection. After this function is called, the object represents \( H = H_{\mathrm{shift}} H_{\mathrm{shift}+1} \ldots H_{n1} \) and the ith column of v
corresponds to the (shift+i)th Householder reflection.

inlineprotected 
Sets the transpose flag.
[in]  trans  New value of the transpose flag. 
By default, the transpose flag is not set. If the transpose flag is set, then this object represents \( H^T = H_{n1}^T \ldots H_1^T H_0^T \) instead of \( H = H_0 H_1 \ldots H_{n1} \).