Go to the documentation of this file.
   12 #ifndef EIGEN_COMPLEX_EIGEN_SOLVER_H 
   13 #define EIGEN_COMPLEX_EIGEN_SOLVER_H 
  125     template<
typename InputType>
 
  212     template<
typename InputType>
 
  258 template<
typename MatrixType>
 
  259 template<
typename InputType>
 
  263   check_template_parameters();
 
  270   m_schur.compute(
matrix.derived(), computeEigenvectors);
 
  274     m_eivalues = m_schur.matrixT().diagonal();
 
  275     if(computeEigenvectors)
 
  276       doComputeEigenvectors(m_schur.matrixT().norm());
 
  277     sortEigenvalues(computeEigenvectors);
 
  280   m_isInitialized = 
true;
 
  281   m_eigenvectorsOk = computeEigenvectors;
 
  286 template<
typename MatrixType>
 
  289   const Index n = m_eivalues.size();
 
  295   m_matX = EigenvectorType::Zero(
n, 
n);
 
  296   for(
Index k=
n-1 ; k>=0 ; k--)
 
  300     for(
Index i=k-1 ; i>=0 ; i--)
 
  302       m_matX.coeffRef(i,k) = -m_schur.matrixT().coeff(i,k);
 
  304         m_matX.coeffRef(i,k) -= (m_schur.matrixT().row(i).segment(i+1,k-i-1) * m_matX.col(k).segment(i+1,k-i-1)).value();
 
  305       ComplexScalar z = m_schur.matrixT().coeff(i,i) - m_schur.matrixT().coeff(k,k);
 
  312       m_matX.coeffRef(i,k) = m_matX.coeff(i,k) / z;
 
  317   m_eivec.noalias() = m_schur.matrixU() * m_matX;
 
  319   for(
Index k=0 ; k<
n ; k++)
 
  321     m_eivec.col(k).normalize();
 
  326 template<
typename MatrixType>
 
  329   const Index n =  m_eivalues.size();
 
  333     m_eivalues.cwiseAbs().tail(
n-i).minCoeff(&k);
 
  338       if(computeEigenvectors)
 
  339         m_eivec.col(i).swap(m_eivec.col(k));
 
  346 #endif // EIGEN_COMPLEX_EIGEN_SOLVER_H 
  
ComplexEigenSolver()
Default constructor.
Matrix< ComplexScalar, RowsAtCompileTime, ColsAtCompileTime, Options, MaxRowsAtCompileTime, MaxColsAtCompileTime > EigenvectorType
Type for matrix of eigenvectors as returned by eigenvectors().
ComplexEigenSolver(const EigenBase< InputType > &matrix, bool computeEigenvectors=true)
Constructor; computes eigendecomposition of given matrix.
EigenvalueType m_eivalues
void doComputeEigenvectors(RealScalar matrixnorm)
ComplexSchur & setMaxIterations(Index maxIters)
Sets the maximum number of iterations allowed.
ComplexSchur< MatrixType > m_schur
std::complex< RealScalar > ComplexScalar
Complex scalar type for MatrixType.
ComplexEigenSolver & setMaxIterations(Index maxIters)
Sets the maximum number of iterations allowed.
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
static void check_template_parameters()
Index getMaxIterations()
Returns the maximum number of iterations.
const EigenvalueType & eigenvalues() const
Returns the eigenvalues of given matrix.
ComputationInfo info() const
Reports whether previous computation was successful.
NumTraits< Scalar >::Real RealScalar
EIGEN_DEVICE_FUNC internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar &x)
ComplexEigenSolver(Index size)
Default Constructor with memory preallocation.
_MatrixType MatrixType
Synonym for the template parameter _MatrixType.
const EigenvectorType & eigenvectors() const
Returns the eigenvectors of given matrix.
Index getMaxIterations()
Returns the maximum number of iterations.
ComputationInfo info() const
Reports whether previous computation was successful.
MatrixType::Scalar Scalar
Scalar type for matrices of type MatrixType.
Computes eigenvalues and eigenvectors of general complex matrices.
ComplexEigenSolver & compute(const EigenBase< InputType > &matrix, bool computeEigenvectors=true)
Computes eigendecomposition of given matrix.
static constexpr size_t size(Tuple< Args... > &)
Provides access to the number of elements in a tuple as a compile-time constant expression.
void sortEigenvalues(bool computeEigenvectors)
The matrix class, also used for vectors and row-vectors.
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T maxi(const T &x, const T &y)
int EIGEN_BLAS_FUNC() swap(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
#define EIGEN_STATIC_ASSERT_NON_INTEGER(TYPE)
control_box_rst
Author(s): Christoph Rösmann 
autogenerated on Wed Mar 2 2022 00:05:40