root/library/utia_legacy/ticket_37/udupdt.m @ 1387

Revision 706, 0.9 kB (checked in by smidl, 15 years ago)

eol-native

  • Property svn:eol-style set to native
Line 
1function UD = udupdt(UD, r, w);
2% update U'DU decomposition update
3% U'DU := U'DU+w*r'*r
4% UD     = udupdt(UD, r, w)
5% UD     = input upper triangular matrix with unit diagonal replaced
6%          by D
7% w      = weight of the updating dyad
8% r      = the modifying data vector
9%
10% Design : L. Tesar Jan 2004
11% Updated: Jan 2004
12% Project: ProDaCTool
13% Calls  : dydrs
14
15if nargin<2, error('udupdt needs at least two input arguments'); end
16if nargin==2, w=1; end
17if abs(w)<eps, return; end
18   
19[m,n] = size(UD);
20if m~=n, error('UD decomposition must be square matrix in udupdt.m'); end
21if m~=length(r), error('incorrect dimension of vector to be reduced in udupdt.m'); end
22
23if size(r,1)>1, r=r'; end;
24
25%Test for upper triangularity:
26%if max(max(abs(triu(UD',1))));
27%   error('must be lower triangular matrix');
28%end;
29
30for j=1:m;
31   if r(j)~=0;
32      [r, UD(j,:), w, UDjj] = dydrs(r,UD(j,:),w,UD(j,j),j,j+1,m);
33      UD(j,j) = UDjj;
34   end;   
35end;
Note: See TracBrowser for help on using the browser.