lect2 - AMSC/CMSC 660 Scientific Computing I Fall 2006...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: AMSC/CMSC 660 Scientific Computing I Fall 2006 Dense Matrix Computations Dianne P. OLeary c 2002,2004, 2006 Goals Well consider computations involving dense matrices, those that dont 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 rank-revealing 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 . Well 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. Well illustrate the idea using a simple algorithm, matrix-vector product . Matrix-vector 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 element-by-element, 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 column-oriented way, using saxpy s: Ax = x (1) * A (: , 1) + x (2) * A (: , 2) + ... + x ( n ) * A (: ,n ) . This can be implemented element-by-element 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

This note was uploaded on 02/05/2008 for the course CMSC 660 taught by Professor Oleary during the Fall '06 term at Maryland.

Page1 / 25

lect2 - AMSC/CMSC 660 Scientific Computing I Fall 2006...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online