Go to the documentation of this file.
11 #ifndef EIGEN_TRIDIAGONALIZATION_H
12 #define EIGEN_TRIDIAGONALIZATION_H
19 template<
typename MatrixType>
21 :
public traits<typename MatrixType::PlainObject>
27 template<
typename MatrixType,
typename CoeffVectorType>
76 Size = MatrixType::RowsAtCompileTime,
79 MaxSize = MatrixType::MaxRowsAtCompileTime,
130 template<
typename InputType>
157 template<
typename InputType>
306 template<
typename MatrixType>
310 eigen_assert(m_isInitialized &&
"Tridiagonalization is not initialized.");
311 return m_matrix.diagonal().real();
314 template<
typename MatrixType>
318 eigen_assert(m_isInitialized &&
"Tridiagonalization is not initialized.");
347 template<
typename MatrixType,
typename CoeffVectorType>
363 matA.col(
i).tail(remainingSize).makeHouseholderInPlace(
h,
beta);
367 matA.col(
i).coeffRef(
i+1) = 1;
369 hCoeffs.tail(
n-
i-1).noalias() = (
matA.bottomRightCorner(remainingSize,remainingSize).template selfadjointView<Lower>()
370 * (
conj(
h) *
matA.col(
i).tail(remainingSize)));
372 hCoeffs.tail(
n-
i-1) += (
conj(
h)*
RealScalar(-0.5)*(hCoeffs.tail(remainingSize).dot(
matA.col(
i).tail(remainingSize)))) *
matA.col(
i).tail(
n-
i-1);
374 matA.bottomRightCorner(remainingSize, remainingSize).template selfadjointView<Lower>()
375 .rankUpdate(
matA.col(
i).tail(remainingSize), hCoeffs.tail(remainingSize),
Scalar(-1));
378 hCoeffs.coeffRef(
i) =
h;
384 int Size=MatrixType::ColsAtCompileTime,
428 template<
typename MatrixType,
typename DiagonalType,
typename SubDiagonalType,
typename CoeffVectorType>
431 CoeffVectorType& hcoeffs,
bool extractQ)
440 template<
typename MatrixType,
int Size,
bool IsComplex>
441 struct tridiagonalization_inplace_selector
445 template<
typename DiagonalType,
typename SubDiagonalType>
463 template<
typename MatrixType>
469 template<
typename DiagonalType,
typename SubDiagonalType,
typename CoeffVectorType>
480 subdiag[0] =
mat(1,0);
481 subdiag[1] =
mat(2,1);
495 subdiag[1] =
mat(2,1) - m01 *
q;
509 template<
typename MatrixType,
bool IsComplex>
514 template<
typename DiagonalType,
typename SubDiagonalType,
typename CoeffVectorType>
531 template<
typename MatrixType>
struct TridiagonalizationMatrixTReturnType
532 :
public ReturnByValue<TridiagonalizationMatrixTReturnType<MatrixType> >
541 template <
typename ResultType>
561 #endif // EIGEN_TRIDIAGONALIZATION_H
const AutoDiffScalar< DerType > & conj(const AutoDiffScalar< DerType > &x)
MatrixType::Scalar Scalar
const MatrixType & packedMatrix() const
Returns the internal representation of the decomposition.
#define EIGEN_DEVICE_FUNC
Namespace containing all symbols from the Eigen library.
internal::conditional< NumTraits< Scalar >::IsComplex, typename internal::add_const_on_value_type< typename Diagonal< const MatrixType >::RealReturnType >::type, const Diagonal< const MatrixType > >::type DiagonalReturnType
Tridiagonalization< MatrixType >::CoeffVectorType CoeffVectorType
Tridiagonal decomposition of a selfadjoint matrix.
SubDiagonalReturnType subDiagonal() const
Returns the subdiagonal of the tridiagonal matrix T in the decomposition.
internal::conditional< NumTraits< Scalar >::IsComplex, const CwiseUnaryOp< internal::scalar_real_op< Scalar >, const Derived >, const Derived & >::type RealReturnType
Matrix diag(const std::vector< Matrix > &Hs)
EIGEN_DEVICE_FUNC HouseholderSequence & setLength(Index length)
Sets the length of the Householder sequence.
TridiagonalizationMatrixTReturnType(const MatrixType &mat)
Constructor.
Matrix< Scalar, SizeMinusOne, 1, Options &~RowMajor, MaxSizeMinusOne, 1 > CoeffVectorType
HouseholderSequence< MatrixType, typename internal::remove_all< typename CoeffVectorType::ConjugateReturnType >::type > HouseholderSequenceType
Return type of matrixQ()
_MatrixType MatrixType
Synonym for the template parameter _MatrixType.
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
HouseholderSequenceType matrixQ() const
Returns the unitary matrix Q in the decomposition.
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Tridiagonalization< MatrixType >::HouseholderSequenceType HouseholderSequenceType
EIGEN_DEVICE_FUNC HouseholderSequence & setShift(Index shift)
Sets the shift of the Householder sequence.
double beta(double a, double b)
MatrixTReturnType matrixT() const
Returns an expression of the tridiagonal matrix T in the decomposition.
void diagonal(const MatrixType &m)
Tridiagonalization & compute(const EigenBase< InputType > &matrix)
Computes tridiagonal decomposition of given matrix.
internal::TridiagonalizationMatrixTReturnType< MatrixTypeRealView > MatrixTReturnType
static void run(MatrixType &mat, DiagonalType &diag, SubDiagonalType &subdiag, CoeffVectorType &, bool extractQ)
internal::plain_col_type< MatrixType, RealScalar >::type DiagonalType
MatrixType::RealScalar RealScalar
CoeffVectorType m_hCoeffs
MatrixType::Scalar Scalar
EIGEN_DEVICE_FUNC const Scalar & q
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
void evalTo(ResultType &result) const
MatrixType::Scalar Scalar
Tridiagonalization(const EigenBase< InputType > &matrix)
Constructor; computes tridiagonal decomposition of given matrix.
MatrixType::PlainObject ReturnType
AnnoyingScalar conj(const AnnoyingScalar &x)
EIGEN_DEVICE_FUNC void tridiagonalization_inplace(MatrixType &matA, CoeffVectorType &hCoeffs)
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
EIGEN_DEVICE_FUNC ConjugateReturnType conjugate() const
NumTraits< Scalar >::Real RealScalar
const AutoDiffScalar< DerType > & real(const AutoDiffScalar< DerType > &x)
DiagonalReturnType diagonal() const
Returns the diagonal of the tridiagonal matrix T in the decomposition.
EIGEN_DEVICE_FUNC bool abs2(bool x)
static EIGEN_DEVICE_FUNC void run(MatrixType &mat, DiagonalType &diag, SubDiagonalType &, CoeffVectorType &, bool extractQ)
Tridiagonalization(Index size=Size==Dynamic ? 2 :Size)
Default constructor.
internal::conditional< NumTraits< Scalar >::IsComplex, typename internal::add_const_on_value_type< typename Diagonal< const MatrixType, -1 >::RealReturnType >::type, const Diagonal< const MatrixType, -1 > >::type SubDiagonalReturnType
NumTraits< Scalar >::Real RealScalar
internal::remove_all< typename MatrixType::RealReturnType >::type MatrixTypeRealView
Matrix< RealScalar, SizeMinusOne, 1, Options &~RowMajor, MaxSizeMinusOne, 1 > SubDiagonalType
static EIGEN_DEVICE_FUNC void run(MatrixType &mat, DiagonalType &diag, SubDiagonalType &subdiag, CoeffVectorType &hCoeffs, bool extractQ)
CoeffVectorType householderCoefficients() const
Returns the Householder coefficients.
MatrixType::Nested m_matrix
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Jet< T, N > sqrt(const Jet< T, N > &f)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Sequence of Householder reflections acting on subspaces with decreasing size.
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:09:36