This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: AMSC/CMSC 660 Scientific Computing I Fall 2006 Dense Matrix Computations Dianne P. O’Leary c ° 2002,2004, 2006 Goals We’ll consider computations involving dense matrices, those that don’t have a large number of zero elements. We need to 1. be able to efficiently manipulate matrices on computers. 2. be able to choose the right decomposition for a given task. The Plan • Matrix manipulation – how matrices are stored on computers – basic tools for matrix manipulation: the BLAS • Matrix decompositions and their uses – LU – QR Case study: data fitting – rankrevealing QR – eigendecomposition Case study: matrix stability – SVD Case study: solving integral equations • Updating decompositions • Some tasks to avoid – matrix inverse – the matrix permanent – Jordan canonical form • Software 1 Notation • All vectors are column vectors. • Matrices are upper case letters; vectors and scalars are lower case. • The elements of a matrix or vector will be denoted by subscripted values: the element of A in row i and column j is a ij or A ( i,j ) . • The elements of matrices and vectors can be real or complex numbers. • I is the identity matrix and e i is the i th unit vector, the i th column of I . • B = A T means that B is the transpose of A : b ij = a ji . • B = A * means that B is the complex conjugate transpose of A : b ij = ¯ a ji . • We’ll also use Matlab notation when convenient. For example, A ( i : j,k : ‘ ) denotes the submatrix of A with row entries between i and j and column entries between k and ‘ (inclusive), and A (: , 5) denotes column 5 of the matrix A . • An orthogonal matrix U satisfies the relation U T U = I . • A unitary matrix U satisfies the relation U * U = I . Aside: Quantum computers are implementations of matrix multiplication by a unitary matrix. • For any nonsingular matrix X , the matrix XAX 1 is a similarity transform of A . Matrix manipulation See Chapter 3. How matrices are stored on computers It turns out that programmers of matrix algorithms need to design their algorithms based on how matrices are stored. We’ll illustrate the idea using a simple algorithm, matrixvector product . Matrixvector multiplication Suppose we have an m × n matrix A and an n × 1 vector x , and we wish to form y = Ax . 2 • The vector y is defined by dot products between rows of A and x : y i = A ( i, :) * x . Expressed elementbyelement, the algorithm is [m,n]=size(A); y = zeros(m,1); for i=1:m, for j=1:n, y(i) = y(i) + A(i,j)*x(j); end end • We can also express Ax in a columnoriented way, using saxpy s: Ax = x (1) * A (: , 1) + x (2) * A (: , 2) + ... + x ( n ) * A (: ,n ) . This can be implemented elementbyelement as [m,n]=size(A); y = zeros(m,1); for j=1:n, for i=1:m, y(i) = y(i) + A(i,j)*x(j); end end What difference does it make?...
View
Full Document
 Fall '06
 oleary

Click to edit the document details