Move square root of Delassus matrix from stack to arena

PiperOrigin-RevId: 916852244
Change-Id: I4379553f808d0b238a1421606f806ea2d0a33d7c
This commit is contained in:
Yuval Tassa
2026-05-17 11:21:07 -07:00
committed by Copybara-Service
parent 2345663efb
commit 04042d8bf3
11 changed files with 294 additions and 188 deletions
+6 -1
View File
@@ -225,6 +225,7 @@ struct mjData_ {
int nl; // number of limit constraints
int nefc; // number of constraints
int nJ; // number of non-zeros in constraint Jacobian
int nY; // number of non-zeros in constraint inverse inertia square root
int nA; // number of non-zeros in constraint inverse inertia matrix
int nisland; // number of detected constraint islands
int nidof; // number of dofs in all islands
@@ -479,8 +480,12 @@ struct mjData_ {
mjtNum* iefc_R; // inverse constraint mass (nefc x 1)
// computed by mj_projectConstraint (PGS solver)
int* efc_Y_rownnz; // number of non-zeros in Y row (nefc x 1)
int* efc_Y_rowadr; // row start address in Y colind array (nefc x 1)
int* efc_Y_colind; // column indices in sparse Y (nY x 1)
mjtNum* efc_Y; // whitened Jacobian Y = J*M^(-1/2) (nY x 1)
int* efc_AR_rownnz; // number of non-zeros in AR (nefc x 1)
int* efc_AR_rowadr; // row start address in colind array (nefc x 1)
int* efc_AR_rowadr; // row start address in AR colind array (nefc x 1)
int* efc_AR_colind; // column indices in sparse AR (nA x 1)
mjtNum* efc_AR; // J*inv(M)*J' + R (nA x 1)
+5
View File
@@ -946,6 +946,10 @@
// array fields of mjData that are used in the dual problem
#define MJDATA_ARENA_POINTERS_DUAL \
XNV( int, efc_Y_rownnz, MJ_D(nefc), 1 ) \
XNV( int, efc_Y_rowadr, MJ_D(nefc), 1 ) \
XNV( int, efc_Y_colind, MJ_D(nY), 1 ) \
XNV( mjtNum, efc_Y, MJ_D(nY), 1 ) \
XNV( int, efc_AR_rownnz, MJ_D(nefc), 1 ) \
XNV( int, efc_AR_rowadr, MJ_D(nefc), 1 ) \
XNV( int, efc_AR_colind, MJ_D(nA), 1 ) \
@@ -1020,6 +1024,7 @@
X( int, nl ) \
X( int, nefc ) \
X( int, nJ ) \
X( int, nY ) \
X( int, nA ) \
X( int, nisland ) \
X( int, nidof ) \