Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Eigen::HouseholderSequence< VectorsType, CoeffsType, Side > Class Template Reference

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

#include <src/eigen/Eigen/src/Householder/HouseholderSequence.h>

+ Inheritance diagram for Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >:
+ Collaboration diagram for Eigen::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 Eigen::Index Index
 The interface type of indices.
 
typedef internal::traits< HouseholderSequence< VectorsType, CoeffsType, Side > >::StorageKind StorageKind
 

Public Member Functions

 HouseholderSequence (const VectorsType &v, const CoeffsType &h)
 Constructor.
 
 HouseholderSequence (const HouseholderSequence &other)
 Copy constructor.
 
Index rows () const
 Number of rows of transformation viewed as a matrix.
 
Index cols () const
 Number of columns of transformation viewed as a matrix.
 
const EssentialVectorType essentialVector (Index k) const
 Essential part of a Householder vector.
 
HouseholderSequence transpose () const
 Transpose of the Householder sequence.
 
ConjugateReturnType conjugate () const
 Complex conjugate of the Householder sequence.
 
ConjugateReturnType adjoint () const
 Adjoint (conjugate transpose) of the Householder sequence.
 
ConjugateReturnType inverse () const
 Inverse of the Householder sequence (equals the adjoint).
 
template<typename DestType >
void evalTo (DestType &dst) const
 
template<typename Dest , typename Workspace >
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) const
 
template<typename Dest , typename Workspace >
void applyThisOnTheLeft (Dest &dst, Workspace &workspace) 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.
 
HouseholderSequencesetLength (Index length)
 Sets the length of the Householder sequence.
 
HouseholderSequencesetShift (Index shift)
 Sets the shift of the Householder sequence.
 
Index length () const
 Returns the length of the Householder sequence.
 
Index shift () const
 Returns the shift of the Householder sequence.
 
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 Index size () const
 
EIGEN_DEVICE_FUNC void evalTo (Dest &dst) const
 
EIGEN_DEVICE_FUNC void addTo (Dest &dst) const
 
EIGEN_DEVICE_FUNC void subTo (Dest &dst) const
 

Protected Member Functions

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

Protected Attributes

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

Private Types

typedef internal::hseq_side_dependent_impl< VectorsType, CoeffsType, Side >::EssentialVectorType EssentialVectorType
 

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 >

Sequence of Householder reflections acting on subspaces with decreasing size.

\householder_module

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

◆ 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

◆ EssentialVectorType

template<typename VectorsType , typename CoeffsType , int Side>
typedef internal::hseq_side_dependent_impl<VectorsType,CoeffsType,Side>::EssentialVectorType Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::EssentialVectorType
private

◆ Index

typedef Eigen::Index Eigen::EigenBase< HouseholderSequence< VectorsType, CoeffsType, Side > >::Index
inherited

The interface type of indices.

To change this, #define the preprocessor symbol EIGEN_DEFAULT_DENSE_INDEX_TYPE.

See also
StorageIndex, TopicPreprocessorDirectives.

◆ Scalar

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

◆ StorageKind

typedef internal::traits<HouseholderSequence< VectorsType, CoeffsType, Side > >::StorageKind Eigen::EigenBase< HouseholderSequence< VectorsType, CoeffsType, Side > >::StorageKind
inherited

Member Enumeration Documentation

◆ anonymous enum

template<typename VectorsType , typename CoeffsType , int Side>
anonymous enum
Enumerator
RowsAtCompileTime 
ColsAtCompileTime 
MaxRowsAtCompileTime 
MaxColsAtCompileTime 
125 {
126 RowsAtCompileTime = internal::traits<HouseholderSequence>::RowsAtCompileTime,
127 ColsAtCompileTime = internal::traits<HouseholderSequence>::ColsAtCompileTime,
128 MaxRowsAtCompileTime = internal::traits<HouseholderSequence>::MaxRowsAtCompileTime,
129 MaxColsAtCompileTime = internal::traits<HouseholderSequence>::MaxColsAtCompileTime
130 };
@ ColsAtCompileTime
Definition HouseholderSequence.h:127
@ MaxColsAtCompileTime
Definition HouseholderSequence.h:129
@ MaxRowsAtCompileTime
Definition HouseholderSequence.h:128
@ RowsAtCompileTime
Definition HouseholderSequence.h:126

