bundles / scipy latest / scipy / linalg / lapack / _compute_lwork
function
scipy.linalg.lapack:_compute_lwork
source: build-install/usr/lib/python3.14/site-packages/scipy/linalg/lapack.py:1044
Signature
def _compute_lwork(routine, *args, **kwargs)Summary
Round floating-point lwork returned by lapack to integer.
Extended Summary
Several LAPACK routines compute optimal values for LWORK, which they return in a floating-point variable. However, for large values of LWORK, single-precision floating point is not sufficient to hold the exact value --- some LAPACK versions (<= 3.5.0 at least) truncate the returned integer to single precision and in some cases this can be smaller than the required value.
Examples
from scipy.linalg import lapack n = 5000 s_r, s_lw = lapack.get_lapack_funcs(('sysvx', 'sysvx_lwork')) lwork = lapack._compute_lwork(s_lw, n)✓
lwork
✗320000
Aliases
scipy.linalg._decomp._compute_lwork