Refactor constraint island representation.

Required for constraint solver islanding.

Replace linked lists with `island_{dof,efc}_{num,adr,ind}`, corresponding to the standard `{rownnz,rowadr,colind}` sparse matrix representation. By effectively defining two sparse matrix structures of dimensions `nisland x nv` and `nisland x nefc`, respectively, this representation is more conducive to reuse of existing sparse matrix utility functions, while being cache-friendlier by making sequential indices adjacent in memory.

PiperOrigin-RevId: 559704957
Change-Id: I919362cbef0d5fe5acc4aa2bb4ffb17eee8223a2
This commit is contained in:
Yuval Tassa
2023-08-24 03:48:10 -07:00
committed by Copybara-Service
parent b92a9d599c
commit 1dad5993f0
11 changed files with 248 additions and 188 deletions
+7 -4
View File
@@ -1715,12 +1715,14 @@ public unsafe struct mjData_ {
public double* efc_D;
public double* efc_R;
public int* tendon_efcadr;
public int* island_dofadr;
public int* island_efcadr;
public int* dof_island;
public int* dof_islandnext;
public int* island_dofnum;
public int* island_dofadr;
public int* island_dofind;
public int* efc_island;
public int* efc_islandnext;
public int* island_efcnum;
public int* island_efcadr;
public int* island_efcind;
public int* efc_AR_rownnz;
public int* efc_AR_rowadr;
public int* efc_AR_colind;
@@ -2969,6 +2971,7 @@ public unsafe struct data {
public double* wrap_xpos;
public byte* bvh_active;
public int* island_dofadr;
public int* island_dofind;
public int* dof_island;
public int* efc_island;
public int* tendon_efcadr;