Constructor & Destructor Documentation

◆ HouseholderSequence() [1/2]

template<typename VectorsType , typename CoeffsType , int Side>
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()
161 : m_vectors(v), m_coeffs(h), m_trans(false), m_length(v.diagonalSize()),
162 m_shift(0)
163 {
164 }
Index m_length
Definition HouseholderSequence.h:425
bool m_trans
Definition HouseholderSequence.h:424
CoeffsType::Nested m_coeffs
Definition HouseholderSequence.h:423
VectorsType::Nested m_vectors
Definition HouseholderSequence.h:422
Index m_shift
Definition HouseholderSequence.h:426

◆ HouseholderSequence() [2/2]

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

Copy constructor.

168 : m_vectors(other.m_vectors),
169 m_coeffs(other.m_coeffs),
170 m_trans(other.m_trans),
171 m_length(other.m_length),
172 m_shift(other.m_shift)
173 {
174 }

Member Function Documentation

◆ addTo()

EIGEN_DEVICE_FUNC void Eigen::EigenBase< HouseholderSequence< VectorsType, CoeffsType, Side > >::addTo ( Dest &  dst) const
inlineinherited
78 {
79 // This is the default implementation,
80 // derived class can reimplement it in a more optimized way.
81 typename Dest::PlainObject res(rows(),cols());
82 evalTo(res);
83 dst += res;
84 }
EIGEN_DEVICE_FUNC Index cols() const
Definition EigenBase.h:62
EIGEN_DEVICE_FUNC Index rows() const
Definition EigenBase.h:59
EIGEN_DEVICE_FUNC void evalTo(Dest &dst) const
Definition EigenBase.h:71

◆ adjoint()

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

Adjoint (conjugate transpose) of the Householder sequence.

225 {
226 return conjugate().setTrans(!m_trans);
227 }
HouseholderSequence & setTrans(bool trans)
Sets the transpose flag.
Definition HouseholderSequence.h:414
ConjugateReturnType conjugate() const
Complex conjugate of the Householder sequence.
Definition HouseholderSequence.h:215

References Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::conjugate(), Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_trans, and Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::setTrans().

Referenced by Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::inverse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyThisOnTheLeft() [1/2]

template<typename VectorsType , typename CoeffsType , int Side>
template<typename Dest >
void Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::applyThisOnTheLeft ( Dest &  dst) const
inline
306 {
307 Matrix<Scalar,1,Dest::ColsAtCompileTime,RowMajor,1,Dest::MaxColsAtCompileTime> workspace;
308 applyThisOnTheLeft(dst, workspace);
309 }
void applyThisOnTheLeft(Dest &dst) const
Definition HouseholderSequence.h:305

References Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::applyThisOnTheLeft().

Referenced by Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::applyThisOnTheLeft(), and Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::operator*().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 
) const
inline
314 {
315 const Index BlockSize = 48;
316 // if the entries are large enough, then apply the reflectors by block
317 if(m_length>=BlockSize && dst.cols()>1)
318 {
319 for(Index i = 0; i < m_length; i+=BlockSize)
320 {
321 Index end = m_trans ? (std::min)(m_length,i+BlockSize) : m_length-i;
322 Index k = m_trans ? i : (std::max)(Index(0),end-BlockSize);
323 Index bs = end-k;
324 Index start = k + m_shift;
325
326 typedef Block<typename internal::remove_all<VectorsType>::type,Dynamic,Dynamic> SubVectorsType;
327 SubVectorsType sub_vecs1(m_vectors.const_cast_derived(), Side==OnTheRight ? k : start,
328 Side==OnTheRight ? start : k,
329 Side==OnTheRight ? bs : m_vectors.rows()-start,
330 Side==OnTheRight ? m_vectors.cols()-start : bs);
331 typename internal::conditional<Side==OnTheRight, Transpose<SubVectorsType>, SubVectorsType&>::type sub_vecs(sub_vecs1);
332 Block<Dest,Dynamic,Dynamic> sub_dst(dst,dst.rows()-rows()+m_shift+k,0, rows()-m_shift-k,dst.cols());
333 apply_block_householder_on_the_left(sub_dst, sub_vecs, m_coeffs.segment(k, bs), !m_trans);
334 }
335 }
336 else
337 {
338 workspace.resize(dst.cols());
339 for(Index k = 0; k < m_length; ++k)
340 {
341 Index actual_k = m_trans ? k : m_length-k-1;
342 dst.bottomRows(rows()-m_shift-actual_k)
343 .applyHouseholderOnTheLeft(essentialVector(actual_k), m_coeffs.coeff(actual_k), workspace.data());
344 }
345 }
346 }
Index rows() const
Number of rows of transformation viewed as a matrix.
Definition HouseholderSequence.h:180
const EssentialVectorType essentialVector(Index k) const
Essential part of a Householder vector.
Definition HouseholderSequence.h:202
Index cols() const
Number of columns of transformation viewed as a matrix.
Definition HouseholderSequence.h:186
@ OnTheRight
Definition Constants.h:335
void apply_block_householder_on_the_left(MatrixType &mat, const VectorsType &vectors, const CoeffsType &hCoeffs, bool forward)
Definition BlockHouseholder.h:79
T * end(Slic3r::Mat< N, M, T > &mat)
Definition Point.hpp:608
const int Dynamic
Definition Constants.h:21
Eigen::Index Index
The interface type of indices.
Definition EigenBase.h:38

