Allow RHS vector in mj_mulM_island to use uncompressed memory.

PiperOrigin-RevId: 562605681
Change-Id: If34bceed9eade59957ac9fd9b6a41fb736b58024
This commit is contained in:
Yuval Tassa
2023-09-04 13:55:56 -07:00
committed by Copybara-Service
parent 600c12533d
commit 1aa375ef9a
3 changed files with 31 additions and 6 deletions
+16 -1
View File
@@ -493,8 +493,23 @@ TEST_F(SupportTest, MulMIsland) {
vec_i[j] = vec[dofind[j]];
}
// === compressed: use vec_i
// multiply by Jacobian, for this island
mj_mulM_island(model, data, Mvec_i, vec_i, i);
int flg_vecunc = 0;
mj_mulM_island(model, data, Mvec_i, vec_i, i, flg_vecunc);
// expect corresponding values to match
for (int j=0; j < dofnum; j++) {
EXPECT_THAT(Mvec_i[j], DoubleNear(Mvec[dofind[j]], 1e-12));
}
// === uncompressed: use vec
mju_zero(Mvec_i, dofnum); // clear output
// multiply by Jacobian, for this island
flg_vecunc = 1;
mj_mulM_island(model, data, Mvec_i, vec, i, flg_vecunc);
// expect corresponding values to match
for (int j=0; j < dofnum; j++) {