Talk:QR decomposition: Difference between revisions

m
No edit summary
Line 12:
I believe the code has a problem. Under certain circumstances, division by zero will occur in the line
vdiv(e, vnorm(e, m->m), e, m->m);
The reason seems to be that the loop which creates the Householder matrices loops over the number of rows in the input matrix m (m->m), and attempts to extract a column with the same index as the row index from the matrix z (which has the same dimensions as m). This is fine if m->m <= m->n. For purposes of solving over-determined equation systems, however, we will have m->m > m->n. Consequently, we will try to extract non-existing columns from the matrix z, and what they contain will be indeterminate. Should it happen that all column elements are zero, the division by zero referred to above will take place. This of course renders the whole calculation useless. --[[User:Ernstegon|Ernstegon]] 21:22, 17 November 2012 (UTC)
 
== Common Lisp example ==
Anonymous user