To avoid excessive allocations in Hessian tracing, we can make a new set type holding a reference to a shared set, such that every intermediate scalar quantity shares the same pattern (as opposed to having individual patterns).
This would require:
Overloading trace_input so that each index x[i] points to the same shared set
Handling the empty set intelligently to avoid re-creating shared sets in operations like similar and rand
Once #103 is merged, overloading $\times$
Note that such shared objects would also be useful to implement tape-based recursive sets
To avoid excessive allocations in Hessian tracing, we can make a new set type holding a reference to a shared set, such that every intermediate scalar quantity shares the same pattern (as opposed to having individual patterns).
This would require:
trace_input
so that each indexx[i]
points to the same shared setsimilar
andrand
Note that such shared objects would also be useful to implement tape-based recursive sets