Logo Search packages:      
Sourcecode: eigen3 version File versions  Download package

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Friends

HouseholderSequence< VectorsType, CoeffsType, Side > Class Template Reference

Sequence of Householder reflections acting on subspaces with decreasing size. More...

#include <HouseholderSequence.h>

Inheritance diagram for HouseholderSequence< VectorsType, CoeffsType, Side >:
Inheritance graph
Collaboration diagram for HouseholderSequence< VectorsType, CoeffsType, Side >:
Collaboration graph

List of all members.

Public Types

typedef HouseholderSequence
< VectorsType, typename
< NumTraits< Scalar >
::IsComplex, typename
internal::remove_all< typename
CoeffsType::ConjugateReturnType >
::type, CoeffsType >::type,
Side > 
typedef internal::traits
< HouseholderSequence
< VectorsType, CoeffsType,
Side > >::StorageKind 

Public Member Functions

void addTo (Dest &dst) const
ConjugateReturnType adjoint () const
 Adjoint (conjugate transpose) of the Householder sequence.
template<typename Dest >
void applyThisOnTheLeft (Dest &dst) const
template<typename Dest >
void applyThisOnTheRight (Dest &dst) const
Index cols () const
 Number of columns of transformation viewed as a matrix.
ConjugateReturnType conjugate () const
 Complex conjugate of the Householder sequence.
< VectorsType, CoeffsType,
Side > & 
const_cast_derived () const
const HouseholderSequence
< VectorsType, CoeffsType,
Side > & 
const_derived () const
< VectorsType, CoeffsType,
Side > & 
derived ()
const HouseholderSequence
< VectorsType, CoeffsType,
Side > & 
derived () const
const EssentialVectorType essentialVector (Index k) const
 Essential part of a Householder vector.
void evalTo (Dest &dst) const
template<typename DestType >
void evalTo (DestType &dst) const
 HouseholderSequence (const HouseholderSequence &other)
 Copy constructor.
 HouseholderSequence (const VectorsType &v, const CoeffsType &h)
ConjugateReturnType inverse () const
 Inverse of the Householder sequence (equals the adjoint).
Index length () const
 Returns the length of the Householder sequence.
template<typename OtherDerived >
< Scalar, OtherDerived >::Type 
operator* (const MatrixBase< OtherDerived > &other) const
 Computes the product of a Householder sequence with a matrix.
Index rows () const
 Number of rows of transformation viewed as a matrix.
HouseholderSequencesetLength (Index length)
 Sets the length of the Householder sequence.
HouseholderSequencesetShift (Index shift)
 Sets the shift of the Householder sequence.
Index shift () const
 Returns the shift of the Householder sequence.
Index size () const
void subTo (Dest &dst) const
HouseholderSequence transpose () const
 Transpose of the Householder sequence.

Protected Member Functions

HouseholderSequencesetTrans (bool trans)
 Sets the transpose flag.
bool trans () const
 Returns the transpose flag.

Protected Attributes

CoeffsType::Nested m_coeffs
Index m_length
Index m_shift
bool m_trans
VectorsType::Nested m_vectors

Private Types

enum  { RowsAtCompileTime = internal::traits<HouseholderSequence>::RowsAtCompileTime, ColsAtCompileTime = internal::traits<HouseholderSequence>::ColsAtCompileTime, MaxRowsAtCompileTime = internal::traits<HouseholderSequence>::MaxRowsAtCompileTime, MaxColsAtCompileTime = internal::traits<HouseholderSequence>::MaxColsAtCompileTime }
< VectorsType, CoeffsType,
Side >::EssentialVectorType 
typedef VectorsType::Index Index
typedef internal::traits
< HouseholderSequence >


class HouseholderSequence
struct internal::hseq_side_dependent_impl

Detailed Description

template<typename VectorsType, typename CoeffsType, int Side>
class HouseholderSequence< VectorsType, CoeffsType, Side >

Sequence of Householder reflections acting on subspaces with decreasing size.

Template Parameters:
VectorsTypetype of matrix containing the Householder vectors
CoeffsTypetype of vector containing the Householder coefficients
Sideeither 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 $ n \times n $ matrix $ H $ of the form $ H = \prod_{i=0}^{n-1} H_i $ where the i-th Householder reflection is $ H_i = I - h_i v_i v_i^* $. The i-th Householder coefficient $ h_i $ is a scalar and the i-th Householder vector $ v_i $ is a vector of the form

\[ v_i = [\underbrace{0, \ldots, 0}_{i-1\mbox{ zeros}}, 1, \underbrace{*, \ldots,*}_{n-i\mbox{ arbitrary entries}} ]. \]

The last $ n-i $ entries of $ v_i $ are called the essential part of the Householder vector.

Typical usages are listed below, where H is a HouseholderSequence:

 A.applyOnTheRight(H);             // A = A * H
 A.applyOnTheLeft(H);              // A = H * A
 A.applyOnTheRight(H.adjoint());   // A = A * H^*
 A.applyOnTheLeft(H.adjoint());    // A = H^* * A
 MatrixXd Q = H;                   // conversion to a dense matrix

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.

See also:
MatrixBase::applyOnTheLeft(), MatrixBase::applyOnTheRight()

Definition at line 125 of file HouseholderSequence.h.

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index