11 #ifndef EIGEN_HOUSEHOLDER_SEQUENCE_H
12 #define EIGEN_HOUSEHOLDER_SEQUENCE_H
62 template <
typename VectorsType,
typename CoeffsType,
int S
ide>
70 ColsAtCompileTime = RowsAtCompileTime,
71 MaxRowsAtCompileTime =
73 MaxColsAtCompileTime = MaxRowsAtCompileTime,
80 template <
typename VectorsType,
typename CoeffsType,
int S
ide>
86 template <
typename VectorsType,
typename CoeffsType,
int S
ide>
96 template <
typename VectorsType,
typename CoeffsType>
106 template <
typename OtherScalarType,
typename MatrixType>
109 typedef Matrix<
ResultScalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime, 0,
110 MatrixType::MaxRowsAtCompileTime, MatrixType::MaxColsAtCompileTime>
116 template <
typename VectorsType,
typename CoeffsType,
int S
ide>
236 typedef std::conditional_t<Cond, ConjugateReturnType, ConstHouseholderSequence> ReturnType;
237 return ReturnType(
m_vectors.template conjugateIf<Cond>(),
m_coeffs.template conjugateIf<Cond>());
252 template <
typename DestType>
260 template <
typename Dest,
typename Workspace>
262 workspace.resize(
rows());
266 dst.diagonal().setOnes();
267 dst.template triangularView<StrictlyUpper>().setZero();
268 for (
Index k = vecs - 1;
k >= 0; --
k) {
271 dst.bottomRightCorner(cornerSize, cornerSize)
274 dst.bottomRightCorner(cornerSize, cornerSize)
278 dst.col(
k).tail(
rows() -
k - 1).setZero();
290 for (
Index k = vecs - 1;
k >= 0; --
k) {
293 dst.bottomRightCorner(cornerSize, cornerSize)
296 dst.bottomRightCorner(cornerSize, cornerSize)
303 template <
typename Dest>
310 template <
typename Dest,
typename Workspace>
312 workspace.resize(dst.rows());
321 template <
typename Dest>
328 template <
typename Dest,
typename Workspace>
329 inline void applyThisOnTheLeft(Dest& dst, Workspace& workspace,
bool inputIsIdentity =
false)
const {
330 if (inputIsIdentity &&
m_reverse) inputIsIdentity =
false;
345 std::conditional_t<Side == OnTheRight, Transpose<SubVectorsType>, SubVectorsType&> sub_vecs(sub_vecs1);
349 if (inputIsIdentity) {
353 auto sub_dst = dst.bottomRows(dstRows);
358 workspace.resize(dst.cols());
363 if (inputIsIdentity) {
367 auto sub_dst = dst.bottomRows(dstRows);
381 template <
typename OtherDerived>
390 template <
typename VectorsType_,
typename CoeffsType_,
int S
ide_>
432 template <
typename VectorsType2,
typename CoeffsType2,
int S
ide2>
469 template <
typename OtherDerived,
typename VectorsType,
typename CoeffsType,
int S
ide>
474 OtherDerived>::ResultScalar>());
483 template <
typename VectorsType,
typename CoeffsType>
494 template <
typename VectorsType,
typename CoeffsType>
496 const CoeffsType& h) {
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define EIGEN_NOEXCEPT
Definition: Macros.h:1267
#define EIGEN_CONSTEXPR
Definition: Macros.h:758
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define eigen_assert(x)
Definition: Macros.h:910
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
void reverse(const MatrixType &m)
Definition: array_reverse.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:110
Sequence of Householder reflections acting on subspaces with decreasing size.
Definition: HouseholderSequence.h:117
AdjointReturnType inverse() const
Inverse of the Householder sequence (equals the adjoint).
Definition: HouseholderSequence.h:249
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Number of columns of transformation viewed as a matrix.
Definition: HouseholderSequence.h:194
EIGEN_DEVICE_FUNC HouseholderSequence(const VectorsType &v, const CoeffsType &h)
Constructor.
Definition: HouseholderSequence.h:171
Index m_length
Definition: HouseholderSequence.h:456
EIGEN_DEVICE_FUNC HouseholderSequence(const HouseholderSequence &other)
Copy constructor.
Definition: HouseholderSequence.h:175
internal::traits< HouseholderSequence >::Scalar Scalar
Definition: HouseholderSequence.h:128
@ ColsAtCompileTime
Definition: HouseholderSequence.h:124
@ MaxColsAtCompileTime
Definition: HouseholderSequence.h:126
@ MaxRowsAtCompileTime
Definition: HouseholderSequence.h:125
@ RowsAtCompileTime
Definition: HouseholderSequence.h:123
bool m_reverse
Definition: HouseholderSequence.h:455
HouseholderSequence< VectorsType, std::conditional_t< NumTraits< Scalar >::IsComplex, internal::remove_all_t< typename CoeffsType::ConjugateReturnType >, CoeffsType >, Side > AdjointReturnType
Definition: HouseholderSequence.h:143
CoeffsType::Nested m_coeffs
Definition: HouseholderSequence.h:454
EIGEN_DEVICE_FUNC HouseholderSequence & setLength(Index length)
Sets the length of the Householder sequence.
Definition: HouseholderSequence.h:402
HouseholderSequence< std::add_const_t< VectorsType >, std::add_const_t< CoeffsType >, Side > ConstHouseholderSequence
Definition: HouseholderSequence.h:152
void applyThisOnTheRight(Dest &dst) const
Definition: HouseholderSequence.h:304
EIGEN_DEVICE_FUNC HouseholderSequence & setShift(Index shift)
Sets the shift of the Householder sequence.
Definition: HouseholderSequence.h:418
EIGEN_DEVICE_FUNC const EssentialVectorType essentialVector(Index k) const
Essential part of a Householder vector.
Definition: HouseholderSequence.h:210
VectorsType::Nested m_vectors
Definition: HouseholderSequence.h:453
EIGEN_DEVICE_FUNC std::conditional_t< Cond, ConjugateReturnType, ConstHouseholderSequence > conjugateIf() const
Definition: HouseholderSequence.h:235
internal::hseq_side_dependent_impl< VectorsType, CoeffsType, Side >::EssentialVectorType EssentialVectorType
Definition: HouseholderSequence.h:119
EIGEN_DEVICE_FUNC void evalTo(Dest &dst, Workspace &workspace) const
Definition: HouseholderSequence.h:261
EIGEN_DEVICE_FUNC Index shift() const
Returns the shift of the Householder sequence.
Definition: HouseholderSequence.h:427
EIGEN_DEVICE_FUNC void evalTo(DestType &dst) const
Definition: HouseholderSequence.h:253
@ BlockSize
Definition: HouseholderSequence.h:458
HouseholderSequence< std::conditional_t< NumTraits< Scalar >::IsComplex, internal::remove_all_t< typename VectorsType::ConjugateReturnType >, VectorsType >, CoeffsType, Side > TransposeReturnType
Definition: HouseholderSequence.h:149
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.
Definition: HouseholderSequence.h:382
EIGEN_DEVICE_FUNC Index length() const
Returns the length of the Householder sequence.
Definition: HouseholderSequence.h:423
Index m_shift
Definition: HouseholderSequence.h:457
ConjugateReturnType conjugate() const
Complex conjugate of the Householder sequence.
Definition: HouseholderSequence.h:224
void applyThisOnTheLeft(Dest &dst, bool inputIsIdentity=false) const
Definition: HouseholderSequence.h:322
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Number of rows of transformation viewed as a matrix.
Definition: HouseholderSequence.h:186
bool reverseFlag() const
Returns the reverse flag.
Definition: HouseholderSequence.h:451
HouseholderSequence & setReverseFlag(bool reverse)
Sets the reverse flag.
Definition: HouseholderSequence.h:446
TransposeReturnType transpose() const
Transpose of the Householder sequence.
Definition: HouseholderSequence.h:216
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
Definition: HouseholderSequence.h:136
AdjointReturnType adjoint() const
Adjoint (conjugate transpose) of the Householder sequence.
Definition: HouseholderSequence.h:241
void applyThisOnTheLeft(Dest &dst, Workspace &workspace, bool inputIsIdentity=false) const
Definition: HouseholderSequence.h:329
void applyThisOnTheRight(Dest &dst, Workspace &workspace) const
Definition: HouseholderSequence.h:311
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:52
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
Expression of the transpose of a matrix.
Definition: Transpose.h:56
@ IsComplex
Definition: common.h:73
#define min(a, b)
Definition: datatypes.h:22
#define max(a, b)
Definition: datatypes.h:23
static constexpr lastp1_t end
Definition: IndexedViewHelper.h:79
HouseholderSequence< VectorsType, CoeffsType > householderSequence(const VectorsType &v, const CoeffsType &h)
Convenience function for constructing a Householder sequence.
Definition: HouseholderSequence.h:484
HouseholderSequence< VectorsType, CoeffsType, OnTheRight > rightHouseholderSequence(const VectorsType &v, const CoeffsType &h)
Convenience function for constructing a Householder sequence.
Definition: HouseholderSequence.h:495
@ OnTheLeft
Definition: Constants.h:331
@ OnTheRight
Definition: Constants.h:333
char char char int int * k
Definition: level2_impl.h:374
typename remove_all< T >::type remove_all_t
Definition: Meta.h:142
EIGEN_DEVICE_FUNC NewType cast(const OldType &x)
Definition: MathFunctions.h:362
void apply_block_householder_on_the_left(MatrixType &mat, const VectorsType &vectors, const CoeffsType &hCoeffs, bool forward)
Definition: BlockHouseholder.h:86
EIGEN_DEVICE_FUNC bool is_same_dense(const T1 &mat1, const T2 &mat2, std::enable_if_t< possibly_same_dense< T1, T2 >::value > *=0)
Definition: XprHelper.h:869
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
EIGEN_DEVICE_FUNC const Product< MatrixDerived, PermutationDerived, AliasFreeProduct > operator*(const MatrixBase< MatrixDerived > &matrix, const PermutationBase< PermutationDerived > &permutation)
Definition: PermutationMatrix.h:471
const int Dynamic
Definition: Constants.h:25
Extend namespace for flags.
Definition: fsi_chan_precond_driver.cc:56
Definition: Eigen_Colamd.h:49
void start(const unsigned &i)
(Re-)start i-th timer
Definition: oomph_utilities.cc:243
Definition: EigenBase.h:33
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:43
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
Definition: XprHelper.h:1043
Definition: HouseholderSequence.h:78
HouseholderSequenceShape Shape
Definition: HouseholderSequence.h:83
Definition: CoreEvaluators.h:87
Definition: CoreEvaluators.h:95
Transpose< Block< const VectorsType, 1, Dynamic > > EssentialVectorType
Definition: HouseholderSequence.h:98
static const EssentialVectorType essentialVector(const HouseholderSequenceType &h, Index k)
Definition: HouseholderSequence.h:100
HouseholderSequence< VectorsType, CoeffsType, OnTheRight > HouseholderSequenceType
Definition: HouseholderSequence.h:99
Definition: HouseholderSequence.h:87
HouseholderSequence< VectorsType, CoeffsType, OnTheLeft > HouseholderSequenceType
Definition: HouseholderSequence.h:89
Block< const VectorsType, Dynamic, 1 > EssentialVectorType
Definition: HouseholderSequence.h:88
static EIGEN_DEVICE_FUNC const EssentialVectorType essentialVector(const HouseholderSequenceType &h, Index k)
Definition: HouseholderSequence.h:90
Definition: XprHelper.h:844
Definition: HouseholderSequence.h:107
ScalarBinaryOpTraits< OtherScalarType, typename MatrixType::Scalar >::ReturnType ResultScalar
Definition: HouseholderSequence.h:108
Matrix< ResultScalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime, 0, MatrixType::MaxRowsAtCompileTime, MatrixType::MaxColsAtCompileTime > Type
Definition: HouseholderSequence.h:111
VectorsType::StorageIndex StorageIndex
Definition: HouseholderSequence.h:65
VectorsType::StorageKind StorageKind
Definition: HouseholderSequence.h:66
VectorsType::Scalar Scalar
Definition: HouseholderSequence.h:64
Definition: ForwardDeclarations.h:21