SVD is broken

Issue #56 new
M created an issue

python2 and python3 output: http://i.imgur.com/N3AAyOu.png

pypy2 5.4.1 output: http://i.imgur.com/ynZ40FN.png

code:

    U, S, V = numpy.linalg.svd(A)
    F = V[-1:,]  # last column
    print(A)
    print("---")
    print(V)

Comments (6)

  1. M reporter

    print(A) is

    [[ 0.17487086 -0.55680614  1.2323      0.20464275 -0.6516028   1.4421
       0.14190608 -0.45184301  1.        ]
     [ 0.17487086 -0.55680614  1.2323      0.20464275 -0.6516028   1.4421
       0.14190608 -0.45184301  1.        ]
     [ 0.17487086 -0.55680614  1.2323      0.20464275 -0.6516028   1.4421
       0.14190608 -0.45184301  1.        ]
     [ 0.17487086 -0.55680614  1.2323      0.20464275 -0.6516028   1.4421
       0.14190608 -0.45184301  1.        ]
     [ 0.17487086 -0.55680614  1.2323      0.20464275 -0.6516028   1.4421
       0.14190608 -0.45184301  1.        ]
     [ 0.17487086 -0.55680614  1.2323      0.20464275 -0.6516028   1.4421
       0.14190608 -0.45184301  1.        ]
     [ 0.17487086 -0.55680614  1.2323      0.20464275 -0.6516028   1.4421
       0.14190608 -0.45184301  1.        ]
     [ 0.17487086 -0.55680614  1.2323      0.20464275 -0.6516028   1.4421
       0.14190608 -0.45184301  1.        ]]
    
  2. M reporter

    This is really strange. I've dumped that array via numpy.dump to file and this code:

    import numpy
    
    A = numpy.load("./here")
    
    print(A)
    print("---")
    U, S, V = numpy.linalg.svd(A)
    print(V)
    

    produces the right value in pypy2 5.4.1

    It seems that there might be some memory corruption in my main script.

  3. mattip

    Cannot reproduce. For me cpython and pypy+numpypy give the same results. @Marqin can you provide the desired results in a computer-readable format?

  4. Log in to comment