Remove use of diagnum in solver

PiperOrigin-RevId: 759021147
Change-Id: I9e5c85b6542380780fc487781398f406ddaad51b
This commit is contained in:
Yuval Tassa
2025-05-15 00:38:33 -07:00
committed by Copybara-Service
parent dc4968506b
commit e8c566bee1
7 changed files with 0 additions and 34 deletions
-19
View File
@@ -544,25 +544,6 @@ void mj_island(const mjModel* m, mjData* d) {
d->iM, d->M);
mju_gather(d->iLDiagInv, d->qLDiagInv, d->map_idof2dof, nidof);
// compute iM_diagnum (dof_simplenum per island)
int count = 0;
int dof_next = d->map_idof2dof[nidof-1];
for (int i=nidof-1; i >= 0; i--) {
// check if island boundary was crossed
int dof = d->map_idof2dof[i];
int island_boundary = (d->dof_island[dof] != d->dof_island[dof_next]);
dof_next = dof;
// accumulate and set simple dof (diagonal row) counter
if (m->dof_simplenum[dof] && !island_boundary) {
count++; // increment counter
} else {
count = 0; // reset
}
d->iM_diagnum[i] = count;
}
// ------------------------------------- constraints ---------------------------------------------
-3
View File
@@ -786,7 +786,6 @@ struct _mjCGContext {
// inertia
const int* M_rownnz;
const int* M_rowadr;
const int* M_diagnum;
const int* M_colind;
const mjtNum* M;
const mjtNum* qLD;
@@ -888,7 +887,6 @@ static void CGpointers(const mjModel* m, const mjData* d, mjCGContext* ctx, int
// inertia
ctx->M_rownnz = d->M_rownnz;
ctx->M_rowadr = d->M_rowadr;
ctx->M_diagnum = m->dof_simplenum;
ctx->M_colind = d->M_colind;
ctx->M = d->M;
ctx->qLD = d->qLD;
@@ -937,7 +935,6 @@ static void CGpointers(const mjModel* m, const mjData* d, mjCGContext* ctx, int
// inertia
ctx->M_rownnz = d->iM_rownnz + idofadr;
ctx->M_rowadr = d->iM_rowadr + idofadr;
ctx->M_diagnum = d->iM_diagnum + idofadr;
ctx->M_colind = d->iM_colind;
ctx->M = d->iM;
ctx->qLD = d->iLD;