|
"Tim Davis" <davis@cise.ufl.edu> wrote in message
<g9q3uq$ibh$1@fred.mathworks.com>...
> p = colamd(A');
> [Q,R]=qr(A(p,:)');
> x = Q*(R'\b(p)) ;
>
Hello Tim,
I have uploaded the matrix A, and b (small problem from
photogrammetry, m = 1388, n = 390, rank = 293).
In your method, how can I fix a tolerance for null space?
with pinv and lsqr, I can do somthing like this:
% load A and b
load BrunoPhotogrammetry.mat;
tic;
x1=lsqr(A,b,1e-6,1000);
toc; % Elapsed time is 0.116326 seconds
tic;
p = colamd(A');
[Q,R]=qr(A(p,:)');
x2 = Q*(R'\b(p)) ;
toc; % Elapsed time is 0.252176 seconds.
tic;
x3=pinv(full(A),1e-6)*b;
toc; % Elapsed time is 0.560355 seconds.
subplot(3,1,1); plot(x1);
subplot(3,1,2); plot(x2);
subplot(3,1,3); plot(x3);
Is there an equivalent threshold with qr? You will see that
without setting the threshold, the solution is not as I
expected.
Thanks,
Bruno
|