# HG changeset patch
# User Jean-Pierre Flori <flori@enst.fr>
# Date 1298990841 -3600
# Node ID afc2b3d6e435d3330331e432f7c1465701cac681
# Parent bebf93b78a833a4a22b4bf95f04046097e40b13d
Access to Pynac printing order
diff -r bebf93b78a83 -r afc2b3d6e435 c_lib/include/ginac_wrap.h
a
|
b
|
|
136 | 136 | extern const ex _ex1_2; |
137 | 137 | |
138 | 138 | } |
| 139 | |
| 140 | #include <pynac/order.h> |
| 141 | |
| 142 | int cmp_add(const ex& lh, const ex& rh) { |
| 143 | return ex_is_greater_degrevlex::in_type(&add::tinfo_static).compare(lh,rh); |
| 144 | } |
| 145 | |
| 146 | int cmp_mul(const ex& lh, const ex& rh) { |
| 147 | return ex_is_greater_degrevlex::in_type(&mul::tinfo_static).compare(lh,rh); |
| 148 | } |
diff -r bebf93b78a83 -r afc2b3d6e435 sage/libs/ginac/decl.pxi
a
|
b
|
|
505 | 505 | object (*py_rational_power_parts)(object basis, object exp) |
506 | 506 | |
507 | 507 | py_funcs_struct py_funcs "GiNaC::py_funcs" |
| 508 | |
| 509 | int cmp_add(GEx left, GEx right) except + |
| 510 | int cmp_mul(GEx left, GEx right) except + |
diff -r bebf93b78a83 -r afc2b3d6e435 sage/symbolic/expression.pxd
a
|
b
|
|
1 | 1 | include "../libs/ginac/decl.pxi" |
2 | 2 | |
3 | | from sage.structure.element cimport CommutativeRingElement |
4 | | |
| 3 | from sage.structure.element cimport CommutativeRingElement, Element |
5 | 4 | |
6 | 5 | cdef class Expression(CommutativeRingElement): |
7 | 6 | cdef GEx _gobj |
… |
… |
|
12 | 11 | cpdef bint is_relational(self) |
13 | 12 | cpdef object pyobject(self) |
14 | 13 | cpdef Expression _subs_expr(self, expr) |
| 14 | cpdef int _cmp_add(left, Element right) except -2 |
| 15 | cpdef int _cmp_mul(left, Element right) except -2 |
15 | 16 | |
16 | 17 | cdef Expression new_Expression_from_GEx(parent, GEx juice) |
17 | 18 | cdef Expression new_Expression_from_pyobject(parent, x) |
| 19 | |
diff -r bebf93b78a83 -r afc2b3d6e435 sage/symbolic/expression.pyx
a
|
b
|
|
2375 | 2375 | cdef int _cmp_c_impl(left, Element right) except -2: |
2376 | 2376 | return left._gobj.compare((<Expression>right)._gobj) |
2377 | 2377 | |
| 2378 | cpdef int _cmp_add(left, Element right) except -2: |
| 2379 | return cmp_add(left._gobj,(<Expression>right)._gobj) |
| 2380 | |
| 2381 | cpdef int _cmp_mul(left, Element right) except -2: |
| 2382 | return cmp_mul(left._gobj,(<Expression>right)._gobj) |
| 2383 | |
2378 | 2384 | def __pow__(self, exp, ignored): |
2379 | 2385 | """ |
2380 | 2386 | Return self raised to the power of exp. |