Add internal utility for zeroing int vectors.
PiperOrigin-RevId: 562608956 Change-Id: I25ff1bbf9abf8fe2a636ed1d728d10ae862e04c9
This commit is contained in:
committed by
Copybara-Service
parent
1aa375ef9a
commit
9308e1d383
@@ -1207,6 +1207,15 @@ int mju_isZero(mjtNum* vec, int n) {
|
||||
|
||||
|
||||
|
||||
// set integer vector to 0
|
||||
void mju_zeroInt(int* res, int n) {
|
||||
if (n > 0) {
|
||||
memset(res, 0, n*sizeof(int));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// standard normal random number generator (optional second number)
|
||||
mjtNum mju_standardNormal(mjtNum* num2) {
|
||||
const mjtNum scale = 2.0/((mjtNum)RAND_MAX);
|
||||
|
||||
Reference in New Issue
Block a user