References Eigen::Dynamic, Eigen::end(), Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::essentialVector(), Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_coeffs, Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_length, Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_shift, Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_trans, Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_vectors, Eigen::OnTheRight, and Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::rows().

+ Here is the call graph for this function:

◆ applyThisOnTheRight() [1/2]

template<typename VectorsType , typename CoeffsType , int Side>
template<typename Dest >
void Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::applyThisOnTheRight ( Dest &  dst) const
inline
286 {
287 Matrix<Scalar,1,Dest::RowsAtCompileTime,RowMajor,1,Dest::MaxRowsAtCompileTime> workspace(dst.rows());
288 applyThisOnTheRight(dst, workspace);
289 }
void applyThisOnTheRight(Dest &dst) const
Definition HouseholderSequence.h:285

References Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::applyThisOnTheRight().

Referenced by Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::applyThisOnTheRight(), and Eigen::operator*().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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
294 {
295 workspace.resize(dst.rows());
296 for(Index k = 0; k < m_length; ++k)
297 {
298 Index actual_k = m_trans ? m_length-k-1 : k;
299 dst.rightCols(rows()-m_shift-actual_k)
300 .applyHouseholderOnTheRight(essentialVector(actual_k), m_coeffs.coeff(actual_k), workspace.data());
301 }
302 }

References Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::essentialVector(), Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_coeffs, Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_length, Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_shift, Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_trans, and Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::rows().

+ Here is the call graph for this function:

◆ cols()

template<typename VectorsType , typename CoeffsType , int Side>
Index Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::cols ( ) 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.

186{ return rows(); }

References Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::rows().

Referenced by Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::evalTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ conjugate()

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

Complex conjugate of the Householder sequence.

216 {
217 return ConjugateReturnType(m_vectors.conjugate(), m_coeffs.conjugate())
218 .setTrans(m_trans)
219 .setLength(m_length)
220 .setShift(m_shift);
221 }
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
Definition HouseholderSequence.h:141

References Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_coeffs, Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_length, Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_shift, Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_trans, and Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_vectors.

Referenced by Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::adjoint().

+ Here is the caller graph for this function:

◆ const_cast_derived()

EIGEN_DEVICE_FUNC HouseholderSequence< VectorsType, CoeffsType, Side > & Eigen::EigenBase< HouseholderSequence< VectorsType, CoeffsType, Side > >::const_cast_derived ( ) const
inlineinherited
52 { return *static_cast<Derived*>(const_cast<EigenBase*>(this)); }

◆ const_derived()

EIGEN_DEVICE_FUNC const HouseholderSequence< VectorsType, CoeffsType, Side > & Eigen::EigenBase< HouseholderSequence< VectorsType, CoeffsType, Side > >::const_derived ( ) const
inlineinherited
55 { return *static_cast<const Derived*>(this); }

◆ derived() [1/2]

EIGEN_DEVICE_FUNC HouseholderSequence< VectorsType, CoeffsType, Side > & Eigen::EigenBase< HouseholderSequence< VectorsType, CoeffsType, Side > >::derived ( )
inlineinherited
Returns
a reference to the derived object
45{ return *static_cast<Derived*>(this); }

