This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Lab # 2 Using Library Routines to Solve Linear Systems Goals: Oftentimes we are working on a project which requires using standard library routines. It is useful to gain experience with using these routines because usually they have been optimized and, in addition, many times we dont have time to write our own codes to do basic linear algebra computations. In this lab you will get experience using library routines which implement direct solvers for obtaining the solution to linear systems and learn to choose the correct algorithm based on the structure of your matrix. Due: Monday, January 31 1. The goal of this problem is to solve a general n n linear system using a standard library routine from lapack . In this case we are only interested in solving one linear system so we will use the routine dgesv . A good source of library routines is netlib which is run jointly by Oak Ridge National Laboratory and the University of Tennessee, Knoxville. You can do a search to find it. However, the fortran versions of the lapack library routines are actually available on the classroom machines, in the hall and on pamd . These codes were written in the 1970s and were updated at a later date to optimize them but they are in fortran. Individuals have converted them to C but Id recommend (not require) using the fortran versions. You can call a fortran routine from a C++ code, but I recommend doing this coding assignment in fortran because the arrays are stored in a natural way. You can access these routines by using the gfortran command gfortran myprog . f90- l lapack If you are using the C versions or on a machine where they are not available, then you can download the code plus its dependencies from netlib. Occasionally there will be some otherfrom netlib....
View Full Document
- Spring '11
- right hand, Howard Staunton, library routines, total bandwidth, LAPACK