[wpimath] Only compute eigenvalues with EigenSolvers (#5369)

We don't need the eigenvectors, so we're doing a lot of extra work we
don't need to.
This commit is contained in:
Tyler Veness
2023-06-07 09:47:09 -07:00
committed by GitHub
parent d3c9316a97
commit 5acc5e22aa
5 changed files with 16 additions and 10 deletions

View File

@@ -33,7 +33,7 @@ namespace {
*/
bool IsStabilizable(const Eigen::Ref<const Eigen::MatrixXd>& A,
const Eigen::Ref<const Eigen::MatrixXd>& B) {
Eigen::EigenSolver<Eigen::MatrixXd> es{A};
Eigen::EigenSolver<Eigen::MatrixXd> es{A, false};
for (int i = 0; i < A.rows(); ++i) {
if (es.eigenvalues()[i].real() * es.eigenvalues()[i].real() +