◆ derived() [2/2]

EIGEN_DEVICE_FUNC const HouseholderSequence< VectorsType, CoeffsType, Side > & Eigen::EigenBase< HouseholderSequence< VectorsType, CoeffsType, Side > >::derived ( ) const
inlineinherited
Returns
a const reference to the derived object
48{ return *static_cast<const Derived*>(this); }

◆ essentialVector()

template<typename VectorsType , typename CoeffsType , int Side>
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()
203 {
204 eigen_assert(k >= 0 && k < m_length);
206 }
#define eigen_assert(x)
Definition Macros.h:579
static const EssentialVectorType essentialVector(const HouseholderSequenceType &h, Index k)
Definition HouseholderSequence.h:90

References eigen_assert, Eigen::internal::hseq_side_dependent_impl< VectorsType, CoeffsType, Side >::essentialVector(), and Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_length.

Referenced by Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::applyThisOnTheLeft(), Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::applyThisOnTheRight(), and Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::evalTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ evalTo() [1/3]

EIGEN_DEVICE_FUNC void Eigen::EigenBase< HouseholderSequence< VectorsType, CoeffsType, Side > >::evalTo ( Dest &  dst) const
inlineinherited
72 { derived().evalTo(dst); }
EIGEN_DEVICE_FUNC HouseholderSequence< VectorsType, CoeffsType, Side > & derived()
Definition EigenBase.h:45

◆ evalTo() [2/3]

template<typename VectorsType , typename CoeffsType , int Side>
template<typename Dest , typename Workspace >
void Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::evalTo ( Dest &  dst,
Workspace &  workspace 
) const
inline
243 {
244 workspace.resize(rows());
245 Index vecs = m_length;
247 {
248 // in-place
249 dst.diagonal().setOnes();
250 dst.template triangularView<StrictlyUpper>().setZero();
251 for(Index k = vecs-1; k >= 0; --k)
252 {
253 Index cornerSize = rows() - k - m_shift;
254 if(m_trans)
255 dst.bottomRightCorner(cornerSize, cornerSize)
256 .applyHouseholderOnTheRight(essentialVector(k), m_coeffs.coeff(k), workspace.data());
257 else
258 dst.bottomRightCorner(cornerSize, cornerSize)
259 .applyHouseholderOnTheLeft(essentialVector(k), m_coeffs.coeff(k), workspace.data());
260
261 // clear the off diagonal vector
262 dst.col(k).tail(rows()-k-1).setZero();
263 }
264 // clear the remaining columns if needed
265 for(Index k = 0; k<cols()-vecs ; ++k)
266 dst.col(k).tail(rows()-k-1).setZero();
267 }
268 else
269 {
270 dst.setIdentity(rows(), rows());
271 for(Index k = vecs-1; k >= 0; --k)
272 {
273 Index cornerSize = rows() - k - m_shift;
274 if(m_trans)
275 dst.bottomRightCorner(cornerSize, cornerSize)
276 .applyHouseholderOnTheRight(essentialVector(k), m_coeffs.coeff(k), &workspace.coeffRef(0));
277 else
278 dst.bottomRightCorner(cornerSize, cornerSize)
279 .applyHouseholderOnTheLeft(essentialVector(k), m_coeffs.coeff(k), &workspace.coeffRef(0));
280 }
281 }
282 }
bool is_same_dense(const T1 &mat1, const T2 &mat2, typename enable_if< has_direct_access< T1 >::ret &&has_direct_access< T2 >::ret, T1 >::type *=0)
Definition XprHelper.h:661

References Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::cols(), Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::essentialVector(), Eigen::internal::is_same_dense(), Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_coeffs, Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_length, Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_shift, Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_trans, Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_vectors, and Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::rows().

+ Here is the call graph for this function:

◆ evalTo() [3/3]

template<typename VectorsType , typename CoeffsType , int Side>
template<typename DestType >
void Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::evalTo ( DestType &  dst) const
inline
234 {
235 Matrix<Scalar, DestType::RowsAtCompileTime, 1,
236 AutoAlign|ColMajor, DestType::MaxRowsAtCompileTime, 1> workspace(rows());
237 evalTo(dst, workspace);
238 }
internal::traits< HouseholderSequence >::Scalar Scalar
Definition HouseholderSequence.h:131
void evalTo(DestType &dst) const
Definition HouseholderSequence.h:233
@ ColMajor
Definition Constants.h:320
@ AutoAlign
Definition Constants.h:324

