bundles / scipy 1.17.1 / scipy / linalg / blas / get_blas_funcs
function
scipy.linalg.blas:get_blas_funcs
source: /scipy/linalg/blas.py :422
Signature
def get_blas_funcs ( names , arrays = () , dtype = None , ilp64 = False ) Summary
Return available BLAS function objects from names.
Extended Summary
Arrays are used to determine the optimal prefix of BLAS routines.
Parameters
names: str or sequence of strName(s) of BLAS functions without type prefix.
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.ilp64: {True, False, 'preferred'}, optionalWhether to return ILP64 routine variant. Choosing 'preferred' returns ILP64 routine if available, and otherwise the 32-bit routine. Default: False
Returns
funcs: listList containing the found function(s).
Notes
This routine automatically chooses between Fortran/C interfaces. Fortran code is used whenever possible for arrays with column major order. In all other cases, C code is preferred.
In BLAS, the naming convention is that all functions start with a type prefix, which depends on the type of the principal matrix. These can be one of {'s', 'd', 'c', 'z'} for the NumPy types {float32, float64, complex64, complex128} respectively. The code and the dtype are stored in attributes typecode and dtype of the returned functions.
Examples
import numpy as np import scipy.linalg as LA rng = np.random.default_rng() a = rng.random((3,2)) x_gemv = LA.get_blas_funcs('gemv', (a,)) x_gemv.typecode x_gemv = LA.get_blas_funcs('gemv',(a*1j,)) x_gemv.typecode✓
Aliases
-
scipy.linalg.get_blas_funcs