中国大学生数学建模竞赛历年试题MATLAB程序

源代码在线查看: project.m

软件大小: 358 K
上传用户: smellteen
关键词: MATLAB 大学生 数学建模 竞赛
下载地址: 免注册下载 普通下载 VIP

相关代码

				function [pvec,LZ,UZ,pcolZ,PZ,PT]  = project(A,vec,PT,LZ,UZ,pcolZ,PZ);
				%PROJECT Non-orthogonal projector
				%
				% pvec = PROJECT(A,vec) is a non-orthogonal projection of vec
				% onto null(A).
				%
				% pvec = PROJECT(A,vec,PT,LZ,UZ,pcolZ,PZ) is a non-orthogonal 
				% projection of vec
				% onto null(A). PT is a permutation matrix such that A*PT 
				% has a leading nonsingular  m-by-m matrix, A_1,
				% where m is the number of rows of A
				% PZ*A_1(:,pcolZ) = LZ*UZ, the sparse LU-factorization on A_1.
				%	
				% [pvec,LZ,UZ,pcolZ,PZ,PT]  = project(A,vec) is a non-orthogonal 
				% projection of
				% vec onto null(A). PT is a permutation matrix such that A*PT
				% has a leading nonsingular  m-by-m matrix, A_1,
				% where m is the number of rows of A
				% PZ*A_1(:,pcolZ) = LZ*UZ, the sparse LU-factorization on A_1.
				
				%   Copyright (c) 1990-98 by The MathWorks, Inc.
				%   $Revision: 1.1 $  $Date: 1998/03/27 01:29:32 $
				
				[m,n] = size(A); 
				if m > n
				   error('function PROJECT expects A to have more columns than rows'); 
				end
				if nargin < 3 | isempty(PT)
				   PT = findp(A); 
				end
				
				A = A*PT'; 
				vec = PT*vec;
				if nargin < 6
				   [pvec,LZ,UZ,pcolZ,PZ] = fzmult(A,vec,'transpose');
				else
				   pvec = fzmult(A,vec,'transpose',LZ,UZ,pcolZ,PZ);
				end
				pvec = PT'*fzmult(A,pvec,'',LZ,UZ,pcolZ,PZ);
				
				
				
							

相关资源