flopscope.

flopscope.accounting.cond_cost

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

Weighted FLOP cost of condition number.

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.

For p=None, p=2, or p=-2, computed via SVD (cost m*n*min(m,n)). For p=1, p=-1, p=inf, or p=-inf, computed via LU factorization (cost ~min(m,n)^3 + m*n for norm).