Question: 1 ) copy your vector norm function here def VNorm ( v , p ) : nrm = 0 if p = = np .
copy your vector norm function here
def VNormvp:
nrm
if p npinf:
nrm npmaxnpabsv # Infinity norm max absolute value in v
else:
nrm npsumnpabsvpp # pnorm calculation
returnnrm
define a function
name : QRref
input : A d numpy array, size nxm
output : Q d numpy array, size nxn R d 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 nm
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 e
def QRrefA:
# add code here
returnQR
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
