[wpimath] Remove redundant transposes on symmetric matrices (#8131)

This likely won't have a performance impact since it only affects matrix traversal order, but it does simplify the code.
This commit is contained in:
Tyler Veness
2025-07-31 21:04:55 -07:00
committed by GitHub
parent 0478176e47
commit feee88f40d
7 changed files with 35 additions and 11 deletions

View File

@@ -128,7 +128,11 @@ Eigen::Matrix<double, States, States> DARE(
//
// V₂ᵀ = W.solve(Gₖᵀ)
// V₂ = W.solve(Gₖᵀ)ᵀ
StateMatrix V_2 = W_solver.solve(G_k.transpose()).transpose();
//
// Since W, Gₖ, and Hₖ are symmetric, drop the transposes on Gₖ and V₂.
//
// V₂ = W.solve(Gₖ)
StateMatrix V_2 = W_solver.solve(G_k);
// Gₖ₊₁ = Gₖ + AₖV₂Aₖᵀ
// Hₖ₊₁ = Hₖ + V₁ᵀHₖAₖ