source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/zisserman/vgg_numerics/vgg_rq.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

  • Property svn:executable set to *
File size: 425 bytes
Line 
1% [R,Q] = vgg_rq(S)  Just like qr but the other way around.
2%
3% If [R,Q] = vgg_rq(X), then R is upper-triangular, Q is orthogonal, and X==R*Q.
4% Moreover, if S is a real matrix, then det(Q)>0.
5
6% By awf
7
8function [U,Q] = rq(S)
9
10S = S';
11[Q,U] = qr(S(end:-1:1,end:-1:1));
12Q = Q';
13Q = Q(end:-1:1,end:-1:1);
14U = U';
15U = U(end:-1:1,end:-1:1);
16
17if det(Q)<0
18  U(:,1) = -U(:,1);
19  Q(1,:) = -Q(1,:);
20end
21
22return
Note: See TracBrowser for help on using the repository browser.