Ticket #7577: mpolynomial_rr_libsingular_fixes.patch

File mpolynomial_rr_libsingular_fixes.patch, 2.5 KB (added by malb, 12 years ago)
  • sage/libs/singular/ring.pyx

    # HG changeset patch
    # User Martin Albrecht <malb@informatik.uni-bremen.de>
    # Date 1259764246 0
    # Node ID 248a550a34cf9a09801d98c8fe8bc6b35cf61e3b
    # Parent  aebcfb7ffaea4f9cf5c151886a5622ffb8d75e4a
    fix doctest failures of mpolynomial_rr_libsingular.patch
    
    diff -r aebcfb7ffaea -r 248a550a34cf sage/libs/singular/ring.pyx
    a b  
    210210            ringflaga = <__mpz_struct*>omAlloc(sizeof(__mpz_struct))
    211211            mpz_init_set_ui(ringflaga, characteristic)
    212212            ringflagb = 1
    213     elif is_RealField(base_ring):
     213    elif is_RealField(base_ring) and base_ring.rounding_mode() == 'RNDN':
    214214        characteristic = -1
    215215    else:
    216216        raise NotImplementedError("Base ring is not supported.")
  • sage/matrix/matrix_mpolynomial_dense.pyx

    diff -r aebcfb7ffaea -r 248a550a34cf sage/matrix/matrix_mpolynomial_dense.pyx
    a b  
    489489            sage: R.<x,y> = RR[]
    490490            sage: C = random_matrix(R,2,2,terms=2)
    491491            sage: C
    492             [-0.567690934805980*y^2 + 0.527063330456041*x   -0.674707208091499*y^2 + 0.811617365477302]
     492            [-0.56769093480598*y^2 + 0.527063330456041*x   -0.674707208091499*y^2 + 0.811617365477302]
    493493            [   0.457864342548546*y^2 - 0.646443352568505     -0.775440837313686*y + 0.449759718421967]
    494494            sage: C.determinant()
    495             0.308924372245579*y^4 + 0.440210733821338*y^3 - 0.408706430286172*x*y - 1.06309515603509*y^2 + 0.237051855096453*x + 0.524664650741965
     495            0.308924372245579*y^4 + 0.440210733821339*y^3 - 0.408706430286173*x*y - 1.063095156035094*y^2 + 0.237051855096453*x + 0.524664650741965
    496496
    497497        ALGORITHM: Calls \Singular, libSingular or native
    498498        implementation.
  • sage/matrix/matrix_sparse.pyx

    diff -r aebcfb7ffaea -r 248a550a34cf sage/matrix/matrix_sparse.pyx
    a b  
    5252            [2*x  -2]
    5353            [-------]
    5454            sage: A.change_ring(RR['x,y'])
    55             [                 0  -1.00000000000000]
    56             [2.00000000000000*x  -2.00000000000000]
    57             [-------------------------------------]
     55            [  0  -1]
     56            [2*x  -2]
     57            [-------]
    5858        """
    5959        if not is_Ring(ring):
    6060            raise TypeError, "input must be a ring"