40 assert(A.rows() == B.rows());
43 if (n < 1 || m < 1)
return false;
45 Eigen::MatrixXd ctrl_mat(n, n * m);
47 ctrl_mat.leftCols(m) =
B;
48 if (n > 1) ctrl_mat.middleCols(m, m) = A *
B;
52 Eigen::MatrixXd A_aux =
A;
53 int current_col = 2 * m;
54 for (
int i = 2; i <
n; ++i)
57 ctrl_mat.middleCols(current_col, m) = A_aux *
B;
66 int ctrl_mat_rank = decomp.
rank();
67 if (rank) *rank = ctrl_mat_rank;
68 return (ctrl_mat_rank == n);
static bool checkLinearTimeInvariantSystem(const Eigen::Ref< const Eigen::MatrixXd > &A, const Eigen::Ref< const Eigen::MatrixXd > &B, int *rank=nullptr)
Check controllability of linear time invariant system.
bool is_square(const Eigen::MatrixBase< Derived > &matrix)
Determine if a given matrix is square.
MatrixType A(a, *n, *n, *lda)
Householder rank-revealing QR decomposition of a matrix with column-pivoting.
A matrix or vector expression mapping an existing expression.
MatrixType B(b, *n, *nrhs, *ldb)