flopscope.

flopscope.accounting.inv_cost

flopscope.accounting.inv_cost(n, symmetric=False)[flopscope source]

Weighted FLOP cost of matrix inverse.

Parameters

n:int

Number of columns in the input matrix.

symmetric:bool, optional

Argument forwarded to the analytical linalg.inv cost formula. Defaults to False.

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.

Uses $n^3/3 + n^3$ for symmetric input (Cholesky factorization + n triangular solves against identity), or $n^3$ for general input (LU-based).