Add mju_addToSymSparse

- Internal engine function to add a symmetric sparse matrix to a dense matrix.
- Also minor refactors to related functions.

PiperOrigin-RevId: 757954336
Change-Id: I8d8a48bcbbd5d6c618ae097a87df2bc1e6f5ef1d
This commit is contained in:
Yuval Tassa
2025-05-12 16:18:51 -07:00
committed by Copybara-Service
parent 755564a348
commit 436b5a8e1f
7 changed files with 109 additions and 19 deletions
+2 -2
View File
@@ -137,8 +137,8 @@ MJAPI void mj_addM(const mjModel* m, mjData* d, mjtNum* dst,
// add inertia matrix to sparse destination matrix
MJAPI void mj_addMSparse(const mjModel* m, mjData* d, mjtNum* dst,
int* rownnz, int* rowadr, int* colind, mjtNum* M,
int* M_rownnz, int* M_rowadr, int* M_colind);
int* rownnz, int* rowadr, int* colind, const mjtNum* M,
const int* M_rownnz, const int* M_rowadr, const int* M_colind);
// add inertia matrix to dense destination matrix
MJAPI void mj_addMDense(const mjModel* m, mjData* d, mjtNum* dst);