Subject: | Bug in mqr QR decomposotion |
Date: | Mon, 04 Aug 2008 15:55:27 +0200 |
To: | bug-PDL-LinearAlgebra [...] rt.cpan.org |
From: | Anton Sedlak <ased [...] cce.cz> |
Hi,
it looks that there is a problem with 'mqr' in PDL-LinearAlgebra - while
lapack 'geqrf' equivalent is OK.
Routine mqr has dimension problem:
Ex: let we have two vectors [2 1 0] and [1 2 0]
A=
[
[2 1]
[1 2]
[0 0]
]
--- mqr returns
Q=
[
[-0.89442719 -0.4472136]
[ -0.4472136 0.89442719]
[ -0 -0]
]
R=
[
[ -2.236068 -1.7888544]
[ 0 1.3416408]
]
But this is definitely wrong. Dim of Q must be 3x3 (rotation in 3D) and
R must be [3x2] [row x col]
Correct answer is (octave output and is correct):
q =
-0.89443 -0.44721 0.00000
-0.44721 0.89443 0.00000
-0.00000 -0.00000 1.00000
r =
-2.23607 -1.78885
0.00000 1.34164
0.00000 0.00000
Bye
Anton Sedlak