Talk:QR decomposition: Difference between revisions

 
(7 intermediate revisions by 3 users not shown)
Line 26:
::::With that modification, the code produces correct results in my test program. --[[User:Ernstegon|Ernstegon]] 17:20, 19 November 2012 (UTC)
:::::Eh, ok, maybe it's fixed now. --[[User:Ledrug|Ledrug]] 17:51, 19 November 2012 (UTC)
 
Am I missing something? I am having trouble compiling the code as is. Is it assuming a certain version/standard of C? --[[User:Cantorg|Cantorg]] 09:51, 18 February 2015 (UTC)
 
== Common Lisp example ==
Line 42 ⟶ 44:
 
How about better comments on what each Lisp function needs, does, and returns. In programming terms. Then add it to the task description as the pseudocode to follow? --[[User:Paddy3118|Paddy3118]] 14:08, 23 July 2011 (UTC)
:Why not read the [https://en.wikipedia.org/wiki/QR_decomposition| Wikipedia page about QR]? Then if it is not enough, why not open a book on numerical analysis, for example Golub & Van Loan? If a book is asking too much, there are many good online courses about matrix decompositions, [http://www.giyf.com/ Google is your friend]. I'm not claiming that writing a good QR code is easy: it needs some thoughts about geometry, basic matrix operations, and some good ideas about storage (in order to write the Q and R factor in a single n x n matrix plus a vector, as is done in linpack or lapack) -- for example, the Ada solution is not very usable as is, it's just showing how things work with Householder matrix H, in an inefficient way. But programming is not about translating someone else's code, and sometimes it requires some "homework" to understand how to write it yourself. [[User:Arbautjc|Arbautjc]] ([[User talk:Arbautjc|talk]]) 19:55, 6 October 2013 (UTC)
 
==Draft status==
Line 66 ⟶ 68:
The Mathematica and Matlab examples simply show to use the builtin functions for QR-decomposition.
Is this enough? Or should they implement the algorithm given in the description?
I think they should show the algorithm implemented not just the function called!
 
== Questionnable intent ==
 
The task is misleading at best. Some answers successfully compute Householder projections,
but, like the task description, they fail to understand that a QR decomposition is never
computed this way, as this would be too much time- and space- consumming.
 
Only the vector ''u'' of array ''I - s uu''' is ever stored, together with ''s'' or something equivalent to ''s''.
And both ''Q'' and ''R'' are stored in ''A'' in the process, with only a supplementary vector.
 
LINPACK and LAPACK are of course no exception, though they handle the question in a slightly
different way [http://stackoverflow.com/questions/3031215/mystified-by-qr-q-what-is-an-orthonormal-matrix-in-compact-form].
 
And when solving a system given an already computed QR in packed form, there are also ways to do
it in a clever way, not computing the ''Q'' and ''R'' matrices effectively.
 
Most answers only show bad ways to do the job, and they are just showing programming language
in (bad) action.
 
While I understand that Rosetta Code is not the place for state-of-the-art algorithms, it should be at least
mentionned that they are indeed very poor in this case. And anyway, a reasonnable QR algorithm is not more difficult
to implement, it just requires some work.
 
[[User:Arbautjc|Arbautjc]] ([[User talk:Arbautjc|talk]]) 11:05, 30 April 2015 (UTC)
Anonymous user