flopscope.accounting.solve_cost
flopscope.accounting.solve_cost(n, nrhs=1, symmetric=False)[flopscope source]
Weighted FLOP cost of solving Ax = b: LU + two triangular solves (FMA=2).
2n^3/3 (getrf) + 2n^2*nrhs (getrs). G&VL 4e §3.2. symmetric is
kept for API compatibility and ignored.
Parameters
- n:int
Number of columns in the input matrix.
- nrhs:int, optional
Argument forwarded to the analytical linalg.solve cost formula. Defaults to
1.- symmetric:bool, optional
Argument forwarded to the analytical linalg.solve 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.