WPILibC++ 2023.4.3
Eigen::HouseholderSequence< VectorsType, CoeffsType, Side > Class Template Reference

\householder_module More...

#include </home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Householder/HouseholderSequence.h>

Inheritance diagram for Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >:
Eigen::EigenBase< HouseholderSequence< VectorsType, CoeffsType, Side > >

Public Types

enum  { RowsAtCompileTime = internal::traits<HouseholderSequence>::RowsAtCompileTime , ColsAtCompileTime = internal::traits<HouseholderSequence>::ColsAtCompileTime , MaxRowsAtCompileTime = internal::traits<HouseholderSequence>::MaxRowsAtCompileTime , MaxColsAtCompileTime = internal::traits<HouseholderSequence>::MaxColsAtCompileTime }
 
typedef internal::traits< HouseholderSequence >::Scalar Scalar
 
typedef HouseholderSequence< typename internal::conditional< NumTraits< Scalar >::IsComplex, typename internal::remove_all< typename VectorsType::ConjugateReturnType >::type, VectorsType >::type, typename internal::conditional< NumTraits< Scalar >::IsComplex, typename internal::remove_all< typename CoeffsType::ConjugateReturnType >::type, CoeffsType >::type, Side > ConjugateReturnType
 
typedef HouseholderSequence< VectorsType, typename internal::conditional< NumTraits< Scalar >::IsComplex, typename internal::remove_all< typename CoeffsType::ConjugateReturnType >::type, CoeffsType >::type, Side > AdjointReturnType
 
typedef HouseholderSequence< typename internal::conditional< NumTraits< Scalar >::IsComplex, typename internal::remove_all< typename VectorsType::ConjugateReturnType >::type, VectorsType >::type, CoeffsType, Side > TransposeReturnType
 
typedef HouseholderSequence< typename internal::add_const< VectorsType >::type, typename internal::add_const< CoeffsType >::type, Side > ConstHouseholderSequence
 
- Public Types inherited from Eigen::EigenBase< HouseholderSequence< VectorsType, CoeffsType, Side > >
typedef Eigen::Index Index
 The interface type of indices. More...
 
typedef internal::traits< HouseholderSequence< VectorsType, CoeffsType, Side > >::StorageKind StorageKind
 

Public Member Functions

EIGEN_DEVICE_FUNC HouseholderSequence (const VectorsType &v, const CoeffsType &h)
 Constructor. More...
 
EIGEN_DEVICE_FUNC HouseholderSequence (const HouseholderSequence &other)
 Copy constructor. More...
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 Number of rows of transformation viewed as a matrix. More...
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 Number of columns of transformation viewed as a matrix. More...
 
EIGEN_DEVICE_FUNC const EssentialVectorType essentialVector (Index k) const
 Essential part of a Householder vector. More...
 
TransposeReturnType transpose () const
 Transpose of the Householder sequence. More...
 
ConjugateReturnType conjugate () const
 Complex conjugate of the Householder sequence. More...
 
template<bool Cond>
EIGEN_DEVICE_FUNC internal::conditional< Cond, ConjugateReturnType, ConstHouseholderSequence >::type conjugateIf () const
 
AdjointReturnType adjoint () const
 Adjoint (conjugate transpose) of the Householder sequence. More...
 
AdjointReturnType inverse () const
 Inverse of the Householder sequence (equals the adjoint). More...
 
template<typename DestType >
EIGEN_DEVICE_FUNC void evalTo (DestType &dst) const
 
template<typename Dest , typename Workspace >
EIGEN_DEVICE_FUNC void evalTo (Dest &dst, Workspace &workspace) const
 
template<typename Dest >
void applyThisOnTheRight (Dest &dst) const
 
template<typename Dest , typename Workspace >
void applyThisOnTheRight (Dest &dst, Workspace &workspace) const
 
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 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_DEVICE_FUNC HouseholderSequencesetLength (Index length)
 Sets the length of the Householder sequence. More...
 
