Implement hash map for mj_name2id using djb2 and linear probing.
PiperOrigin-RevId: 499485127 Change-Id: I5aed6549db18b92d7c8a3b7590e50a00ce13a439
This commit is contained in:
committed by
Copybara-Service
parent
5261cceb30
commit
f1007df013
@@ -78,6 +78,9 @@ MJAPI int mj_jacDifPair(const mjModel* m, const mjData* d, int* chain,
|
||||
|
||||
//-------------------------- name functions --------------------------------------------------------
|
||||
|
||||
// get string hash, see http://www.cse.yorku.ca/~oz/hash.html
|
||||
uint64_t mj_hashdjb2(const char* s, uint64_t n);
|
||||
|
||||
// get id of object with specified name; -1: not found; type is mjtObj
|
||||
MJAPI int mj_name2id(const mjModel* m, int type, const char* name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user