本文簡要介紹 python 語言中 scipy.sparse.linalg.aslinearoperator
的用法。
用法:
scipy.sparse.linalg.aslinearoperator(A)#
將 A 作為 LinearOperator 返回。
ndarray
matrix
稀疏矩陣(例如csr_matrix、lil_matrix等)
LinearOperator
具有 .shape 和 .matvec 屬性的對象
“A”可以是以下任何一種類型::
有關更多信息,請參閱LinearOperator 文檔。
注意:
如果“A”沒有 .dtype 屬性,則通過調用
LinearOperator.matvec
確定數據類型 - 設置 .dtype 屬性以防止在創建線性運算符時進行此調用。例子:
>>> import numpy as np >>> from scipy.sparse.linalg import aslinearoperator >>> M = np.array([[1,2,3],[4,5,6]], dtype=np.int32) >>> aslinearoperator(M) <2x3 MatrixLinearOperator with dtype=int32>
相關用法
- 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用法及代碼示例
- Python SciPy linalg.use_solver用法及代碼示例
- Python SciPy linalg.qr_multiply用法及代碼示例
- Python SciPy linalg.spsolve用法及代碼示例
注:本文由純淨天空篩選整理自scipy.org大神的英文原創作品 scipy.sparse.linalg.aslinearoperator。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。