Convert qLD to CSR format.
PiperOrigin-RevId: 728196818 Change-Id: I31bdf32e251293284426ed345019f27fd051a0e1
This commit is contained in:
committed by
Copybara-Service
parent
9fb4ec95f8
commit
fb07e0d1f7
@@ -423,7 +423,8 @@ Get name of object with the specified mjtObj type and id, returns NULL if name n
|
||||
|
||||
.. mujoco-include:: mj_fullM
|
||||
|
||||
Convert sparse inertia matrix M into full (i.e. dense) matrix.
|
||||
Convert sparse inertia matrix ``M`` into full (i.e. dense) matrix.
|
||||
|br| ``dst`` must be of size ``nv x nv``, ``M`` must be of the same size as ``mjData.qM``.
|
||||
|
||||
.. _mj_mulM:
|
||||
|
||||
|
||||
@@ -233,6 +233,11 @@ found, the function will return ``distmax`` and ``fromto``, if given, will be se
|
||||
In order to determine whether a geom pair uses ``mjc_Convex``, inspect the table at the top of
|
||||
`engine_collision_driver.c <https://github.com/google-deepmind/mujoco/blob/main/src/engine/engine_collision_driver.c>`__.
|
||||
|
||||
.. _mj_fullM:
|
||||
|
||||
Convert sparse inertia matrix ``M`` into full (i.e. dense) matrix.
|
||||
|br| ``dst`` must be of size ``nv x nv``, ``M`` must be of the same size as ``mjData.qM``.
|
||||
|
||||
.. _mj_mulM:
|
||||
|
||||
This function multiplies the joint-space inertia matrix stored in mjData.qM by a vector. qM has a custom sparse format
|
||||
|
||||
@@ -272,7 +272,7 @@ struct mjData_ {
|
||||
mjtNum* qM; // total inertia (sparse) (nM x 1)
|
||||
|
||||
// computed by mj_fwdPosition/mj_factorM
|
||||
mjtNum* qLD; // L'*D*L factorization of M (sparse) (nM x 1)
|
||||
mjtNum* qLD; // L'*D*L factorization of M (sparse) (nC x 1)
|
||||
mjtNum* qLDiagInv; // 1/diag(D) (nv x 1)
|
||||
|
||||
// computed by mj_collisionTree
|
||||
@@ -305,7 +305,7 @@ struct mjData_ {
|
||||
mjtNum* subtree_angmom; // angular momentum about subtree com (nbody x 3)
|
||||
|
||||
// computed by mj_Euler or mj_implicit
|
||||
mjtNum* qH; // L'*D*L factorization of modified M (nM x 1)
|
||||
mjtNum* qH; // L'*D*L factorization of modified M (nC x 1)
|
||||
mjtNum* qHDiagInv; // 1/diag(D) of modified M (nv x 1)
|
||||
|
||||
// computed by mj_resetData
|
||||
|
||||
@@ -614,12 +614,14 @@ essential to keep it in mind at all times. All MuJoCo utility functions that ope
|
||||
:ref:`mju_mulMatMat`, :ref:`mju_mulMatVec` etc. assume this matrix layout. For vectors there is of course no
|
||||
difference between row-major and column-major formats.
|
||||
|
||||
.. TODO(tassa): update this section when qM is migrated to CSR.
|
||||
When possible, MuJoCo exploits sparsity. This can make all the difference between O(N) and O(N^3) scaling. The inertia
|
||||
matrix ``mjData.qM`` and its LTDL factorization ``mjData.qLD`` are always represented as sparse, using a custom
|
||||
indexing format designed for matrices that correspond to tree topology. The functions :ref:`mj_factorM`,
|
||||
:ref:`mj_solveM`, :ref:`mj_solveM2` and :ref:`mj_mulM` are used for sparse factorization, substitution and
|
||||
matrix-vector multiplication. The user can also convert these matrices to dense format with the function
|
||||
:ref:`mj_fullM` although MuJoCo never does that internally.
|
||||
matrix ``mjData.qM`` and its LTDL factorization ``mjData.qLD`` are always represented as sparse. ``qM`` uses a custom
|
||||
indexing format designed for matrices that correspond to tree topology, while ``qLD`` uses the standard CSR format.
|
||||
``qM`` will be migrated to CSR in and upcoming change. The functions :ref:`mj_factorM`, :ref:`mj_solveM`,
|
||||
:ref:`mj_solveM2` and :ref:`mj_mulM` are used for sparse factorization, substitution and matrix-vector multiplication.
|
||||
The user can also convert these matrices to dense format with the function :ref:`mj_fullM` although MuJoCo never does
|
||||
that internally.
|
||||
|
||||
The constraint Jacobian matrix ``mjData.efc_J`` is represented as sparse whenever the sparse Jacobian option is
|
||||
enabled. The function :ref:`mj_isSparse` can be used to determine if sparse format is currently in use. In that case
|
||||
|
||||
Reference in New Issue
Block a user