flopscope.accounting.polyint_cost
flopscope.accounting.polyint_cost(n, m=1)[flopscope source]
Cost for polyint: m*n + m*(m-1)//2 FLOPs.
numpy recurses m times; pass j divides n+j coefficients, so total cost = sum_{j=0}^{m-1} (n+j) = m*n + m*(m-1)//2.
Parameters
- n:int
Number of columns in the input matrix.
- m:int, optional
Number of rows in the input matrix. Defaults to
1.
Returns
- :int
Weighted public cost estimate, floored to match runtime accounting.
Notes
This helper multiplies the analytical FLOP count by the active weight from flopscope._weights and then applies int(...) so public estimates match budget deductions.