PHYCS 3730/6720 Lab Exercise

Reading and references:
Answer file lab16.
Here we learn how to access LAPACK routines and use them to solve linear algebra problems. We will use LAPACK to solve the linear system
 Eqn (1)   2*x1 -   x2 +   x3 =  -1
 Eqn (2)   3*x1 + 3*x2 + 9*x3 =   0
 Eqn (3)   3*x1 + 3*x2 + 5*x3 =   4

Exercise 1. Finding the appropriate LAPACK routine

Read the course instructions for LAPACK given above. Then follow the instructions to find the appropriate double precision routine for solving a linear system Ax = b. (The answer is given in the instructions, but pretend you didn't know the answer and see if you can arrive at the same choice.) You should look at the system of equations to determine whether you are dealing with a banded, tridiagonal, symmetric, or general matrix.

In the answer file give the name of the routine you selected and the reason you selected it.


Exercise 2. Find the documentation

Find the documentation "abstract" for the chosen routine. This describes the purpose of each argument. Use the man pages, as explained in the "LAPACK instructions".

Nothing to hand in.


Exercise 3. Find the C++ declaration

Find the C++ declaration for the chosen routine.

Copy the C++ declaration to the answer file and make a table listing the arguments for the routine and their purpose.


Exercise 4. Write the code

OK, not for this exercise! But we will do something similar in the next assignment. The example code is given in the instructions, but please try to understand how the arguments are being declared and passed, how the input values are being assigned, and how the output values are extracted.

In your answer file, explain


Exercise 5. Compile and run the code

Be sure that LAPACK is installed on your machine. A simple test is to see if the directory /opt/SUNWspro exists. Then compile the example code, following the instructions given in the online notes above and run it with the example above to get the solution. For the long set of compiler options, it is best to copy and paste from the notes -- and be sure to put all the compiler options on the same line.

Copy your console session to the answer file, showing compilation and execution.