Accounting
Analytical cost estimators for planning FLOP usage before you execute a counted operation.
Cost estimators
Analytical helpers for estimating FLOPs without executing a counted operation.
flopscope.accounting.bartlett_cost
Weighted FLOP cost of Bartlett window generation.
flopscope.accounting.blackman_cost
Weighted FLOP cost of Blackman window generation.
flopscope.accounting.cholesky_cost
Weighted FLOP cost of Cholesky decomposition.
flopscope.accounting.cond_cost
Weighted FLOP cost of condition number.
flopscope.accounting.det_cost
Weighted FLOP cost of determinant.
flopscope.accounting.eig_cost
Weighted FLOP cost of eigendecomposition.
flopscope.accounting.eigh_cost
Weighted FLOP cost of symmetric eigendecomposition.
flopscope.accounting.eigvals_cost
Weighted FLOP cost of computing eigenvalues.
flopscope.accounting.eigvalsh_cost
Weighted FLOP cost of computing eigenvalues of a symmetric matrix.
flopscope.accounting.einsum_cost
Weighted FLOP cost of an einsum operation.
flopscope.accounting.fft_cost
Weighted FLOP cost of a 1-D complex FFT.
flopscope.accounting.fftn_cost
Weighted FLOP cost of an N-D complex FFT.
flopscope.accounting.hamming_cost
Weighted FLOP cost of Hamming window generation.
flopscope.accounting.hanning_cost
Weighted FLOP cost of Hanning window generation.
flopscope.accounting.hfft_cost
Weighted FLOP cost of a Hermitian FFT.
flopscope.accounting.inv_cost
Weighted FLOP cost of matrix inverse.
flopscope.accounting.kaiser_cost
Weighted FLOP cost of Kaiser window generation.
flopscope.accounting.lstsq_cost
Weighted FLOP cost of least-squares via SVD.
flopscope.accounting.matrix_norm_cost
Weighted FLOP cost of matrix norm.
flopscope.accounting.matrix_power_cost
Weighted FLOP cost of matrix power ``A**k``.
flopscope.accounting.matrix_rank_cost
Weighted FLOP cost of matrix rank: values-only SVD + min(m, n) threshold compares.
flopscope.accounting.multi_dot_cost
Weighted FLOP cost of optimal matrix chain multiplication.
flopscope.accounting.norm_cost
Weighted FLOP cost of matrix or vector norm.
flopscope.accounting.pinv_cost
Weighted FLOP cost of Moore-Penrose pseudoinverse.
flopscope.accounting.pointwise_cost
Weighted FLOP cost of a pointwise operation.
flopscope.accounting.poly_cost
Cost for poly (1-D build-from-roots): ``(3*n^2 + n) // 2`` FLOPs.
flopscope.accounting.polyadd_cost
Cost for polyadd: max(n1, n2) FLOPs.
flopscope.accounting.polyder_cost
Cost for polyder: one multiply per surviving coefficient per derivative step.
flopscope.accounting.polydiv_cost
Cost for polydiv: 1 + Q*(2*n2 + 1), Q = max(n1-n2+1, 0) (work scales with
flopscope.accounting.polyfit_cost
Cost for polyfit: 2 * m * (deg+1)^2 FLOPs.
flopscope.accounting.polyint_cost
Cost for polyint: m*n + m*(m-1)//2 FLOPs.
flopscope.accounting.polymul_cost
Cost for polymul: 2*n1*n2 - n1 - n2 FLOPs (convolution, FMA=2).
flopscope.accounting.polysub_cost
Cost for polysub: max(n1, n2) FLOPs.
flopscope.accounting.polyval_cost
Cost for polyval: Horner's method under FMA=2 textbook convention.
flopscope.accounting.qr_cost
Weighted FLOP cost of QR decomposition (Householder, FMA=2).
flopscope.accounting.reduction_cost
Weighted FLOP cost of a reduction operation.
flopscope.accounting.rfft_cost
Weighted FLOP cost of a 1-D real FFT.
flopscope.accounting.rfftn_cost
Weighted FLOP cost of an N-D real FFT.
flopscope.accounting.roots_cost
Cost for roots: companion-matrix eigenvalues — delegates to
flopscope.accounting.slogdet_cost
Weighted FLOP cost of sign and log-determinant.
flopscope.accounting.solve_cost
Weighted FLOP cost of solving Ax = b: LU + two triangular solves (FMA=2).
flopscope.accounting.svd_cost
Weighted FLOP cost of an SVD (FMA=2, leading order).
flopscope.accounting.svdvals_cost
Weighted FLOP cost of computing singular values (values-only SVD).
flopscope.accounting.tensorinv_cost
Weighted FLOP cost of tensor inverse.
flopscope.accounting.tensorsolve_cost
Weighted FLOP cost of tensor solve.
flopscope.accounting.trace_cost
Weighted FLOP cost of matrix trace.
flopscope.accounting.unwrap_cost
Weighted FLOP cost of phase unwrapping.
flopscope.accounting.vector_norm_cost
Weighted FLOP cost of vector norm.