Go to the documentation of this file.
31 #include <Eigen/Dense>
32 #include <Eigen/Eigenvalues>
42 assert(
A.rows() == C.rows());
43 assert(
B.rows() == C.cols());
51 Eigen::MatrixXcd T_A = A_schur.matrixT();
52 const Eigen::MatrixXcd& U_A = A_schur.matrixU();
53 const Eigen::MatrixXcd& T_B = B_schur.matrixT();
54 const Eigen::MatrixXcd& U_B = B_schur.matrixU();
56 const int n = C.rows();
57 const int m = C.cols();
60 Eigen::MatrixXcd F = U_A.adjoint() * C * U_B;
62 Eigen::MatrixXcd Y(
n, m);
70 for (
int k = 0; k < m; ++k)
72 Eigen::VectorXcd rhs = F.col(k) + Y * T_B.col(k);
74 const std::complex<double> offset = T_B(k, k);
75 T_A.diagonal().array() += offset;
81 Y.col(k) = T_A_svd.solve(-rhs);
83 if (k < mm) T_A.diagonal().array() -= offset;
87 X = (U_A * Y * U_B.adjoint()).
real();
96 Eigen::VectorXcd eigvals_A =
A.eigenvalues();
97 Eigen::VectorXcd eigvals_B =
B.eigenvalues();
99 for (
int i = 0; i < eigvals_A.size(); ++i)
101 for (
int j = 0; j < eigvals_B.size(); ++j)
static bool solve(const Eigen::Ref< const Eigen::MatrixXd > &A, const Eigen::Ref< const Eigen::MatrixXd > &B, const Eigen::Ref< const Eigen::MatrixXd > &C, Eigen::MatrixXd &X)
Solve continuous-time Sylvester equation.
static bool hasUniqueSolution(const Eigen::Ref< const Eigen::MatrixXd > &A, const Eigen::Ref< const Eigen::MatrixXd > &B)
Determine if the Sylvester equation exhibits a unique solution.
bool is_square(const Eigen::MatrixBase< Derived > &matrix)
Determine if a given matrix is square.
MatrixType B(b, *n, *nrhs, *ldb)
const EIGEN_DEVICE_FUNC ImagReturnType imag() const
Two-sided Jacobi SVD decomposition of a rectangular matrix.
A matrix or vector expression mapping an existing expression.
MatrixType A(a, *n, *n, *lda)
bool approx_equal(double a, double b, double epsilon=1e-6)
Check if two doubles are appoximately equal.
Performs a complex Schur decomposition of a real or complex square matrix.
control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:06:33