Use the inlined mji_ 3x3 helpers throughout engine_derivative.c

Convert the four remaining mju_mulMat{,T}{Vec,Mat}3 call sites in this
file to their inlined mji_ equivalents, so the file is consistent after
the review change to the stretch paths. Aliasing is unaffected: the
inlined variants mark the result restrict, and every call already
required a distinct result (the public versions overwrite res while
reading vec).
This commit is contained in:
Alessio
2026-07-28 09:14:26 +01:00
parent a6743d8e0d
commit d895888da4
+4 -4
View File
@@ -245,7 +245,7 @@ void mjd_subQuat(const mjtNum qa[4], const mjtNum qb[4], mjtNum Da[9], mjtNum Db
// add term linear in K * K // add term linear in K * K
mjtNum KK[9]; mjtNum KK[9];
mju_mulMatMat3(KK, K, K); mji_mulMatMat3(KK, K, K);
mjtNum coef = 1.0 - (half_angle < 6e-8 ? 1.0 : half_angle / mju_tan(half_angle)); mjtNum coef = 1.0 - (half_angle < 6e-8 ? 1.0 : half_angle / mju_tan(half_angle));
mju_addToScl(Da_tmp, KK, coef, 9); mju_addToScl(Da_tmp, KK, coef, 9);
@@ -313,7 +313,7 @@ void mjd_quatIntegrate(const mjtNum vel[3], mjtNum scale,
if (Dvel || Dscale) Dvel_[i] = b*eye[i] + c*cross[i] + d*outer[i]; if (Dvel || Dscale) Dvel_[i] = b*eye[i] + c*cross[i] + d*outer[i];
} }
if (Dvel) mju_copy9(Dvel, Dvel_); if (Dvel) mju_copy9(Dvel, Dvel_);
if (Dscale) mju_mulMatVec3(Dscale, Dvel_, vel); if (Dscale) mji_mulMatVec3(Dscale, Dvel_, vel);
} }
@@ -1247,9 +1247,9 @@ static void mjd_flexInterp_kernel(const mjModel* m, mjData* d,
} }
// tmp = K * R // tmp = K * R
mju_mulMatMat3(tmp, blk, R); mji_mulMatMat3(tmp, blk, R);
// blk = RT * tmp = RT * K * R // blk = RT * tmp = RT * K * R
mju_mulMatMat3(blk, RT, tmp); mji_mulMatMat3(blk, RT, tmp);
// store in K_rot_cell at (a, b) // store in K_rot_cell at (a, b)
int adr_out = (3*a)*dim_e + 3*b; int adr_out = (3*a)*dim_e + 3*b;