Precompute rotated stiffness matrix before CG in implicit flex integrator.

This gives a 3x speedup in implicitfast.

Also cleanup old code that was used in the dense factorization of the stiffness matrix before we switched to CG.

PiperOrigin-RevId: 915900315
Change-Id: Id6973c4bfd7d371a43ec6db982703969b23a3550
This commit is contained in:
Alessio Quaglino
2026-05-15 02:57:18 -07:00
committed by Copybara-Service
parent 85bf2b9660
commit 7ca1bc6a56
5 changed files with 104 additions and 107 deletions
+1 -1
View File
@@ -3147,7 +3147,7 @@ TEST_F(ForwardTest, FlexTrilinearInstability) {
// using mulKD for legacy check consistency, but we know it applies h^2+h*d
// scaling; actually, let's stick to the high-level property checks from
// FlexStiffnessSign which used mulKD
mjd_flexInterp_mul(model, data, flex_Kv.data(), v.data(), h * h, h);
mjd_flexInterp_mul(model, data, flex_Kv.data(), v.data(), h * h, h, NULL);
// compute v^T*M*v and v^T*scale*K*v
mjtNum vMv = mju_dot(v.data(), Mv.data(), nv);