Implement sleeping in engine
PiperOrigin-RevId: 829361787 Change-Id: I6f64d8e25c4248cf32c18cd94d37ff5def78946e
This commit is contained in:
committed by
Copybara-Service
parent
1e0226d360
commit
769f37b653
@@ -142,6 +142,25 @@ void mju_sparse2dense(mjtNum* res, const mjtNum* mat, int nr, int nc,
|
||||
}
|
||||
|
||||
|
||||
// res[row, :] = mat[row, :]
|
||||
void mju_copySparse(mjtNum* res, const mjtNum* mat, const int* rownnz, const int* rowadr,
|
||||
const int* row, int nrow) {
|
||||
for (int i=0; i < nrow; i++) {
|
||||
int r = row[i];
|
||||
mju_copy(res + rowadr[r], mat + rowadr[r], rownnz[r]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// res[row, :] = 0
|
||||
void mju_zeroSparse(mjtNum* res, const int* rownnz, const int* rowadr, const int* row, int nrow) {
|
||||
for (int i=0; i < nrow; i++) {
|
||||
int r = row[i];
|
||||
mju_zero(res + rowadr[r], rownnz[r]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// multiply sparse matrix and dense vector: res = mat * vec.
|
||||
void mju_mulMatVecSparse(mjtNum* res, const mjtNum* mat, const mjtNum* vec,
|
||||
int nr, const int* rownnz, const int* rowadr,
|
||||
|
||||
Reference in New Issue
Block a user