Ticket #11027: trac_11027-schur-decomposition-doctest-v2.patch

File trac_11027-schur-decomposition-doctest-v2.patch, 1.9 KB (added by rbeezer, 10 years ago)
  • sage/matrix/matrix_double_dense.pyx

    # HG changeset patch
    # User Rob Beezer <beezer@ups.edu>
    # Date 1302714179 25200
    # Node ID 9bfd8f9a2ee3f61ffbc93ee4aa1e60047d97e028
    # Parent  72a38a0761cc77f42b35b2383c2976b9a4a598d4
    11027: Schur decoposition doctest fix
    
    diff -r 72a38a0761cc -r 9bfd8f9a2ee3 sage/matrix/matrix_double_dense.pyx
    a b  
    15651565            [0.0 0.0 0.0 0.0]
    15661566            [0.0 0.0 0.0 0.0]
    15671567            [0.0 0.0 0.0 0.0]
    1568             sage: eigenvalues = sorted(T[0:2,0:2].eigenvalues() + T[2:4,2:4].eigenvalues())
    1569             sage: eigenvalues.reverse(); eigenvalues
    1570             [-0.789... + 2.336...*I, -0.789... - 2.336...*I, -5.710... + 8.382...*I, -5.710... - 8.382...*I]
    1571             sage: A.eigenvalues()
    1572             [-0.789... + 2.336...*I, -0.789... - 2.336...*I, -5.710... + 8.382...*I, -5.710... - 8.382...*I]
     1568            sage: sorted(T[0:2,0:2].eigenvalues() + T[2:4,2:4].eigenvalues())
     1569            [-5.710... - 8.382...*I, -5.710... + 8.382...*I, -0.789... - 2.336...*I, -0.789... + 2.336...*I]
     1570            sage: sorted(A.eigenvalues())
     1571            [-5.710... - 8.382...*I, -5.710... + 8.382...*I, -0.789... - 2.336...*I, -0.789... + 2.336...*I]
    15731572            sage: abs(A.norm()-T.norm()) < 1e-12
    15741573            True
    15751574
     
    16481647            [  0.139 -0.3892 -0.2648  0.8713]
    16491648            [ 0.4361   0.359  0.7599  0.3217]
    16501649            [ -0.836  0.3945  0.1438  0.3533]
     1650            sage: T = T.zero_at(1.0e-12).change_ring(RDF)
    16511651            sage: T.round(4)
    16521652            [-13.5698      0.0      0.0      0.0]
    1653             [     0.0  -0.8508     -0.0     -0.0]
     1653            [     0.0  -0.8508      0.0      0.0]
    16541654            [     0.0      0.0   7.7664      0.0]
    16551655            [     0.0      0.0      0.0  11.6542]
    16561656            sage: (Q*Q.transpose()).zero_at(1.0e-12)