Template Function sequant::opt::detail::inner_aware_volume¶
Defined in File single_term_detail.hpp
Function Documentation¶
-
template<typename Tot, typename Ixex, typename InnerPow>
double sequant::opt::detail::inner_aware_volume(Tot const &tot_idxs, Ixex const &ixex, InnerPow const &inner_pow)¶ Composite-aware extent product of a tot_indices split.
Multiplies the extents of the outer indices (via
ixex) by the extents of the inner (CSV/PNO tensor-of-tensor) composites. Shared by all cost counters (flops_counter, memsize_counter, footprint_counter) so every objective sizes CSV/PNO composites identically.Note
When
inner_powis empty, composites fall back toixex(i.e.k=1), reproducing a single grid-averaged extent per composite, which under-counts multi-composite tensors: for heavy-tailed domains the mean of d^k far exceeds the k-th power of the mean of d.- Parameters:
tot_idxs – a tot_indices split (
outerplusinnercomposites).ixex – invocable mapping an Index to its extent (sizes
outerand, wheninner_powis empty,innertoo).inner_pow – optional invocable
(composite, k) -> doublegiving the size of a composite that shares its proto-index set withkcomposites in the same tensor (the k-th power mean of the per-pair domain). When non-empty, composites are grouped by proto-index set and each member of a k-group is sized byinner_pow(composite, k); the outernocc^Ntimes the group product then equals the true block-sparse volumeSum_pairsd^k.
- Returns:
the extent product (element count).