scipy.linalg.orth
scipy.linalg.orth(A)
# 使用SVD方法创建 矩阵A的列向量张成的线性空间的一组正交基
# 参数:
# A (M,N)维矩阵
# 输入阵列
# 返回值:
# Q (M,K)维 ndarray类型数组
# 矩阵A的正交基
# K为矩阵A的秩
Example:
from scipy.linalg import orth
import numpy
A = numpy.random.rand(3,2);
B = orth(A);
print numpy.mat(B).T*B
print A
Output:
[[ 1.00000000e+00 -1.14363000e-16]
[ -1.14363000e-16 1.00000000e+00]]
[[ 0.19543851 0.96548966]
[ 0.78504714 0.11229334]
[ 0.61500054 0.64114533]]