MCPcopy Create free account
hub / github.com/coin-or/CppAD / optimize_hash_code

Function optimize_hash_code

include/cppad/local/optimize/hash_code.hpp:33–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31*/
32
33inline size_t optimize_hash_code(
34 opcode_t op ,
35 size_t num_arg ,
36 const addr_t* arg )
37{ CPPAD_ASSERT_UNKNOWN( num_arg < 4 );
38 size_t prime = 1;
39 size_t sum = prime * size_t(op);
40 for(size_t i = 0; i < num_arg; i++)
41 { prime = prime + 2; // 3, 5, 7 in that order
42 sum += prime * size_t(arg[i]);
43 }
44 //
45 return sum % CPPAD_HASH_TABLE_SIZE;
46}
47
48} } } // END_CPPAD_LOCAL_OPTIMIZE_NAMESPACE
49

Callers 2

get_dyn_previousFunction · 0.85
match_opFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected