【PLA】基于Python实现的线性代数算法库之QR分解
作者:互联网
【PLA】基于Python实现的线性代数算法库之QR分解
算法包下载链接:https://download.csdn.net/download/qq_42629529/79481514
from PLA.Matrix import Matrix
from PLA.GramSchmidtProcess import qr
if __name__ == "__main__":
#1
A1 = Matrix([[1, 1, 2],
[1, 1, 0],
[1, 0, 0]])
Q1, R1 = qr(A1)
print(Q1)
print(R1)
print(Q1.dot(R1))
print()
#2
A2 = Matrix([[2, -1, -1],
[2, 0, 2],
[2, -1, 3]])
Q2, R2 = qr(A2)
print(Q2)
print(R2)
print(Q2.dot(R2))
标签:__,Q1,QR,Matrix,Python,Q2,PLA,print 来源: https://blog.csdn.net/qq_42629529/article/details/122800546