Speed up mju_cholUpdateSparse by not checking for varying sparsity pattern where it is guaranteed to not vary.

PiperOrigin-RevId: 720126576
Change-Id: I3a43bdd0259656fab462b1cd155cb422982e970d
This commit is contained in:
Yuval Tassa
2025-01-27 05:05:57 -08:00
committed by Copybara-Service
parent 4ab274aea9
commit d86900aac1
4 changed files with 8 additions and 13 deletions
+1 -1
View File
@@ -298,7 +298,7 @@ int mju_combineSparse(mjtNum* dst, const mjtNum* src, mjtNum a, mjtNum b,
// incomplete combine sparse: dst = a*dst + b*src at common indices
void mju_combineSparseInc(mjtNum* dst, const mjtNum* src, int n, mjtNum a, mjtNum b,
int dst_nnz, int src_nnz, int* dst_ind, const int* src_ind) {
int dst_nnz, int src_nnz, const int* dst_ind, const int* src_ind) {
// check for identical pattern
if (dst_nnz == src_nnz) {
if (mju_compare(dst_ind, src_ind, dst_nnz)) {