mju_boxQP only reads from the lower triangle of the input Hessian.

- Before this change, an asymmetric Hessian would lead to solver failure. After this change the Hessian is symmetric by definition (upper triangle is ignored).
- API documentation was updated to reflect this contract.

PiperOrigin-RevId: 477135411
Change-Id: I60d011d36853afebac26c359771c217baf101360
This commit is contained in:
Yuval Tassa
2022-09-27 04:32:00 -07:00
committed by Copybara-Service
parent f433776c9b
commit a6b338db64
5 changed files with 42 additions and 4 deletions
+1
View File
@@ -1032,6 +1032,7 @@ MJAPI int mju_eig3(mjtNum eigval[3], mjtNum eigvec[9], mjtNum quat[4], const mjt
// the initial value of res is used to warmstart the solver
// R must have allocatd size n*(n+7), but only nfree*nfree values are used in output
// index (if given) must have allocated size n, but only nfree values are used in output
// only the lower triangles of H and R and are read from and written to, respectively
// the convenience function mju_boxQPmalloc allocates the required data structures
MJAPI int mju_boxQP(mjtNum* res, mjtNum* R, int* index, const mjtNum* H, const mjtNum* g, int n,
const mjtNum* lower, const mjtNum* upper);