Add mju_fill, mju_symmetrize and mju_eye utility functions.

PiperOrigin-RevId: 484226916
Change-Id: I79593d54e903ddacab0f859bfc6d17eccad7d3a1
This commit is contained in:
Yuval Tassa
2022-10-27 05:27:46 -07:00
committed by Copybara-Service
parent 507b573763
commit f905c7fb7f
8 changed files with 202 additions and 6 deletions
+33
View File
@@ -5909,6 +5909,17 @@ mju_zero
Set res = 0.
.. _mju_fill:
mju_fill
~~~~~~~~
.. code-block:: C
void mju_fill(mjtNum* res, int n, mjtNum val);
Set res = val.
mju_copy
~~~~~~~~
@@ -6082,6 +6093,28 @@ mju_transpose
Transpose matrix: res = mat'.
.. _mju_symmetrize:
mju_symmetrize
~~~~~~~~~~~~~~
.. code-block:: C
void mju_symmetrize(mjtNum* mat, int n);
Symmetrize square matrix :math:`M = \frac{1}{2}(M + M^T)`.
.. _mju_eye:
mju_eye
~~~~~~~
.. code-block:: C
void mju_eye(mjtNum* mat, int n);
Set mat to the identity matrix.
.. _mju_mulMatMat:
mju_mulMatMat