Bug in Maple 9.5 "Svd" singular value decomposition code?



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.

.



Relevant Pages

  • Re: LSASRV; Event ID: 40968
    ... The only warning event that is coming up is 40968. ... "Tariq Azad" wrote: ... All current updates/hotfixes are installed onto the server. ... > I am having same problem followed by the following restart. ...
    (microsoft.public.windows.server.general)
  • Re: Cant demote out of forest
    ... > The warning I read said I needed to be able to restart ... > into Direcory Services Restore Mode, ... > machine not restarting normally..Or is this warning just ... confirm your new DS Restore Mode password so be sure you typed it ...
    (microsoft.public.win2000.active_directory)
  • bug: hid module crashed
    ... Warning: You did not tell me where to find symbol information. ... assume that the log matches the kernel and modules that are running ... If the current kernel and/or modules do not match the log, ... Trace; f899c23e ...
    (Linux-Kernel)
  • Re: Column numbers in stack trace - enhancement request
    ... if the trace contains what method call was attempted on ... practice in the Java books I've read or even Sun's Java coding ... I've never seen a warning against it on those grounds. ...
    (comp.lang.java.programmer)
  • Re: Vista updater closes down open applications without warning prompt
    ... Windows Update as initiating the restart process...sorry if my ... IE7, for example, was open during a blogging session at ... all my blog was wiped out without warning ... on the new laptop...my desktop Vista machine, albeit slow and buggy, does ...
    (microsoft.public.windowsupdate)