# HG changeset patch
# User Jean-Pierre Flori <flori@enst.fr>
# Date 1298990841 -3600
# Node ID a91cdf2c0096f4f7db07dacef53469baf76ff647
# Parent 960df3da463d46c98242b364071cc1aaf35ed8b5
Trac #9880: Give Sage access to the PyNaC printing order
This allows automated doctests to check the PyNaC printing
sort order.
diff --git a/sage/libs/ginac.pxd b/sage/libs/ginac.pxd
a
|
b
|
|
531 | 531 | object (*py_rational_power_parts)(object basis, object exp) |
532 | 532 | |
533 | 533 | py_funcs_struct py_funcs "GiNaC::py_funcs" |
| 534 | |
| 535 | cdef extern from "pynac/order.h": |
| 536 | bint print_order "GiNaC::print_order()" \ |
| 537 | (GEx left, GEx right) except + |
| 538 | bint print_order_mul "GiNaC::print_order_mul()" \ |
| 539 | (GEx left, GEx right) except + |
diff --git a/sage/symbolic/expression.pxd b/sage/symbolic/expression.pxd
a
|
b
|
|
2 | 2 | |
3 | 3 | from sage.structure.element cimport CommutativeRingElement |
4 | 4 | |
5 | | |
6 | 5 | cdef class Expression(CommutativeRingElement): |
7 | 6 | cdef GEx _gobj |
8 | 7 | cdef Expression coerce_in(self, z) |
… |
… |
|
13 | 12 | cpdef bint is_infinity(self) |
14 | 13 | cpdef object pyobject(self) |
15 | 14 | cpdef Expression _subs_expr(self, expr) |
| 15 | cpdef int _cmp_add(left, CommutativeRingElement right) except -2 |
| 16 | cpdef int _cmp_mul(left, CommutativeRingElement right) except -2 |
16 | 17 | |
17 | 18 | cpdef bint is_Expression(x) |
18 | 19 | cdef Expression new_Expression_from_GEx(parent, GEx juice) |
diff --git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
a
|
b
|
|
2864 | 2864 | cdef int _cmp_c_impl(left, Element right) except -2: |
2865 | 2865 | return left._gobj.compare((<Expression>right)._gobj) |
2866 | 2866 | |
| 2867 | cpdef int _cmp_add(left, CommutativeRingElement right) except -2: |
| 2868 | return print_order(left._gobj,(<Expression>right)._gobj) |
| 2869 | |
| 2870 | cpdef int _cmp_mul(left, CommutativeRingElement right) except -2: |
| 2871 | return print_order_mul(left._gobj,(<Expression>right)._gobj) |
| 2872 | |
2867 | 2873 | def __pow__(self, exp, ignored): |
2868 | 2874 | """ |
2869 | 2875 | Return self raised to the power of exp. |