Template Function sequant::sum_in_place_traced

Function Documentation

template<Trace EvalTrace = Trace::Default, meta::can_evaluate Node, typename N, bool FHC>
ResultPtr sequant::sum_in_place_traced(Node const &node, ResultPtr left, ResultPtr const &right, CacheManager<N, FHC> &cache)

The in-place accumulating Sum: left += permute(right).

The zero-allocation fast path for a Sum marked accumulate_in_place, with the Permute and SumInplace trace events it carries. left is consumed (moved from and mutated), so the caller must have established that it is an evaluation-local buffer nobody else will read &#8212; that provenance gate stays at the call site, since the two callers answer it differently (evaluate_impl from the scope chain’s chain_holds_shared, the ordered executor from the cell table’s own remaining life via CellReadResolver::operand_drained).

Returns:

the (mutated) accumulator, in the node’s own oriented layout.