EIGEN_DEVICE_FUNC HouseholderSequencesetShift (Index shift)
 Sets the shift of the Householder sequence. More...
 
EIGEN_DEVICE_FUNC Index length () const
 Returns the length of the Householder sequence. More...
 
EIGEN_DEVICE_FUNC Index shift () const
 Returns the shift of the Householder sequence. More...
 
- Public Member Functions inherited from Eigen::EigenBase< HouseholderSequence< VectorsType, CoeffsType, Side > >
EIGEN_DEVICE_FUNC HouseholderSequence< VectorsType, CoeffsType, Side > & derived ()
 
EIGEN_DEVICE_FUNC const HouseholderSequence< VectorsType, CoeffsType, Side > & derived () const
 
EIGEN_DEVICE_FUNC HouseholderSequence< VectorsType, CoeffsType, Side > & const_cast_derived () const
 
EIGEN_DEVICE_FUNC const HouseholderSequence< VectorsType, CoeffsType, Side > & const_derived () const
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC void evalTo (Dest &dst) const
 
EIGEN_DEVICE_FUNC void addTo (Dest &dst) const
 
EIGEN_DEVICE_FUNC void subTo (Dest &dst) const
 
EIGEN_DEVICE_FUNC void applyThisOnTheRight (Dest &dst) const
 
EIGEN_DEVICE_FUNC void applyThisOnTheLeft (Dest &dst) const
 

Protected Types

enum  { BlockSize = 48 }
 

Protected Member Functions

HouseholderSequencesetReverseFlag (bool reverse)
 
bool reverseFlag () const
 

Protected Attributes

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

Friends

template<typename _VectorsType , typename _CoeffsType , int _Side>
struct internal::hseq_side_dependent_impl
 
template<typename VectorsType2 , typename CoeffsType2 , int Side2>
class HouseholderSequence
 

Detailed Description

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

\householder_module

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()

Member Typedef Documentation

◆ AdjointReturnType

template<typename VectorsType , typename CoeffsType , int Side>
typedef HouseholderSequence< VectorsType, typename internal::conditional<NumTraits<Scalar>::IsComplex, typename internal::remove_all<typename CoeffsType::ConjugateReturnType>::type, CoeffsType>::type, Side > Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::AdjointReturnType

◆ ConjugateReturnType

template<typename VectorsType , typename CoeffsType , int Side>
typedef HouseholderSequence< typename internal::conditional<NumTraits<Scalar>::IsComplex, typename internal::remove_all<typename VectorsType::ConjugateReturnType>::type, VectorsType>::type, typename internal::conditional<NumTraits<Scalar>::IsComplex, typename internal::remove_all<typename CoeffsType::ConjugateReturnType>::type, CoeffsType>::type, Side > Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::ConjugateReturnType

◆ ConstHouseholderSequence

template<typename VectorsType , typename CoeffsType , int Side>
typedef HouseholderSequence< typename internal::add_const<VectorsType>::type, typename internal::add_const<CoeffsType>::type, Side > Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::ConstHouseholderSequence

◆ Scalar

template<typename VectorsType , typename CoeffsType , int Side>
typedef internal::traits<HouseholderSequence>::Scalar Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::Scalar

◆ TransposeReturnType

template<typename VectorsType , typename CoeffsType , int Side>
typedef HouseholderSequence< typename internal::conditional<NumTraits<Scalar>::IsComplex, typename internal::remove_all<typename VectorsType::ConjugateReturnType>::type, VectorsType>::type, CoeffsType, Side > Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::TransposeReturnType

Member Enumeration Documentation

◆ anonymous enum

template<typename VectorsType , typename CoeffsType , int Side>
anonymous enum
Enumerator
RowsAtCompileTime 
ColsAtCompileTime 
MaxRowsAtCompileTime 
MaxColsAtCompileTime 

◆ anonymous enum

template<typename VectorsType , typename CoeffsType , int Side>
anonymous enum
protected
Enumerator
BlockSize 

Constructor & Destructor Documentation

◆ HouseholderSequence() [1/2]

