本文簡要介紹 python 語言中 scipy.linalg.get_blas_funcs
的用法。
用法:
scipy.linalg.get_blas_funcs(names, arrays=(), dtype=None, ilp64=False)#
從名稱中返回可用的 BLAS 函數對象。
數組用於確定 BLAS 例程的最佳前綴。
- names: str 或 str 序列
沒有類型前綴的 BLAS 函數的名稱。
- arrays: ndarrays 序列,可選
可以給出數組來確定 BLAS 例程的最佳前綴。如果沒有給出,將使用雙精度例程,否則將使用數組中最通用的類型。
- dtype: str 或 dtype,可選
數據類型說明符。如果數組非空,則不使用。
- ilp64: {真,假,‘preferred’},可選
是否返回 ILP64 例程變體。選擇 ‘preferred’ 返回 ILP64 例程(如果可用),否則返回 32 位例程。默認值:假
- funcs: 列表
包含找到的函數的列表。
參數 ::
返回 ::
注意:
該例程自動在 Fortran/C 接口之間進行選擇。 Fortran 代碼盡可能用於具有列主順序的數組。在所有其他情況下,首選 C 代碼。
在 BLAS 中,命名約定是所有函數都以類型前綴開頭,這取決於主矩陣的類型。這些可以分別是 NumPy 類型 {float32、float64、complex64、complex128} 的 {‘s’, ‘d’, ‘c’, ‘z’} 之一。 code 和 dtype 存儲在返回函數的屬性 typecode 和 dtype 中。
例子:
>>> 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 'd' >>> x_gemv = LA.get_blas_funcs('gemv',(a*1j,)) >>> x_gemv.typecode 'z'
相關用法
- Python SciPy linalg.get_lapack_funcs用法及代碼示例
- Python SciPy linalg.gcrotmk用法及代碼示例
- Python SciPy linalg.gmres用法及代碼示例
- Python SciPy linalg.eigvalsh_tridiagonal用法及代碼示例
- Python SciPy linalg.cdf2rdf用法及代碼示例
- Python SciPy linalg.LaplacianNd用法及代碼示例
- Python SciPy linalg.solve_circulant用法及代碼示例
- Python SciPy linalg.polar用法及代碼示例
- Python SciPy linalg.clarkson_woodruff_transform用法及代碼示例
- Python SciPy linalg.rsf2csf用法及代碼示例
- Python SciPy linalg.hessenberg用法及代碼示例
- Python SciPy linalg.tril用法及代碼示例
- Python SciPy linalg.triu用法及代碼示例
- Python SciPy linalg.svd用法及代碼示例
- Python SciPy linalg.ishermitian用法及代碼示例
- Python SciPy linalg.invhilbert用法及代碼示例
- Python SciPy linalg.factorized用法及代碼示例
- Python SciPy linalg.lu_factor用法及代碼示例
- Python SciPy linalg.SuperLU用法及代碼示例
- Python SciPy linalg.lsqr用法及代碼示例
- Python SciPy linalg.cho_factor用法及代碼示例
- Python SciPy linalg.fractional_matrix_power用法及代碼示例
- Python SciPy linalg.eig_banded用法及代碼示例
- Python SciPy linalg.tanhm用法及代碼示例
- Python SciPy linalg.orthogonal_procrustes用法及代碼示例
注:本文由純淨天空篩選整理自scipy.org大神的英文原創作品 scipy.linalg.get_blas_funcs。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。