Question: 1 ) copy your vector norm function here def VNorm ( v , p ) : nrm = 0 if p = = np .

1) copy your vector norm function here
def VNorm(v,p):
nrm =0
if p == np.inf:
nrm = np.max(np.abs(v)) # Infinity norm (max absolute value in v)
else:
nrm = np.sum(np.abs(v)**p)**(1/p) # p-norm calculation
return(nrm)
2) define a function
name : QRref
input : A (2d numpy array, size nxm)
output : Q (2d numpy array, size nxn), R (2d numpy array, size nxm)
note : A = QR is the QR decomposition of A
note : The function should work for any size rectangular array
note : You may assume A is full rank and n>m
note : Use reflectors to compute the decomposition
note : Use a conditional to check if a column (below the diagonal) is nearly zero (check the vector norm) before applying a reflector. Use a tolerance of 1e-15.
def QRref(A):
# add code here
return(Q,R)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!