Struct zero_footprint

Struct Documentation

struct zero_footprint

Make a cache manager that distinguishes persistent (P) from non-persistent (NP) intermediates, deriving persistence from a solver-supplied volatility predicate and the evaluation DAG.

A node is volatile (V) if its value changes between evaluations (e.g. it depends on the amplitudes being solved). is_volatile flags intrinsically volatile nodes (typically the amplitude leaves); volatility is then propagated up the DAG (a node is V iff it is intrinsically volatile or any child is V). Persistence is derived from volatility and the consumer (parent) relationship:

  • V node -> NP (released after last use)

  • NV node with >=1 V consumer -> P (the NV/V frontier: constant data feeding per-iteration work; kept across evaluations)

  • NV node with no V consumer -> NP (only feeds other NV nodes, so it is absorbed into them and not needed across evaluations)

Only internal (non-leaf) nodes are cached: NP nodes that repeat at least min_repeats times (the usual CSE rule), plus all P nodes regardless of repeat count (a P node is reused across evaluations even if used once each).

Default footprint accessor for cache_manager: reports zero footprint for every node, so the footprint gate is inert (combined with max_footprint==0).

Public Functions

inline double operator()(auto const&) const noexcept