def ls_fast_givens(A, b):
m = A.shape[0]
n = A.shape[1]
if rank(A) < n:
raise Exception('Rank deficient')
S = qr.qr_fast_givens(A)
M^T = np.dot(S, la.inv(A))
b = M^T.dot(b)
x_ls = la.solve(S[:n, :n], b[:n])
return x_ls
评论列表
文章目录