本文簡要介紹 python 語言中 scipy.linalg.null_space
的用法。
用法:
scipy.linalg.null_space(A, rcond=None)#
使用 SVD 構造 A 的零空間的標準正交基
- A: (M, N) 數組
輸入數組
- rcond: 浮點數,可選
相對條件數。小於
rcond * max(s)
的奇異值s
被視為零。默認值:浮點 eps * max(M,N)。
- Z: (N, K) 數組
A 的零空間的正交基。K = 有效零空間的維數,由 rcond 確定
參數 ::
返回 ::
例子:
一維零空間:
>>> import numpy as np >>> from scipy.linalg import null_space >>> A = np.array([[1, 1], [1, 1]]) >>> ns = null_space(A) >>> ns * np.copysign(1, ns[0,0]) # Remove the sign ambiguity of the vector array([[ 0.70710678], [-0.70710678]])
二維零空間:
>>> from numpy.random import default_rng >>> rng = default_rng() >>> B = rng.random((3, 5)) >>> Z = null_space(B) >>> Z.shape (5, 2) >>> np.allclose(B.dot(Z), 0) True
基向量是正交的(直到舍入誤差):
>>> Z.T.dot(Z) array([[ 1.00000000e+00, 6.92087741e-17], [ 6.92087741e-17, 1.00000000e+00]])
相關用法
- Python SciPy linalg.norm用法及代碼示例
- 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用法及代碼示例
注:本文由純淨天空篩選整理自scipy.org大神的英文原創作品 scipy.linalg.null_space。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。