flopscope.

flopscope.accounting.roots_cost

flopscope.accounting.roots_cost(n)[flopscope source]

Cost for roots: companion-matrix eigenvalues — delegates to

eigvals_cost(n) (~10n^3; building the companion matrix itself is free). Includes runtime scaling; see docs/reference/cost-model.md.

Parameters

n:int

Number of columns in the input matrix.

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.