11#ifndef EIGEN_HOUSEHOLDER_H
12#define EIGEN_HOUSEHOLDER_H
15#include "./InternalHeaderCheck.h"
21struct decrement_size {
22 enum { ret = n ==
Dynamic ? n : n - 1 };
42template <
typename Derived>
45 makeHouseholder(essentialPart, tau, beta);
63template <
typename Derived>
64template <
typename EssentialPart>
66 RealScalar& beta)
const {
70 EIGEN_STATIC_ASSERT_VECTOR_ONLY(EssentialPart)
73 RealScalar tailSqNorm = size() == 1 ? RealScalar(0) : tail.squaredNorm();
75 const RealScalar tol = (std::numeric_limits<RealScalar>::min)();
77 if (tailSqNorm <= tol && numext::abs2(numext::imag(c0)) <= tol) {
79 beta = numext::real(c0);
82 beta = sqrt(numext::abs2(c0) + tailSqNorm);
83 if (numext::real(c0) >= RealScalar(0)) beta = -beta;
84 essential = tail / (c0 - beta);
85 tau =
conj((beta - c0) / beta);
104template <
typename Derived>
105template <
typename EssentialPart>
110 }
else if (!numext::is_exactly_zero(tau)) {
114 tmp.noalias() = essential.adjoint() * bottom;
116 this->row(0) -= tau * tmp;
117 bottom.noalias() -= tau * essential * tmp;
136template <
typename Derived>
137template <
typename EssentialPart>
142 }
else if (!numext::is_exactly_zero(tau)) {
146 tmp.noalias() = right * essential;
148 this->col(0) -= tau * tmp;
149 right.noalias() -= tau * tmp * essential.adjoint();
Expression of a fixed-size or dynamic-size block.
Definition Block.h:110
internal::traits< Derived >::Scalar Scalar
Definition DenseBase.h:62
A matrix or vector expression mapping an existing array of data.
Definition Map.h:96
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:52
Expression of a fixed-size or dynamic-size sub-vector.
Definition VectorBlock.h:58
Namespace containing all symbols from the Eigen library.
Definition Core:137
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_conjugate_op< typename Derived::Scalar >, const Derived > conj(const Eigen::ArrayBase< Derived > &x)
const int Dynamic
Definition Constants.h:25