20-Solving -linear-systems

20-Solving -linear-systems - Sparse/banded matrices...

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

View Full Document Right Arrow Icon
Sparse/banded matrices Performance Overdetermined systems Solving Linear Systems Dhavide Aruliah UOIT MATH 2070U c ± D. Aruliah (UOIT) Solving Linear Systems MATH 2070U 1 / 23 Sparse/banded matrices Performance Overdetermined systems Solving Linear Systems 1 Sparse and banded matrices 2 Performance of algorithms 3 Overdetermined systems of linear equations c ± D. Aruliah (UOIT) Solving Linear Systems MATH 2070U 2 / 23 Sparse/banded matrices Performance Overdetermined systems Banded matrices Definition (Banded matrix) A banded matrix with bandwidth k is a matrix A R m × n whose entries A i , j satisfy A i , j = 0 whenever | i - j | > k ( i = 1: m , j = 1: n ) Bandwidth k = 1: tridiagonal matrix Bandwidth k = 2: pentadiagonal matrix c ± D. Aruliah (UOIT) Solving Linear Systems MATH 2070U 4 / 23 Sparse/banded matrices Performance Overdetermined systems Examples Tridiagonal matrix 2 - 1 - 1 2 - 1 - 1 . . . . . . . . . 2 - 1 - 1 2 % Makes A3 tridiagonal N=100; e= ones(N-1,1); A3 = eye(N)-diag(e,-1); A3 = A3+A3’; Pentadiagonal matrix 6 - 4 - 1 - 4 6 - 4 . . . - 1 - 4 6 . . . - 1 . . . . . . . . . - 4 - 1 - 4 6 % Makes A5 pentadiagonal N=100; e= ones(N-1,1); A5 = 3*eye(N)-4*diag(e,-1); A5 = A5 - diag(e(1:N-2),-2); A5 = A5+A5’; c ± D. Aruliah (UOIT) Solving Linear Systems MATH 2070U 5 / 23
Background image of page 1

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

View Full DocumentRight Arrow Icon
Sparse/banded matrices Performance Overdetermined systems Sparse matrices Banded matrices characteristic of sparse matrices Sparse matrices : number nonzero elements ± m × n Store indices and values of nonzero elements only In M ATLAB , nnz = number of nonzero elements c ± D. Aruliah (UOIT) Solving Linear Systems MATH 2070U 6 / 23 Sparse/banded matrices Performance Overdetermined systems Example >> A3 = eye(100)-diag(ones(99,1),-1); >> A3 = A3+A3’; >> whos Name Size Bytes Class Attributes A3 100x100 80000 double >> A3 = sparse (A3); >> whos
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

20-Solving -linear-systems - Sparse/banded matrices...

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

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