bundles / scipy 1.18.0 / scipy / linalg / blas / find_best_blas_type
function
scipy.linalg.blas:find_best_blas_type
source: /scipy/linalg/blas.py:289
Signature
def find_best_blas_type(arrays = (), dtype = None)Summary
Find best-matching BLAS/LAPACK type.
Extended Summary
Arrays are used to determine the optimal prefix of BLAS routines.
Parameters
arrays: sequence of ndarrays, optionalArrays can be given to determine optimal prefix of BLAS routines. If not given, double-precision routines will be used, otherwise the most generic type in arrays will be used.
dtype: str or dtype, optionalData-type specifier. Not used if
arraysis non-empty.
Returns
prefix: strBLAS/LAPACK prefix character.
dtype: dtypeInferred Numpy data type.
prefer_fortran: boolWhether to prefer Fortran order routines over C order.
Examples
import numpy as np import scipy.linalg.blas as bla rng = np.random.default_rng() a = rng.random((10,15)) b = np.asfortranarray(a) # Change the memory layout order bla.find_best_blas_type((a,)) bla.find_best_blas_type((a*1j,)) bla.find_best_blas_type((b,))✓
('d', dtype('float64'), True)
Aliases
scipy.linalg.find_best_blas_type