template<typename VectorsType , typename CoeffsType , int Side>
EIGEN_DEVICE_FUNC Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::HouseholderSequence ( const VectorsType &  v,
const CoeffsType &  h 
)
inline

Constructor.

Parameters
[in]vMatrix containing the essential parts of the Householder vectors
[in]hVector 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 \) is given by h(i) and the essential part of the i-th Householder vector \( v_i \) is given by 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.

Note
The HouseholderSequence object stores v and h by reference.

Example:

Output:

See also
setLength(), setShift()

◆ HouseholderSequence() [2/2]

template<typename VectorsType , typename CoeffsType , int Side>
EIGEN_DEVICE_FUNC Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::HouseholderSequence ( const HouseholderSequence< VectorsType, CoeffsType, Side > &  other)
inline

Copy constructor.

Member Function Documentation

◆ adjoint()

template<typename VectorsType , typename CoeffsType , int Side>
AdjointReturnType Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::adjoint ( ) const
inline

Adjoint (conjugate transpose) of the Householder sequence.

◆ applyThisOnTheLeft() [1/2]

template<typename VectorsType , typename CoeffsType , int Side>
template<typename Dest >
void Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::applyThisOnTheLeft ( Dest &  dst,
bool  inputIsIdentity = false 
) const
inline

◆ applyThisOnTheLeft() [2/2]

template<typename VectorsType , typename CoeffsType , int Side>
template<typename Dest , typename Workspace >
void Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::applyThisOnTheLeft ( Dest &  dst,
Workspace &  workspace,
bool  inputIsIdentity = false 
) const
inline

◆ applyThisOnTheRight() [1/2]

template<typename VectorsType , typename CoeffsType , int Side>
template<typename Dest >
void Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::applyThisOnTheRight ( Dest &  dst) const
inline

◆ applyThisOnTheRight() [2/2]

template<typename VectorsType , typename CoeffsType , int Side>
template<typename Dest , typename Workspace >
void Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::applyThisOnTheRight ( Dest &  dst,
Workspace &  workspace 
) const
inline

◆ cols()

template<typename VectorsType , typename CoeffsType , int Side>
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::cols ( void  ) const
inline

Number of columns of transformation viewed as a matrix.

Returns
Number of columns

This equals the dimension of the space that the transformation acts on.

◆ conjugate()

template<typename VectorsType , typename CoeffsType , int Side>
ConjugateReturnType Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::conjugate ( ) const
inline

Complex conjugate of the Householder sequence.

◆ conjugateIf()

template<typename VectorsType , typename CoeffsType , int Side>
template<bool Cond>
EIGEN_DEVICE_FUNC internal::conditional< Cond, ConjugateReturnType, ConstHouseholderSequence >::type Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::conjugateIf ( ) const
inline
Returns
an expression of the complex conjugate of *this if Cond==true, returns *this otherwise.

◆ essentialVector()

template<typename VectorsType , typename CoeffsType , int Side>
EIGEN_DEVICE_FUNC const EssentialVectorType Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::essentialVector ( Index  k) const
inline

Essential part of a Householder vector.

Parameters
[in]kIndex of Householder reflection
Returns
Vector containing non-trivial entries of k-th Householder vector

This function returns the essential part of the Householder vector \( v_i \). This is a vector of length \( n-i \) containing the last \( n-i \) entries of the vector

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

The index \( i \) equals k + shift(), corresponding to the k-th column of the matrix v passed to the constructor.

See also
setShift(), shift()

◆ evalTo() [1/2]

template<typename VectorsType , typename CoeffsType , int Side>
template<typename Dest , typename Workspace >
EIGEN_DEVICE_FUNC void Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::evalTo ( Dest &  dst,
Workspace &  workspace 
) const
inline

◆ evalTo() [2/2]

template<typename VectorsType , typename CoeffsType , int Side>
template<typename DestType >
EIGEN_DEVICE_FUNC void Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::evalTo ( DestType &  dst) const
inline

◆ inverse()

