Template Function sequant::opt::detail::init_results

Function Documentation

template<typename TIdxs>
void sequant::opt::detail::init_results(TensorNetwork const &network, TIdxs const &tidxs, container::vector<OptRes> &results)

Seeds the DP table with per-subset open indices and singleton/empty ops counts.

For each subset i of the input tensors, computes the indices that remain open after evaluating that subset and stores them in results[i].indices. Initializes results[i].ops to 0 for empty and singleton subsets, and to max as a sentinel for subsets that will later be filled in by the DP. Singleton subsets also get their one-element sequence pre-populated.