On Nov 2, 8:25 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
> On 11/2/07, Carl Witty <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Nov 2, 11:25 am, Robert Bradshaw <[EMAIL PROTECTED]>
> > wrote:
> > > :-(, but I have to concede to your logic. The line to change is 148
> > > of coerce.pxi. Setting this value to 0 will turn them completely off.
> > > Other than numpy, (and the builtin libraries), do we use any other
> > > extension types? If there is a finite list of things for which it
> > > won't work, it would be possible to disable it just for those.
>
> > Another possibility is to figure out where in Sage it's safe to use
> > and particularly helpful, and explicitly enable it for those sections
> > of code.
>
> > And another possibility, which restores the in-place optimization to
> > (some) Cython code but not Python code, is to change Cython so that if
> > it knows the things it's adding/multiplying/etc. are of subtypes of
> > sage.structure.element.Element, then it bypasses PyNumber_Add and
> > calls a method on the objects directly.  This method could use the in-
> > place optimization.  (Plus, we might gain a tiny bit of speed by
> > skipping PyNumber_Add anyway.)
>
> +1 to both of these ideas.
>
>  -- William

For now I have applied the following patch:

# HG changeset patch
# User Robert Bradshaw
# Date 1194031602 25200
# Node ID d235183a07ac596bb10db446be4a0e64a3a66a4c
# Parent  71f280c221ca1677e4452b685d584eba49f822a1
turn off in-place optimizations, see #1038

diff -r 71f280c221ca -r d235183a07ac sage/structure/coerce.pxi
--- a/sage/structure/coerce.pxi Thu Nov 01 21:03:52 2007 -0700
+++ b/sage/structure/coerce.pxi Fri Nov 02 12:26:42 2007 -0700
@@ -145,7 +145,7 @@ cdef inline RingElement _idiv_c(RingElem

 cdef enum:
     # 3 references: handle, scope container, and arithmatic call
stack
-    inplace_threshold = 3
+    inplace_threshold = 0


Cheers,

Michael


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to