12 #include <Eigen/Eigenvalues> 14 template<
typename MatrixType>
void schur(
int size = MatrixType::ColsAtCompileTime)
20 for(
int counter = 0; counter <
g_repeat; ++counter) {
24 ComplexMatrixType
U = schurOfA.
matrixU();
25 ComplexMatrixType
T = schurOfA.
matrixT();
56 cs3.setMaxIterations(1).compute(A);
61 Atriangular.template triangularView<StrictlyLower>().
setZero();
62 cs3.setMaxIterations(1).compute(Atriangular);
64 VERIFY_IS_EQUAL(cs3.matrixT(), Atriangular.template cast<ComplexScalar>());
65 VERIFY_IS_EQUAL(cs3.matrixU(), ComplexMatrixType::Identity(size, size));
73 if (size > 1 && size < 20)
76 A(0,0) = std::numeric_limits<typename MatrixType::RealScalar>::quiet_NaN();
84 CALL_SUBTEST_1(( schur<Matrix4cd>() ));
86 CALL_SUBTEST_3((
schur<
Matrix<std::complex<float>, 1, 1> >() ));
#define VERIFY_RAISES_ASSERT(a)
cout<< "Here is a random 4x4 matrix, A:"<< endl<< A<< endl<< endl;ComplexSchur< MatrixXcf > schurOfA(A, false)
ComplexSchur & setMaxIterations(Index maxIters)
Sets the maximum number of iterations allowed.
void test_schur_complex()
void schur(int size=MatrixType::ColsAtCompileTime)
Matrix< SCALARA, Dynamic, Dynamic > A
ComplexSchur & compute(const EigenBase< InputType > &matrix, bool computeU=true)
Computes Schur decomposition of given matrix.
#define VERIFY_IS_APPROX(a, b)
#define VERIFY_IS_EQUAL(a, b)
Eigen::Triplet< double > T
const ComplexMatrixType & matrixT() const
Returns the triangular matrix in the Schur decomposition.
#define EIGEN_TEST_MAX_SIZE
ComputationInfo info() const
Reports whether previous computation was successful.
The matrix class, also used for vectors and row-vectors.
Performs a complex Schur decomposition of a real or complex square matrix.
const ComplexMatrixType & matrixU() const
Returns the unitary matrix in the Schur decomposition.