Function sequant::eval::detail::home_depth_of

Function Documentation

inline int sequant::eval::detail::home_depth_of(container::svector<Index> const &home_modes, BatchContext const &ectx) noexcept

Resolve a residency mode-set to an enclosing-batch-context loop depth.

Returns the deepest (innermost) level i of ectx whose loop mode ectx[i].first is a member of home_modes; -1 if no level matches (the cell is invariant to the whole nest &#8212; the chain root). Mirrors the runtime rl-walk at eval.hpp:1776-1782 verbatim (same innermost-to- outermost scan, same membership test), just against a caller-supplied mode-set instead of the sliced/contracted-modes union computed there.