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#
| Name | Type | Default | Kind |
|---|---|---|---|
| c2 | collections.abc.Sequence[int] | required | positional |
| full | int | required | positional |
| fbase | int | required | positional |
| residual2 | int | required | positional |
| ratio | int | required | positional |
Returns#
list[int]