11#ifndef EIGEN_TRIDIAGONALIZATION_H
12#define EIGEN_TRIDIAGONALIZATION_H
18template<
typename MatrixType>
struct TridiagonalizationMatrixTReturnType;
19template<
typename MatrixType>
21 :
public traits<typename MatrixType::PlainObject>
27template<
typename MatrixType,
typename CoeffVectorType>
71 typedef typename MatrixType::Scalar
Scalar;
76 Size = MatrixType::RowsAtCompileTime,
79 MaxSize = MatrixType::MaxRowsAtCompileTime,
130 template<
typename InputType>
157 template<
typename InputType>
306template<
typename MatrixType>
314template<
typename MatrixType>
347template<
typename MatrixType,
typename CoeffVectorType>
352 typedef typename MatrixType::Scalar
Scalar;
353 typedef typename MatrixType::RealScalar
RealScalar;
367 matA.col(
i).coeffRef(
i+1) = 1;
377 matA.col(
i).coeffRef(
i+1) = beta;
378 hCoeffs.coeffRef(
i) = h;
384 int Size=MatrixType::ColsAtCompileTime,
386struct tridiagonalization_inplace_selector;
428template<
typename MatrixType,
typename DiagonalType,
typename SubDiagonalType,
typename CoeffVectorType>
440template<
typename MatrixType,
int Size,
bool IsComplex>
445 template<
typename DiagonalType,
typename SubDiagonalType>
450 diag =
mat.diagonal().real();
463template<
typename MatrixType>
466 typedef typename MatrixType::Scalar
Scalar;
469 template<
typename DiagonalType,
typename SubDiagonalType,
typename CoeffVectorType>
473 const RealScalar tol = (std::numeric_limits<RealScalar>::min)();
492 diag[1] =
mat(1,1) +
m02*q;
493 diag[2] =
mat(2,2) -
m02*q;
509template<
typename MatrixType,
bool IsComplex>
512 typedef typename MatrixType::Scalar
Scalar;
514 template<
typename DiagonalType,
typename SubDiagonalType,
typename CoeffVectorType>
518 diag(0,0) = numext::real(
mat(0,0));
532:
public ReturnByValue<TridiagonalizationMatrixTReturnType<MatrixType> >
541 template <
typename ResultType>
546 result.diagonal() = m_matrix.diagonal();
AnnoyingScalar conj(const AnnoyingScalar &x)
Definition AnnoyingScalar.h:104
int n
Definition BiCGSTAB_simple.cpp:1
int i
Definition BiCGSTAB_step_by_step.cpp:9
internal::conditional< NumTraits< Scalar >::IsComplex, constCwiseUnaryOp< internal::scalar_real_op< Scalar >, constDerived >, constDerived & >::type RealReturnType
Definition CommonCwiseUnaryOps.h:24
EIGEN_DEVICE_FUNC ConjugateReturnType conjugate() const
Definition CommonCwiseUnaryOps.h:74
#define EIGEN_NOEXCEPT
Definition Macros.h:1418
#define EIGEN_CONSTEXPR
Definition Macros.h:787
#define EIGEN_DEVICE_FUNC
Definition Macros.h:976
#define eigen_assert(x)
Definition Macros.h:1037
MatrixXf mat
Definition Tutorial_AdvancedInitialization_CommaTemporary.cpp:1
int cols
Definition Tutorial_commainit_02.cpp:1
Scalar Scalar int size
Definition benchVecAdd.cpp:17
SCALAR Scalar
Definition bench_gemm.cpp:46
NumTraits< Scalar >::Real RealScalar
Definition bench_gemm.cpp:47
MatrixXf MatrixType
Definition benchmark-blocking-sizes.cpp:52
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
Definition Diagonal.h:65
Sequence of Householder reflections acting on subspaces with decreasing size.
Definition HouseholderSequence.h:121
EIGEN_DEVICE_FUNC HouseholderSequence & setShift(Index shift)
Sets the shift of the Householder sequence.
Definition HouseholderSequence.h:461
EIGEN_DEVICE_FUNC HouseholderSequence & setLength(Index length)
Sets the length of the Householder sequence.
Definition HouseholderSequence.h:443
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:180
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Definition PlainObjectBase.h:271
Definition ReturnByValue.h:52
Tridiagonal decomposition of a selfadjoint matrix.
Definition Tridiagonalization.h:65
HouseholderSequenceType matrixQ() const
Returns the unitary matrix Q in the decomposition.
Definition Tridiagonalization.h:241
Tridiagonalization(const EigenBase< InputType > &matrix)
Constructor; computes tridiagonal decomposition of given matrix.
Definition Tridiagonalization.h:131
DiagonalReturnType diagonal() const
Returns the diagonal of the tridiagonal matrix T in the decomposition.
Definition Tridiagonalization.h:308
@ Size
Definition Tridiagonalization.h:76
@ MaxSize
Definition Tridiagonalization.h:79
@ MaxSizeMinusOne
Definition Tridiagonalization.h:80
@ SizeMinusOne
Definition Tridiagonalization.h:77
@ Options
Definition Tridiagonalization.h:78
internal::remove_all< typenameMatrixType::RealReturnType >::type MatrixTypeRealView
Definition Tridiagonalization.h:86
Matrix< RealScalar, SizeMinusOne, 1, Options &~RowMajor, MaxSizeMinusOne, 1 > SubDiagonalType
Definition Tridiagonalization.h:85
internal::conditional< NumTraits< Scalar >::IsComplex, typenameinternal::add_const_on_value_type< typenameDiagonal< constMatrixType >::RealReturnType >::type, constDiagonal< constMatrixType > >::type DiagonalReturnType
Definition Tridiagonalization.h:92
MatrixTReturnType matrixT() const
Returns an expression of the tridiagonal matrix T in the decomposition.
Definition Tridiagonalization.h:266
CoeffVectorType m_hCoeffs
Definition Tridiagonalization.h:302
Eigen::Index Index
Definition Tridiagonalization.h:73
const MatrixType & packedMatrix() const
Returns the internal representation of the decomposition.
Definition Tridiagonalization.h:220
Tridiagonalization & compute(const EigenBase< InputType > &matrix)
Computes tridiagonal decomposition of given matrix.
Definition Tridiagonalization.h:158
NumTraits< Scalar >::Real RealScalar
Definition Tridiagonalization.h:72
Tridiagonalization(Index size=Size==Dynamic ? 2 :Size)
Default constructor.
Definition Tridiagonalization.h:114
internal::conditional< NumTraits< Scalar >::IsComplex, typenameinternal::add_const_on_value_type< typenameDiagonal< constMatrixType,-1 >::RealReturnType >::type, constDiagonal< constMatrixType,-1 > >::type SubDiagonalReturnType
Definition Tridiagonalization.h:97
SubDiagonalReturnType subDiagonal() const
Returns the subdiagonal of the tridiagonal matrix T in the decomposition.
Definition Tridiagonalization.h:316
CoeffVectorType householderCoefficients() const
Returns the Householder coefficients.
Definition Tridiagonalization.h:183
bool m_isInitialized
Definition Tridiagonalization.h:303
MatrixType m_matrix
Definition Tridiagonalization.h:301
Matrix< Scalar, SizeMinusOne, 1, Options &~RowMajor, MaxSizeMinusOne, 1 > CoeffVectorType
Definition Tridiagonalization.h:83
_MatrixType MatrixType
Synonym for the template parameter _MatrixType.
Definition Tridiagonalization.h:69
internal::plain_col_type< MatrixType, RealScalar >::type DiagonalType
Definition Tridiagonalization.h:84
HouseholderSequence< MatrixType, typename internal::remove_all< typename CoeffVectorType::ConjugateReturnType >::type > HouseholderSequenceType
Return type of matrixQ()
Definition Tridiagonalization.h:100
MatrixType::Scalar Scalar
Definition Tridiagonalization.h:71
internal::TridiagonalizationMatrixTReturnType< MatrixTypeRealView > MatrixTReturnType
Definition Tridiagonalization.h:87
Definition TensorRef.h:81
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
Definition common.h:110
@ IsComplex
Definition common.h:98
void diagonal(const MatrixType &m)
Definition diagonal.cpp:12
EIGEN_DEVICE_FUNC void tridiagonalization_inplace(MatrixType &matA, CoeffVectorType &hCoeffs)
Definition Tridiagonalization.h:349
Namespace containing all symbols from the Eigen library.
Definition bench_norm.cpp:85
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
const int Dynamic
Definition Constants.h:22
Definition BandTriangularSolver.h:13
Definition EigenBase.h:30
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition NumTraits.h:233
Definition Tridiagonalization.h:533
MatrixType::Nested m_matrix
Definition Tridiagonalization.h:554
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition Tridiagonalization.h:551
void evalTo(ResultType &result) const
Definition Tridiagonalization.h:542
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition Tridiagonalization.h:550
TridiagonalizationMatrixTReturnType(const MatrixType &mat)
Constructor.
Definition Tridiagonalization.h:539
MatrixType::PlainObject ReturnType
Definition Tridiagonalization.h:23
Definition ForwardDeclarations.h:17
MatrixType::Scalar Scalar
Definition Tridiagonalization.h:512
static EIGEN_DEVICE_FUNC void run(MatrixType &mat, DiagonalType &diag, SubDiagonalType &, CoeffVectorType &, bool extractQ)
Definition Tridiagonalization.h:516
static void run(MatrixType &mat, DiagonalType &diag, SubDiagonalType &subdiag, CoeffVectorType &, bool extractQ)
Definition Tridiagonalization.h:470
MatrixType::Scalar Scalar
Definition Tridiagonalization.h:466
MatrixType::RealScalar RealScalar
Definition Tridiagonalization.h:467
Definition Tridiagonalization.h:442
static EIGEN_DEVICE_FUNC void run(MatrixType &mat, DiagonalType &diag, SubDiagonalType &subdiag, CoeffVectorType &hCoeffs, bool extractQ)
Definition Tridiagonalization.h:447
Tridiagonalization< MatrixType >::CoeffVectorType CoeffVectorType
Definition Tridiagonalization.h:443
Tridiagonalization< MatrixType >::HouseholderSequenceType HouseholderSequenceType
Definition Tridiagonalization.h:444