Remove M matrix structure from mjData.
Introduced in March 2025 as a temporary measure, this is not considered a breaking change. PiperOrigin-RevId: 758311298 Change-Id: Ia08857c18b791f6a62a2d8d136b45fc075507b93
This commit is contained in:
committed by
Copybara-Service
parent
6bc0bbf7df
commit
1e02d66c3d
+1
-16
@@ -1141,9 +1141,6 @@ static void copyM2Sparse(const mjModel* m, mjData* d, int* dst, const int* src,
|
||||
if (reduced && !upper) {
|
||||
rownnz = d->C_rownnz;
|
||||
rowadr = d->C_rowadr;
|
||||
} else if (!reduced && !upper) {
|
||||
rownnz = d->M_rownnz;
|
||||
rowadr = d->M_rowadr;
|
||||
} else if (!reduced && upper) {
|
||||
rownnz = d->D_rownnz;
|
||||
rowadr = d->D_rowadr;
|
||||
@@ -1261,17 +1258,6 @@ static void makeDofDofmaps(const mjModel* m, mjData* d) {
|
||||
}
|
||||
}
|
||||
|
||||
// make mapM2M
|
||||
for (int i=0; i < nM; i++) d->mapM2M[i] = -1;
|
||||
copyM2Sparse(m, d, d->mapM2M, M, /*reduced=*/0, /*upper=*/0);
|
||||
|
||||
// check that all indices are filled in
|
||||
for (int i=0; i < nM; i++) {
|
||||
if (d->mapM2M[i] < 0) {
|
||||
mjERROR("unassigned index in mapM2M");
|
||||
}
|
||||
}
|
||||
|
||||
mj_freeStack(d);
|
||||
}
|
||||
|
||||
@@ -1989,8 +1975,7 @@ static void _resetData(const mjModel* m, mjData* d, unsigned char debug_value) {
|
||||
makeBSparse(m, d);
|
||||
checkDBSparse(m, d);
|
||||
|
||||
// make M, C
|
||||
makeDofDofSparse(m, d, d->M_rownnz, d->M_rowadr, NULL, d->M_colind, /*reduced=*/0, /*upper=*/0);
|
||||
// make C
|
||||
makeDofDofSparse(m, d, d->C_rownnz, d->C_rowadr, NULL, d->C_colind, /*reduced=*/1, /*upper=*/0);
|
||||
|
||||
// make index mappings: mapM2D, mapD2M, mapM2C, mapM2M
|
||||
|
||||
@@ -1160,37 +1160,6 @@ void mj_printFormattedData(const mjModel* m, const mjData* d, const char* filena
|
||||
}
|
||||
fprintf(fp, "\n\n");
|
||||
|
||||
// M sparse structure
|
||||
mj_printSparsity("M: inertia matrix", m->nv, m->nv, d->M_rowadr, NULL, d->M_rownnz,
|
||||
NULL, d->M_colind, fp);
|
||||
|
||||
fprintf(fp, NAME_FORMAT, "M_rownnz");
|
||||
for (int i = 0; i < m->nv; i++) {
|
||||
fprintf(fp, " %d", d->M_rownnz[i]);
|
||||
}
|
||||
fprintf(fp, "\n\n");
|
||||
|
||||
// M_rowadr
|
||||
fprintf(fp, NAME_FORMAT, "M_rowadr");
|
||||
for (int i = 0; i < m->nv; i++) {
|
||||
fprintf(fp, " %d", d->M_rowadr[i]);
|
||||
}
|
||||
fprintf(fp, "\n\n");
|
||||
|
||||
// M_colind
|
||||
fprintf(fp, NAME_FORMAT, "M_colind");
|
||||
for (int i = 0; i < m->nM; i++) {
|
||||
fprintf(fp, " %d", d->M_colind[i]);
|
||||
}
|
||||
fprintf(fp, "\n\n");
|
||||
|
||||
// mapM2M
|
||||
fprintf(fp, NAME_FORMAT, "mapM2M");
|
||||
for (int i = 0; i < m->nM; i++) {
|
||||
fprintf(fp, " %d", d->mapM2M[i]);
|
||||
}
|
||||
fprintf(fp, "\n\n");
|
||||
|
||||
// C sparse structure
|
||||
mj_printSparsity("C: reduced dof-dof matrix", m->nv, m->nv, d->C_rowadr, NULL, d->C_rownnz,
|
||||
NULL, d->C_colind, fp);
|
||||
|
||||
Reference in New Issue
Block a user