Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Rename gen -> Gen
Browse files Browse the repository at this point in the history
  • Loading branch information
jdemeyer committed Jan 13, 2017
1 parent 6f04aba commit c258dca
Show file tree
Hide file tree
Showing 57 changed files with 272 additions and 272 deletions.
4 changes: 2 additions & 2 deletions src/doc/de/tutorial/interfaces.rst
Expand Up @@ -61,7 +61,7 @@ mehr referenziert wird. Die Objekte haben außerdem verschiedene Typen:
sage: type(gp('znprimroot(10007)'))
<class 'sage.interfaces.gp.GpElement'>
sage: type(pari('znprimroot(10007)'))
<type 'sage.libs.cypari2.gen.gen'>
<type 'sage.libs.cypari2.gen.Gen'>

Welche Variante sollten Sie also nutzen? Das kommt darauf an was
Sie tun. Die GP-Schnittstelle kann alles was ein normales
Expand Down Expand Up @@ -98,7 +98,7 @@ Zuerst erstellen wir eine PARI-Liste aus einer Python-Liste.
sage: v
[1, 2, 3, 4, 5]
sage: type(v)
<type 'sage.libs.cypari2.gen.gen'>
<type 'sage.libs.cypari2.gen.Gen'>

Jedes PARI-Objekt ist vom Typ ``py_pari.gen``. Den PARI Typ des vorliegenden
Objekts können Sie mit der ``type`` Unterfunktion herausfinden.
Expand Down
4 changes: 2 additions & 2 deletions src/doc/en/tutorial/interfaces.rst
Expand Up @@ -64,7 +64,7 @@ objects have different types:
sage: type(gp('znprimroot(10007)'))
<class 'sage.interfaces.gp.GpElement'>
sage: type(pari('znprimroot(10007)'))
<type 'sage.libs.cypari2.gen.gen'>
<type 'sage.libs.cypari2.gen.Gen'>

So which should you use? It depends on what you're doing. The GP
interface can do absolutely anything you could do in the usual
Expand Down Expand Up @@ -100,7 +100,7 @@ First we create a PARI list from a Python list.
sage: v
[1, 2, 3, 4, 5]
sage: type(v)
<type 'sage.libs.cypari2.gen.gen'>
<type 'sage.libs.cypari2.gen.Gen'>

Every PARI object is of type ``py_pari.gen``. The PARI type of the
underlying object can be obtained using the ``type`` member
Expand Down
4 changes: 2 additions & 2 deletions src/doc/fr/tutorial/interfaces.rst
Expand Up @@ -64,7 +64,7 @@ commandes sont de types différents :
sage: type(gp('znprimroot(10007)'))
<class 'sage.interfaces.gp.GpElement'>
sage: type(pari('znprimroot(10007)'))
<type 'sage.libs.cypari2.gen.gen'>
<type 'sage.libs.cypari2.gen.Gen'>

Alors, laquelle des intrefaces utiliser ? Tout dépend de ce que vous
cherchez à faire. L'interface GP permet de faire absolument tout ce que
Expand Down Expand Up @@ -102,7 +102,7 @@ Commençons par créer une liste PARI à partir d'une liste Python.
sage: v
[1, 2, 3, 4, 5]
sage: type(v)
<type 'sage.libs.cypari2.gen.gen'>
<type 'sage.libs.cypari2.gen.Gen'>

