Question: Function givens ( A , i , k ) . The function takes a matrix of size m times n , m n and
Function givensAik The function takes a matrix of size m times n m n and returns the Givens rotation Rik such that the multiplication RT A annihilates theelement in the ith column and kth row. Function householderx that takes a vector x from the space Rm and computes the Householder reflection P such that it annihilates all components of the vector except the first one. Function specialQRA extended that takes a matrix A Rmtimes n and a logical value extended. It calculates the QR decomposition of matrix A as follows:a Iterate through all columns of matrix Ab For each column, check how many nonzero elements are below the main diago nal. If there is only one nonzero element, eliminate it using a Givens rotation; otherwise, use Householder reflection.c Return the matrices Q and R If the value of the extended is true, return the extended QR decomposition; otherwise, return the regular QR decomposition.
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
