Why is in matlab orth function much slower qr?

I am orthogonalizing large matrices in Matlab and I noticed that the orthoform function is much slower than qr, for example:

>> a = randn(200000, 80);
tic; orth(a); toc;
Elapsed time is 2.472516 seconds.
>> tic; qr(a); toc;
Elapsed time is 0.610215 seconds. 

      

What can make such a big difference?

+3


source to share


1 answer


It looks like it's qr

really faster.

Logically, this means that it must have a flaw, otherwise Matlab will not continue to use this slower method.

Two things that you basically would like to see:

  • Memory requirement
  • Accuracy


While it is possible that something else is the reason for implementing orth

the way it is done now, my guess would be one of them.


Sidenote you can also check this simple Gram Schmidt solution for comparison.

+1


source







All Articles