References Eigen::AutoAlign, Eigen::ColMajor, Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::evalTo(), and Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::rows().

Referenced by Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::evalTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ inverse()

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

Inverse of the Householder sequence (equals the adjoint).

230{ return adjoint(); }
ConjugateReturnType adjoint() const
Adjoint (conjugate transpose) of the Householder sequence.
Definition HouseholderSequence.h:224

References Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::adjoint().

+ Here is the call graph for this function:

◆ length()

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

Returns the length of the Householder sequence.

References Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_length.

Referenced by Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::setLength().

+ Here is the caller graph for this function:

◆ 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.

357 {
361 return res;
362 }
EIGEN_DEVICE_FUNC CastXpr< NewType >::Type cast() const
Definition CommonCwiseUnaryOps.h:62
Matrix< ResultScalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime, 0, MatrixType::MaxRowsAtCompileTime, MatrixType::MaxColsAtCompileTime > Type
Definition HouseholderSequence.h:114
ScalarBinaryOpTraits< OtherScalarType, typenameMatrixType::Scalar >::ReturnType ResultScalar
Definition HouseholderSequence.h:112

References Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::applyThisOnTheLeft(), and cast().

+ Here is the call graph for this function:

◆ rows()

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

◆ setLength()

template<typename VectorsType , typename CoeffsType , int Side>
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()
376 {
378 return *this;
379 }
Index length() const
Returns the length of the Householder sequence.
Definition HouseholderSequence.h:398

References Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::length(), and Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_length.

Referenced by Eigen::internal::tridiagonalization_inplace_selector< MatrixType, Size, IsComplex >::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setShift()

template<typename VectorsType , typename CoeffsType , int Side>
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()
393 {
394 m_shift = shift;
395 return *this;
396 }
Index shift() const
Returns the shift of the Householder sequence.
Definition HouseholderSequence.h:399

References Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_shift, and Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::shift().

Referenced by Eigen::internal::tridiagonalization_inplace_selector< MatrixType, Size, IsComplex >::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTrans()

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

Sets the transpose flag.

Parameters
[in]transNew 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_{n-1}^T \ldots H_1^T H_0^T $ instead of $ H = H_0 H_1 \ldots H_{n-1} $.

See also
trans()
415 {
416 m_trans = trans;
417 return *this;
418 }
bool trans() const
Returns the transpose flag.
Definition HouseholderSequence.h:420

References Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_trans, and Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::trans().

Referenced by Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::adjoint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shift()

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

Returns the shift of the Householder sequence.

References Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_shift.

Referenced by Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::setShift().

+ Here is the caller graph for this function:

◆ size()

EIGEN_DEVICE_FUNC Index Eigen::EigenBase< HouseholderSequence< VectorsType, CoeffsType, Side > >::size ( ) const
inlineinherited
Returns
the number of coefficients, which is rows()*cols().
See also
rows(), cols(), SizeAtCompileTime.
66{ return rows() * cols(); }

◆ subTo()

EIGEN_DEVICE_FUNC void Eigen::EigenBase< HouseholderSequence< VectorsType, CoeffsType, Side > >::subTo ( Dest &  dst) const
inlineinherited
90 {
91 // This is the default implementation,
92 // derived class can reimplement it in a more optimized way.
93 typename Dest::PlainObject res(rows(),cols());
94 evalTo(res);
95 dst -= res;
96 }

◆ trans()

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

Returns the transpose flag.

References Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_trans.

Referenced by Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::setTrans().

+ Here is the caller graph for this function:

◆ transpose()

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

Transpose of the Householder sequence.

210 {
211 return HouseholderSequence(*this).setTrans(!m_trans);
212 }
friend class HouseholderSequence
Definition HouseholderSequence.h:402

References Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::HouseholderSequence, and Eigen::HouseholderSequence< VectorsType, CoeffsType, Side >::m_trans.

Referenced by igl::per_vertex_point_to_plane_quadrics().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol 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

◆ m_length

◆ m_shift

◆ m_trans

◆ m_vectors


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