template<typename VectorsType , typename CoeffsType , int Side>
AdjointReturnType Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::inverse ( ) const
inline

Inverse of the Householder sequence (equals the adjoint).

◆ length()

template<typename VectorsType , typename CoeffsType , int Side>
EIGEN_DEVICE_FUNC Index Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::length ( ) const
inline

Returns the length of the Householder sequence.

◆ operator*()

template<typename VectorsType , typename CoeffsType , int Side>
template<typename OtherDerived >
internal::matrix_type_times_scalar_type< Scalar, OtherDerived >::Type Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::operator* ( const MatrixBase< OtherDerived > &  other) const
inline

Computes the product of a Householder sequence with a matrix.

Parameters
[in]otherMatrix being multiplied.
Returns
Expression object representing the product.

This function computes \( HM \) where \( H \) is the Householder sequence represented by *this and \( M \) is the matrix other.

◆ reverseFlag()

template<typename VectorsType , typename CoeffsType , int Side>
bool Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::reverseFlag ( ) const
inlineprotected

◆ rows()

template<typename VectorsType , typename CoeffsType , int Side>
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::rows ( void  ) const
inline

Number of rows of transformation viewed as a matrix.

Returns
Number of rows

This equals the dimension of the space that the transformation acts on.

◆ setLength()

template<typename VectorsType , typename CoeffsType , int Side>
EIGEN_DEVICE_FUNC HouseholderSequence & Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::setLength ( Index  length)
inline

Sets the length of the Householder sequence.

Parameters
[in]lengthNew value for the length.

By default, the length \( n \) of the Householder sequence \( H = H_0 H_1 \ldots H_{n-1} \) 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.

See also
length()

◆ setReverseFlag()

template<typename VectorsType , typename CoeffsType , int Side>
HouseholderSequence & Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::setReverseFlag ( bool  reverse)
inlineprotected

◆ setShift()

template<typename VectorsType , typename CoeffsType , int Side>
EIGEN_DEVICE_FUNC HouseholderSequence & Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::setShift ( Index  shift)
inline

Sets the shift of the Householder sequence.

Parameters
[in]shiftNew value for the shift.

By default, a HouseholderSequence object represents \( H = H_0 H_1 \ldots H_{n-1} \) and the i-th column of the matrix v passed to the constructor corresponds to the i-th Householder reflection. After this function is called, the object represents \( H = H_{\mathrm{shift}} H_{\mathrm{shift}+1} \ldots H_{n-1} \) and the i-th column of v corresponds to the (shift+i)-th Householder reflection.

See also
shift()

◆ shift()

template<typename VectorsType , typename CoeffsType , int Side>
EIGEN_DEVICE_FUNC Index Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::shift ( ) const
inline

Returns the shift of the Householder sequence.

◆ transpose()

template<typename VectorsType , typename CoeffsType , int Side>
TransposeReturnType Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::transpose ( ) const
inline

Transpose of the Householder sequence.

Friends And Related Function Documentation

◆ HouseholderSequence

template<typename VectorsType , typename CoeffsType , int Side>
template<typename VectorsType2 , typename CoeffsType2 , int Side2>
friend class HouseholderSequence
friend

◆ internal::hseq_side_dependent_impl

template<typename VectorsType , typename CoeffsType , int Side>
template<typename _VectorsType , typename _CoeffsType , int _Side>
friend struct internal::hseq_side_dependent_impl
friend

Member Data Documentation

◆ m_coeffs

template<typename VectorsType , typename CoeffsType , int Side>
CoeffsType::Nested Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_coeffs
protected

◆ m_length

template<typename VectorsType , typename CoeffsType , int Side>
Index Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_length
protected

◆ m_reverse

template<typename VectorsType , typename CoeffsType , int Side>
bool Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_reverse
protected

◆ m_shift

template<typename VectorsType , typename CoeffsType , int Side>
Index Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_shift
protected

◆ m_vectors

template<typename VectorsType , typename CoeffsType , int Side>
VectorsType::Nested Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_vectors
protected

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