flopscope.

flopscope.accounting.cond_cost

flopscope.accounting.cond_cost(m, n, p=None)[flopscope source]

Weighted FLOP cost of condition number.

p in {None, 2, -2}: values-only SVD + 1 divide. other p (square only): norm(A)*norm(inv(A)) -> inv (2n^3) + two elementwise norm passes (2n^2 each) + 1 multiply.

Parameters

m:int

Number of rows in the input matrix.

n:int

Number of columns in the input matrix.

p:object, optional

Argument forwarded to the analytical linalg.cond cost formula. Defaults to None.

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.