En Sage, les objets PARI sont de type ``py_pari.gen``. Le type PARI de
l'objet sous-jacent est donné par la méthode ``type``.
Expand Down
4 changes: 2 additions & 2 deletions src/doc/ja/tutorial/interfaces.rst
Expand Up @@ -55,7 +55,7 @@ GPは送られて来た文字列を評価し,結果を変数に格納する(
sage: type(gp('znprimroot(10007)'))
<class 'sage.interfaces.gp.GpElement'>
sage: type(pari('znprimroot(10007)'))
<type 'sage.libs.cypari2.gen.gen'>
<type 'sage.libs.cypari2.gen.Gen'>

では,どちらの方法を選ぶべきだろうか?
答は目的による、としか言えない.
Expand Down Expand Up @@ -84,7 +84,7 @@ PARI Cライブラリ インターフェイスについて言うと,こちら
sage: v
[1, 2, 3, 4, 5]
sage: type(v)
<type 'sage.libs.cypari2.gen.gen'>
<type 'sage.libs.cypari2.gen.Gen'>


PARIのオブジェクトは全て ``py_pari.gen`` 型になる.
Expand Down
4 changes: 2 additions & 2 deletions src/doc/pt/tutorial/interfaces.rst
Expand Up @@ -63,7 +63,7 @@ diferentes:
sage: type(gp('znprimroot(10007)'))
<class 'sage.interfaces.gp.GpElement'>
sage: type(pari('znprimroot(10007)'))
<type 'sage.libs.cypari2.gen.gen'>
<type 'sage.libs.cypari2.gen.Gen'>

Então qual eu devo usar? Depende do que você está fazendo. A interface
GP pode fazer absolutamente tudo o que você poderia fazer na linha de
Expand Down Expand Up @@ -101,7 +101,7 @@ Primeiro criamos uma lista do PARI a partir de uma lista do Python.
sage: v
[1, 2, 3, 4, 5]
sage: type(v)
<type 'sage.libs.cypari2.gen.gen'>
<type 'sage.libs.cypari2.gen.Gen'>

Cada objeto do PARI é do tipo ``py_pari_gem``. O tipo PARI do objeto
subjacente pode ser obtido usando a função ``type``.
Expand Down
4 changes: 2 additions & 2 deletions src/doc/ru/tutorial/interfaces.rst
Expand Up @@ -59,7 +59,7 @@ GP, и результат записывается в переменную в GP
sage: type(gp('znprimroot(10007)'))
<class 'sage.interfaces.gp.GpElement'>
sage: type(pari('znprimroot(10007)'))
<type 'sage.libs.cypari2.gen.gen'>
<type 'sage.libs.cypari2.gen.Gen'>

Так какой же способ использовать? Это зависит от того, что вы делаете.
Интерфейс GP может делать все, что может делать программа GP/PARI, запускаемая
Expand Down Expand Up @@ -92,7 +92,7 @@ Sage использует С-библиотеку PARI, чтобы поддер
sage: v
[1, 2, 3, 4, 5]
sage: type(v)
<type 'sage.libs.cypari2.gen.gen'>
<type 'sage.libs.cypari2.gen.Gen'>

Каждый объект PARI является объектом типа ``py_pari.gen``. Тип PARI может
быть получен с помощью функции-члена ``type``.
Expand Down
1 change: 1 addition & 0 deletions src/sage/libs/cypari2/__init__.py
@@ -1,2 +1,3 @@
from .pari_instance import Pari
from .handle_error import PariError
from .gen import Gen
4 changes: 2 additions & 2 deletions src/sage/libs/cypari2/closure.pxd
@@ -1,3 +1,3 @@
from .gen cimport gen
cpdef gen objtoclosure(f)
from .gen cimport Gen
cpdef Gen objtoclosure(f)
cdef void _pari_init_closure()
4 changes: 2 additions & 2 deletions src/sage/libs/cypari2/closure.pyx
Expand Up @@ -117,7 +117,7 @@ cdef void _pari_init_closure():
global ep_call_python
ep_call_python = install(<void*>call_python, "call_python", "DGDGDGDGDGU")

cpdef gen objtoclosure(f):
cpdef Gen objtoclosure(f):
"""
Convert a Python function (more generally, any callable) to a PARI
``t_CLOSURE``.
Expand Down Expand Up @@ -171,6 +171,6 @@ cpdef gen objtoclosure(f):
# Convert f to a t_INT containing the address of f
cdef GEN f_int = utoi(<ulong><PyObject*>f)
# Create a t_CLOSURE which calls call_python() with py_func equal to f
cdef gen c = new_gen(snm_closure(ep_call_python, mkvec(f_int)))
cdef Gen c = new_gen(snm_closure(ep_call_python, mkvec(f_int)))
c.refers_to = {0:f} # c needs to keep a reference to f
return c
12 changes: 6 additions & 6 deletions src/sage/libs/cypari2/convert.pxd
@@ -1,14 +1,14 @@
from .types cimport GEN
from .gen cimport gen
from .gen cimport Gen

cpdef integer_to_gen(x)
cpdef gen_to_integer(gen x)
cpdef gen_to_python(gen z)
cpdef gen_to_integer(Gen x)
cpdef gen_to_python(Gen z)

cdef GEN gtoi(GEN g0) except NULL
cdef GEN PyLong_AsGEN(x)
cdef PyLong_FromGEN(GEN g)

cdef gen new_t_POL_from_int_star(int* vals, unsigned long length, long varnum)
cdef gen new_gen_from_double(double)
cdef gen new_t_COMPLEX_from_double(double re, double im)
cdef Gen new_t_POL_from_int_star(int* vals, unsigned long length, long varnum)
cdef Gen new_gen_from_double(double)
cdef Gen new_t_COMPLEX_from_double(double re, double im)
16 changes: 8 additions & 8 deletions src/sage/libs/cypari2/convert.pyx
Expand Up @@ -75,10 +75,10 @@ cpdef integer_to_gen(x):
sage: from sage.libs.cypari2.convert import integer_to_gen
sage: a = integer_to_gen(int(12345)); a; type(a)
12345
<... 'sage.libs.cypari2.gen.gen'>
<... 'sage.libs.cypari2.gen.Gen'>
sage: a = integer_to_gen(long(12345)); a; type(a)
12345
<... 'sage.libs.cypari2.gen.gen'>
<... 'sage.libs.cypari2.gen.Gen'>
sage: integer_to_gen(float(12345))
Traceback (most recent call last):
...
Expand All @@ -99,7 +99,7 @@ cpdef integer_to_gen(x):
return new_gen(PyLong_AsGEN(x))
raise TypeError("integer_to_gen() needs an int or long argument, not {}".format(type(x).__name__))

cpdef gen_to_integer(gen x):
cpdef gen_to_integer(Gen x):
"""
Convert a PARI ``gen`` to a Python ``int`` or ``long``.
Expand Down Expand Up @@ -352,7 +352,7 @@ cdef PyLong_FromGEN(GEN g):
# Other basic types
####################################

cdef gen new_t_POL_from_int_star(int* vals, unsigned long length, long varnum):
cdef Gen new_t_POL_from_int_star(int* vals, unsigned long length, long varnum):
"""
Note that degree + 1 = length, so that recognizing 0 is easier.
Expand All @@ -374,7 +374,7 @@ cdef gen new_t_POL_from_int_star(int* vals, unsigned long length, long varnum):
return new_gen(z)


cdef gen new_gen_from_double(double x):
cdef Gen new_gen_from_double(double x):
# Pari has an odd concept where it attempts to track the accuracy
# of floating-point 0; a floating-point zero might be 0.0e-20
# (meaning roughly that it might represent any number in the
Expand All @@ -398,7 +398,7 @@ cdef gen new_gen_from_double(double x):
return new_gen(g)


cdef gen new_t_COMPLEX_from_double(double re, double im):
cdef Gen new_t_COMPLEX_from_double(double re, double im):
sig_on()
cdef GEN g = cgetg(3, t_COMPLEX)
if re == 0:
Expand All @@ -413,10 +413,10 @@ cdef gen new_t_COMPLEX_from_double(double re, double im):


####################################
# Conversion of gen to Python type #
# Conversion of Gen to Python type #
####################################

cpdef gen_to_python(gen z):
cpdef gen_to_python(Gen z):
r"""
Convert the PARI element ``z`` to a Python object.
Expand Down
8 changes: 4 additions & 4 deletions src/sage/libs/cypari2/gen.pxd
Expand Up @@ -2,14 +2,14 @@ from .types cimport *
cimport cython


cdef class gen_auto:
cdef class Gen_auto:
cdef GEN g
cdef pari_sp b
cdef dict refers_to

@cython.final
cdef class gen(gen_auto):
cdef class Gen(Gen_auto):
pass

cdef gen new_ref(GEN g, gen parent)
cpdef gen objtogen(s)
cdef Gen new_ref(GEN g, Gen parent)
cpdef Gen objtogen(s)

0 comments on commit c258dca

Please sign in to comment.