Bug in Maple 9.5 "Svd" singular value decomposition code?
- From: sn00ge@xxxxxxxxxxx
- Date: 18 Jul 2005 12:36:49 -0700
Greetings
Have a look at this input and output:
-----BEGIN INCLUDED MATERIAL-----
> restart:
> with(linalg):
> W := matrix(2,4,[1,0,0,0,0,0,0,1]);
> Diag := matrix(2,4,[0,0,0,0,0,0,0,0]):
> D1 := evalf(Svd(W, U, V));
> Diag[1,1] := D1[1]: Diag[2,2] := D1[2]:
> evalm(U); evalm(Diag); evalm(V);
> evalm(U &* Diag &* transpose(V));
Warning, the protected names norm and trace have been redefined and
unprotected
[1 0 0 0]
W := [ ]
[0 0 0 1]
D1 := [1., 0.]
[-1. 0.]
[ ]
[ 0. 1.]
[1. 0 0 0]
[ ]
[ 0 0. 0 0]
[-1. 0. 0. 0.]
[ ]
[ 0. 1. 0. 0.]
[ ]
[ 0. 0. 0. -1.]
[ ]
[ 0. 0. -1. 0.]
[1. 0. 0. 0.]
[ ]
[0. 0. 0. 0.]
-----END INCLUDED MATERIAL-----
The second entry in D1 is wrong - it should be 1. When I multiply back
out the matrices as U*Diag*transpose(V), I should get back what I
started with.
Note that if I use linalg[singularvals], it works fine:
-----BEGIN INCLUDED MATERIAL-----
> singularvals(W);
[1, 1]
-----END INCLUDED MATERIAL-----
Which is just as it should be.
Matlab gives:
-----BEGIN INCLUDED MATERIAL-----
>> W = [1 0 0 0 ;
0 0 0 1]
W =
1 0 0 0
0 0 0 1
>> [U D V] = svd(W)
U =
1 0
0 1
D =
1 0 0 0
0 1 0 0
V =
1 0 0 0
0 0 0 -1
0 0 1 0
0 1 0 0
>> U*D*V'
ans =
1 0 0 0
0 0 0 1
>>
-----END INCLUDED MATERIAL-----
which, again, is as it should be. So, is there a known bug in Maple
9.5's Svd code, or am I overlooking something? ;)
--
-Bo Parker
The email address in the header is fake.
.
- Follow-Ups:
- Re: Bug in Maple 9.5 "Svd" singular value decomposition code?
- From: Robert Israel
- Re: Bug in Maple 9.5 "Svd" singular value decomposition code?
- Prev by Date: Re: ANGLE TRISECTION
- Next by Date: Re: Bug in Maple 9.5 "Svd" singular value decomposition code?
- Previous by thread: ANGLE TRISECTION
- Next by thread: Re: Bug in Maple 9.5 "Svd" singular value decomposition code?
- Index(es):
Relevant Pages
|
|