flopscope.

flopscope.accounting.lstsq_cost

flopscope.accounting.lstsq_cost(m, n)[flopscope source]

Weighted FLOP cost of least-squares solution.

Parameters

m:int

Number of rows in the input matrix.

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.

NumPy uses LAPACK gelsd (SVD-based) by default.