本文簡要介紹 python 語言中 scipy.sparse.linalg.expm
的用法。
用法:
scipy.sparse.linalg.expm(A)#
使用 Pade 近似計算矩陣 index 。
- A: (M,M) 數組 或稀疏矩陣
要取冪的二維數組或矩陣(稀疏或密集)
- expA: (M,M) 數組
A的矩陣 index
參數 ::
返回 ::
注意:
這是算法(6.1),它是算法(5.1)的簡化。
參考:
[1]Awad H. Al-Mohy 和 Nicholas J. Higham (2009) “矩陣 index 的新縮放和平方算法”。 SIAM 矩陣分析和應用雜誌。 31(3)。第 970-989 頁。 ISSN 1095-7162
例子:
>>> from scipy.sparse import csc_matrix >>> from scipy.sparse.linalg import expm >>> A = csc_matrix([[1, 0, 0], [0, 2, 0], [0, 0, 3]]) >>> A.toarray() array([[1, 0, 0], [0, 2, 0], [0, 0, 3]], dtype=int64) >>> Aexp = expm(A) >>> Aexp <3x3 sparse matrix of type '<class 'numpy.float64'>' with 3 stored elements in Compressed Sparse Column format> >>> Aexp.toarray() array([[ 2.71828183, 0. , 0. ], [ 0. , 7.3890561 , 0. ], [ 0. , 0. , 20.08553692]])
相關用法
- Python SciPy linalg.expm用法及代碼示例
- Python SciPy linalg.expm_multiply用法及代碼示例
- Python SciPy linalg.expm_frechet用法及代碼示例
- Python SciPy linalg.expm_cond用法及代碼示例
- Python SciPy linalg.eigvalsh_tridiagonal用法及代碼示例
- Python SciPy linalg.eig_banded用法及代碼示例
- Python SciPy linalg.eigvalsh用法及代碼示例
- Python SciPy linalg.eigh_tridiagonal用法及代碼示例
- Python SciPy linalg.eig用法及代碼示例
- Python SciPy linalg.eigh用法及代碼示例
- Python SciPy linalg.eigs用法及代碼示例
- Python SciPy linalg.eigvals用法及代碼示例
- Python SciPy linalg.eigvals_banded用法及代碼示例
- Python SciPy linalg.eigsh用法及代碼示例
- 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用法及代碼示例
注:本文由純淨天空篩選整理自scipy.org大神的英文原創作品 scipy.sparse.linalg.expm。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。