def test_QR_Givens_Q_from_QR_Givens_orthogonal(): 'verify the orthogonality of the computed Q' np.random.seed(78) M = 6 N = 5 A = np.random.rand(M,N) qra.QR_Givens(A) Q = qra.Q_from_QR_Givens(A=A) aae(np.identity(M), np.dot(Q.T,Q), decimal=10)
def test_QR_Givens_Q_from_QR_Givens_decomposition(): 'verify the computed Q and R matrices' np.random.seed(7) M = 6 N = 5 A = np.random.rand(M,N) A2 = A.copy() qra.QR_Givens(A2) Q = qra.Q_from_QR_Givens(A=A2) R = np.triu(A2) aae(A, np.dot(Q, R), decimal=10)