CppAD: A C++ Algorithmic Differentiation Package  20171217
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
template<class Value >
unsigned short CppAD::hash_code ( const Value &  value)

General purpose hash code for an arbitrary value.

Template Parameters
Valueis the type of the argument being hash coded. It should be a plain old data class; i.e., the values included in the equality operator in the object and not pointed to by the object.
valuethe value that we are generating a hash code for. All of the fields in value should have been set before the hash code is computed (otherwise undefined values are used).
is a hash code that is between zero and CPPAD_HASH_TABLE_SIZE - 1.
Checked Assertions
  • std::numeric_limits<unsigned short>::max() >= CPPAD_HASH_TABLE_SIZE
  • sizeof(value) is even
  • sizeof(unsigned short) == 2

Definition at line 45 of file core/hash_code.hpp.

Referenced by CppAD::local::recorder< Base >::PutPar().