Ask Question, Ask an Expert


Ask Programming Language Expert


prepare a C function to solve the system of linear equations A x = y where A is an N by N matrix in the format of pointer-to-pointers and y is a vector in the format of a pointer. The function should return a pointer to the answer vector x . Your function should have the prototype:
                          double *Gaussian(double **,double *, int).
The function should implement the Gaussian Elimination Algorithm with Partial Pivoting.
Test your function on the system:



Amend your Gaussian elimination function to solve for multiple right hand sides (Simultaneous systems of equations). The prototype should be
                  double **GaussianS(double **,double **,int,int)
where the fourth argument is the number of right hand side vectors.


What is x ?

problem3) prepare a C function with prototype: double **Inverse(double **,int) to find the inverse of a matrix. Find the inverse of matrix A.


Speed in scientific computing is measured in megaflops, gigaflops, teraflops and petaflops. A megaflop is 106 floating point arithmetic operations (+, -, *, /) in one second What are a gigaflop, a teraflop and a petaflop? To determine the real megaflop rate of a given algorithm on a given computer you must first determine theoretically the total number of Floating point arithmetic operations the algorithm takes and then divide that by 106 times the total time taken to run the algorithm. Determine the speed of your matrix inverse function by timing how long it takes to invert a random matrix (you should use the function given in lecture to generate a random square matrix) of size N, where N takes the integer values:
i. 2 < =N < =50, (~50 values)
ii. N = {55, 60, 65, … 200} (~30 values in increments of 5)
iii. N = {225, 250, 275, … 1000} (~30 value in increments of 25)
iv. N = {1200, 1400, …,2000} (~10 values in increments of 200)
Plot Megaflops vs. ln2(N). {You may use Excel, Maple or any plotting package.}


Loop order, the exact form of the pointer and index arithmetic and the compiler and option flags set at compile time all can influence the speed of that a code runs. Experiment with improving your code’s running speed for the N=1000 Matrix Inverse case by trying variations of these. Rerun all of the cases from Section 4 using your new faster code. Insert OpenMP #pragma instructions. By what factor is your ‘best’ code faster than the ‘naive’ code your first wrote? The Intel MKL Library contains special routines to do common Numerical Linear Algebra tasks. It implements a Library called LAPACK efficiently. If you use the appropriate Intel MKL Lapack routines, how much does this speed up your code?
Time your fastest possible matrix inverse function. If you know that the right hand side of a set of simultaneous equations take the form of an identity matrix, what steps can to take to exploit this fact to reduce the total number of operations you must perform to find out the matrix inverse. Can you quantify the savings for a general N by N Inverse. Can you see these savings in reduced execution times? Produce timings for the set of matrix sizes used in Sections 4 above. Plot the results for running your fastest matrix inverter on one of the PCs in rooms 414 & 410 on one graph. If you have access to any other computer, include the speed curves for those machines on your graph as well. Can you describe the shapes of the curve?

problem6) The real discrete cosine transform (DCT) represents the data xi at N+1 discrete points as the sum of N+1 cosine functions of amplitude yj:

1838_cosine function.jpg

This relation may be thought of as a matrix linear equation: CN y’ = x , where x and y’ are vectors of size N+1 such that x = [ x0, x1, …,xN-1 , xN ] and y’ = [ ½ y0, y1,… ,yN-1 ,½ yN ], (or x = CN’ y ) {Note the notational convention to distinguish normal vectors x and vectors with their first and last entries halved: y’ } and CN is an N+1 by N+1 matrix whose i+1, j+1 th element is cos(ijπ/N). CN’ has entries of ½ down its first column and entries of (½ , -½, ½, -½, ….) down its last column. Solve the linear system CN’ y = x , when x = (0, 1, 2, 3, 4, 5, … , N) for N = 64, 256 & 1024. Not counting the time it takes to generate the CN’ matrix, how long does your code take for each of these three systems? How accurate are your answers?

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M9354

Have any Question? 

Related Questions in Programming Language

1 loops the greatest and the least- write a program with a

1. Loops: The greatest and the least- Write a program with a loop that lets the user to enter a series of integers. The use should enter -99 to signal the end of the series. After all the numbers have been entered, the p ...

Assignmentcase problem1 - online trivia found on pages

Assignment: Case Problem1 - Online Trivia found on pages 794-795 of your textbook. Complete the web pages and upload them to your 000WebHost account. After uploading the files make sure to update your index.html page to ...

Electrical engineering computer methods assignmentq1 write

Electrical Engineering Computer Methods Assignment Q1. Write a program that given the following array, reverses all array elements and then prints them. int x[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; Q2. Write a program to d ...

The briefyour small development team of ideally three

The Brief Your small development team of (ideally) three people has been asked to implement and test the Human Resource Information System desktop application. Your software product will be a database- backed desktop app ...

Engineering programmingi need this now please accurate

Engineering programming I need this now please accurate answers and must be high rated Problem #1 Write a program that asks the user to input the number of miles and convert the miles to kilometers, and then print the ou ...

Programming lab assignment set awhat to submitcomplete

Programming Lab Assignment (Set A) What to Submit Complete Problem Solving Steps 1 - 3 (check plan, data analysis, initial algorithm, and refinement algorithm) for the following programs. 1. (Name: lab1a-1.cpp) Write a p ...

Assignmentthis assignment will be marked out of 100 and

Assignment This assignment will be marked out of 100 and carries 30% of the overall module weighting. Your .java files and report for this part must be uploaded to WebLearn and submitted by 3pm on Wednesday 27th April 20 ...

Write a program to test for the case of a math equation

Write a program to test for the case of a math equation entered via the keyboard using the SWITCH-CASE operator. Types of equations to test for: x + y  x / y   x * y and x - y. The program is to ask for the following: 1. ...

The given machine description will provide the basis for

The given machine description will provide the basis for this assignment. You will create a virtual machine/operating system for the machine described below that will accept programs in the target machine language. The d ...

Write a program that calculates several possible tips to

Write a program that calculates several possible tips to give to a waiter at a restaurant. Ask the user to enter the total cost of the meal and then calculate a tip at 10%, 12.5%, 15%, 17.5%, and 20%. Write the original ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate