Function sequant::mode_to_level_from_signature

Function Documentation

inline ModeToLevel sequant::mode_to_level_from_signature(std::size_t rank, container::svector<std::optional<std::size_t>> const &sig, container::svector<DagScopeLevel> const &levels)

Zips a slicing_signature (one entry per loop axis, in nest order) with the matching levels (same order) into a ModeToLevel sized to the node’s rank &#8212; the single point turning “positions of loop axes on a node” into “mode->level”.

Parameters:
  • rank – the node’s result rank (i.e. node->canon_indices().size()), used to size ModeToLevel::by_mode.

  • sig – a slicing signature (as returned by slicing_signature): one optional mode-position per loop axis.

  • levels – the DAG-scope loop level of each loop axis in sig, same size and order as sig.

Pre:

sig.size() == levels.size()