Prev | Next | base_hash |
code = hash_code(x)
Base
type values when recording
AD<Base>
operations.
A hashing function is used to reduce number of values stored in this table;
for example, it is not necessary to store the value 3.0 every
time it is used as a parameter
.
Base
value.
In most cases this works well, but in some cases
it does not. For example, in the
base_adolc.hpp
case, an adouble
value can have
fields that are not initialized and valgrind
reported an error
when these are used to form the hash code.
const Base& x
It is the value we are forming a hash code for.
code
has prototype
unsigned short code
It is the hash code corresponding to
x
. This intention is the
commonly used values will have different hash codes.
The hash code must satisfy
code < CPPAD_HASH_TABLE_SIZE
so that it is a valid index into the hash code table.
inline
,
so that you do not get multiple definitions from different compilation units.
base_alloc
hash_code
and the adouble
hash_code
.