scipy.linalg.diagsvd¶
- scipy.linalg.diagsvd(s, M, N)[源代码]¶
由奇异值和大小为M,N的奇异值构造奇异值分解中的σ矩阵。
- 参数
- s(M,)或(N,)类阵列
奇异值
- M集成
奇异值为 s 。
- N集成
奇异值为 s 。
- 退货
- S(M,N)ndarray
奇异值分解中的S-矩阵
示例
>>> from scipy.linalg import diagsvd >>> vals = np.array([1, 2, 3]) # The array representing the computed svd >>> diagsvd(vals, 3, 4) array([[1, 0, 0, 0], [0, 2, 0, 0], [0, 0, 3, 0]]) >>> diagsvd(vals, 4, 3) array([[1, 0, 0], [0, 2, 0], [0, 0, 3], [0, 0, 0]])