compileml.runtime — primitives

display_impacts

def display_impacts(c2: collections.abc.Sequence[int], full: int, fbase: int, residual2: int, ratio: int) -> list[int]

from compileml.runtime import display_impacts

Display-scale impacts that sum exactly to the display-scale target (§7.5).

Uses largest-remainder allocation: floor-divide every contribution, then hand out the missing units to the largest remainders (ties: lower index).

Parameters#

NameTypeDefaultKind
c2collections.abc.Sequence[int]requiredpositional
fullintrequiredpositional
fbaseintrequiredpositional
residual2intrequiredpositional
ratiointrequiredpositional

Returns#

list[int]