复旦大学:《Matlab》(ppt实验英文版)Chapter 5 Matrix computations

Introduction to scientific Computing A Matrix Vector Approach Using Matlab Written by Charles FVan Loan 陈文斌 Wbchen(fudan. edu. cn 复日大学
Introduction to Scientific Computing -- A Matrix Vector Approach Using Matlab Written by Charles F.Van Loan 陈 文 斌 Wbchen@fudan.edu.cn 复旦大学

Matrix Computations Setting Up Matrix Problems Matrix Operations Once Again, Setting Up Matrix Problems Recursive Matrix Operations Distributed Memory Matrix Multiplication
Matrix Computations • Setting Up Matrix Problems • Matrix Operations • Once Again, Setting Up Matrix Problems • Recursive Matrix Operations • Distributed Memory Matrix Multiplication

Ax=b Matrix-vector multiplication Matrix- Matrix multiplication Often the amount of work that is required to initialize an n-by-n matrix is as much as the work required to solve forx Fast fourier trans form and fast strassen matrix multiply algorithm
• Matrix-vector multiplication • Matrix- Matrix multiplication • Often the amount of work that is required to initialize an n-by-n matrix is as much as the work required to solve for x • Fast Fourier transform and fast Strassen matrix multiply algorithm Ax=b

Setting up Matrix problems
Setting up Matrix problems

Hilbert matrix A=zeros(n,n) a=zeros(n,n) for i=1: n for i=l,n for i=l: n for j=i:n A(ij=1/(i+j-1); Simple j Recipes A(ij)=1/(i+j-1) AG, D=A(i,j ene end en
Hilbert matrix 1 1 + − = i j aij A=zeros(n,n); for i=1:n for j=1:n A(i,j)=1/(i+j-1); end end A=zeros(n,n); for i=1:n for j=i:n A(i,j)=1/(i+j-1); A(j,i)=A(i,j); end end Simple ij Recipes

function H=hilb(n) %HILB Hilbert matrix This is also a good example of efficient MaTlaB programming %o style where conventional for or do loops are replaced b %o vectorized statements. This approach is faster, but uses more storage % C Moler. 6-22-91 %o Copyright 1984-2001 The Math Works, Inc % PRevision:59$ SDate:2001/04/1512:02:29 J=l n; J=J(ones(n, D) :I=J E=ones(n, n H=E/(I+J-1)
function H = hilb(n) %HILB Hilbert matrix. % This is also a good example of efficient MATLAB programming % style where conventional FOR or DO loops are replaced by % vectorized statements. This approach is faster, but uses % more storage. % C. Moler, 6-22-91. % Copyright 1984-2001 The MathWorks, Inc. % $Revision: 5.9 $ $Date: 2001/04/15 12:02:29 $ J = 1:n; J = J(ones(n,1),:); I = J'; E = ones(n,n); H = E./(I+J-1);

The setting up of a matrix can often be made more efficient by exploiting relationships that exist between the entries. ifo<ksm k k-1 k!(m-k)! 0 otherwise O(n)flops 1000 Pii= pi-li-Itp 1100 P O(n) flops 1331
The setting up of a matrix can often be made more efficient by exploiting relationships that exist between the entries. = − − − = 0 otherwise if 0 !( )! ! 1 1 k m k m k m k m pmk O(n3 ) flops = 1 3 3 1 1 2 1 0 1 1 0 0 1 0 0 0 P pi j = pi−1, j−1 + pi−1, j O(n2 ) flops

P=zeros(n,n) P(:,1)=ones(n1) O(n2) flc for i=2 ops for 1=2 P(1)=P(-13-1)+P(-1) end
P=zeros(n,n); P(:,1)=ones(n,1); for i=2:n for j=2:i P(i,j)=P(i -1,j -1)+P(i -1,j); end end O(n 2) flops

Matrix defined by a vector ofparameters 2之J 2 4 Length(x,y) V(:,1)=ones(n,1) for j=2: n V(:j)x*V(:-1); end
= 3 4 2 4 4 3 3 2 3 3 3 2 2 2 2 3 1 2 1 1 1 1 1 1 x x x x x x x x x x x x V Matrix defined by a vector of parameters n=length(x,y); V(:,1)=ones(n,1); for j=2:n V(:,j)=x.*V(:,j-1); end

Circulant C=as d9 aa a1 matrices 4 2 function C=Circulant1(a) function C=Circulant2(a) n=length(a);C=zeros(n,n);n=length(a); C=zeros(n,n) for i=l: n C(1,)=a; for j=l:n for j=2: n C(i j)=a(rem(n-i+j, n)+1); C(is )=[C(i-1, n)C(i-1, 1: n-1) end end ((n-i+j)mod n)+1 ent
= 2 3 4 1 3 4 1 2 4 1 2 3 1 2 3 4 a a a a a a a a a a a a a a a a C Circulant matrices function C = Circulant1(a) n = length(a); C = zeros(n,n); for i=1:n for j=1:n C(i,j) = a(rem(n-i+j,n)+1); end end function C = Circulant2(a) n = length(a);C = zeros(n,n); C(1,:) = a; for i=2:n C(i,:) = [ C(i-1,n) C(i-1,1:n-1) ]; end i j = a((n−i+ j)mod n)+1 c
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 复旦大学:《Matlab》(ppt实验英文版)Chapter 9 The Initial Value Problem.ppt
- 复旦大学:《Matlab》(ppt实验英文版)Chapter 2 Polynomial Interpolation.ppt
- 复旦大学:《Matlab》(ppt实验英文版)Chapter 8 Nonlinear Equations and Optimization.ppt
- 复旦大学:《Matlab》(ppt实验英文版)Chapter 7 The QR and Cholesky Factorizations.ppt
- 复旦大学:《Matlab》(ppt实验英文版)Chapter 6 Linear systems.ppt
- 复旦大学:《Matlab》(ppt实验英文版)Chapte 4 Numerical Integration.ppt
- 复旦大学:《Matlab》(ppt实验英文版)Chapter3 Piecewise Polynomial Interpolation.ppt
- 《计算机网络基础》第7章 网络管理与网络安全.ppt
- 《计算机网络基础》第6章 网页制作技术.ppt
- 《计算机网络基础》第5章 Internet的使用.ppt
- 《小技巧让PDF文件与Word文档之间自由地转换》讲义.pdf
- 同济大学:《计算机文化》(第三版)第六章 网络基础.ppt
- 同济大学:《计算机文化》(第三版)第五章 应用软件和办公软件.ppt
- 同济大学:《计算机文化》(第三版)第四章 系统软件及其常用操作系统.ppt
- 同济大学:《计算机文化》(第三版)第一章 计算机与信息社会.ppt
- 《ASP网页数据库短训教程》第9章 Application对象与 Session对象.ppt
- 《ASP网页数据库短训教程》第8章 Request对象及其使用.ppt
- 《ASP网页数据库短训教程》第7章 ASP程序与ASP的内置对象.ppt
- 《ASP网页数据库短训教程》第6章 VBScript的对象编程.ppt
- 《ASP网页数据库短训教程》第5章 VBScript编程语言(二).ppt
- 复旦大学:《Matlab》(ppt实验英文版)Chapter I power tools of the trade.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第1章 绪论.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第2章 线性表.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第3章 栈和队列.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第4章 串.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第5章 多维数组和广义表.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第6章 树.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第7章 图.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第8章 查找.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第9章 排序.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第七章 图.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第九章 排序.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第八章 查找.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第十章 文件.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)目录.ppt
- 华南热带农业大学:《计算机导论》第1章 计算机基础知识计.ppt
- 华南热带农业大学:《计算机导论》第2章 微型计算机系统的组成.ppt
- 华南热带农业大学:《计算机导论》第3章 计算机操作系统.ppt
- 华南热带农业大学:《计算机导论》第4章 办公自动化软件应用.ppt
- 华南热带农业大学:《计算机导论》第5章 计算机程序设计.ppt