Changes between Version 30 and Version 41 of Ticket #22928


Ignore:
Timestamp:
06/22/17 11:19:01 (2 years ago)
Author:
vdelecroix
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22928

    • Property Commit changed from 7edcfe46cb8d4abdb922f98d39604475a1350c78 to 1e404b0b9ef9e2fc2cb6ed4c9b9ec0f44512465c
    • Property Summary changed from Conversion between gmpy2 and sage integers to Conversion between gmpy2 and sage objects
  • Ticket #22928 – Description

    v30 v41  
    1 Conversion between gmpy2 and sage integers:
    2 - Implement method `__mpz__` on sage integer: return an gmpy2 mpz
    3 - Implement method `__mpq__` on sage rational: return an gmpy2 mpq
    4 -  Sage integer and rational constructors should work with gmpy2's mpz and mpq parameters.
     1The library `gmpy2` support conversions by the use of special methods. In order to allow conversion of Sage objects into gmpy2 objects, we implement the following
     2- a method `__mpz__` on Sage Integer
     3- a method `__mpq__` on Sage Rational
     4- a method `__mpfr__` on relevant Sage real numbers
     5   - `RealNumber` (`sage.rings.real_mpfr`)
     6   - `RealDoubleElement` (`sage.rings.real_double`)
     7- a method `__mpc__` on relevant Sage complex numbers
     8   - `ComplexDoubleElement` (`sage.rings.complex_double`)
     9   - `MPComplexNumber` (`sage.rings.complex_mpc`)
     10   - `ComplexNumber` (`sage.rings.complex_number`)
     11
     12Conversly, we make Sage integer, rational, real and complex constructors accept gmpy2 arguments.
    513
    614
    7 Once gmpy2 is a standard package with the following features :
    8 - [https://github.com/aleaxit/gmpy/pull/137 #137] direct constructors GMPy_MPZ_From_mpz, GMPy_MPQ_From_mpq, GMPy_MPQ_From_mpz
    9 - [https://github.com/aleaxit/gmpy/pull/137 #137] a gmpy2.pxd file with relevant declarations (to be installed at the same place as gmpy2.h)
    10 - [https://github.com/aleaxit/gmpy/issues/136 #136] robust header detection (ie what should the user do in her setup.py to find out where gmpy2.h/gmpy2.pxd are?)
    11 see also: [https://github.com/aleaxit/gmpy/pull/134 #134]
    12 
    13 Then remove sage.libs.gmpy2 extension and replace conversion functions gmpy2_mpz_to_sage and gmpy2_mpq_to_sage by having sage integer and rational constructors working with gmpy2 number 
    14 
    15 Make gmpy2 a standard package (open a thread on sage-devel)
     15'''All these features need `gmpy2` being a standard package.'''