Question: We saw in lectures that computing the LU-factorization of an nxn matrix costs about 2n/3 flops, whereas computing the Cholesky factorization of an nxn symmetric

 We saw in lectures that computing the LU-factorization of an nxn

We saw in lectures that computing the LU-factorization of an nxn matrix costs about 2n/3 flops, whereas computing the Cholesky factorization of an nxn symmetric positive-definite matrix costs about n/3 flops. Write a script that does the following tasks. 1. Set n=3000. 2. Construct an nxn symmetric positive-definite matrix A of the form A= al + BTB with a > 0 which is symmetric and positive-definite. Here, we choose a=0.5 and B = wilkinson(n), with B being a Wilkinson's test matrix. is an upper 3. Compute the LU factorization of A and store the results into two matrices L and u, where L is a unit lower triangular matrix and triangular matrix. 4. Compute the Cholesky factorization of A and store the result in the matrix R. 5. Print out the CPU times taken by lu and chol to factor A. Use tic and toc commands to measure the CPU times. Do these times reflect the numbers of flops needed in each case

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 Databases Questions!