On 8/13/07, didier deshommes <[EMAIL PROTECTED]> wrote:
> > cdef class RealQuadDoubleField_class(Field):
> >     """
> >     Real Quad Double Field
> >     """
> >
> >     def __init__(self):
> >         fpu_fix_start(self.cwf)
> >
> >     def __dealloc__(self):
> >         fpu_fix_end(self.cwf)
> >
> > [etc]
> >
> > __dealloc__() is never called until sage exits, however, since a global
> > instance of this class is created at startup. This means that all
>
>
> I didn't realize this, but I don't think RealQuadDoubleField_class
> needs to set the flags.

> If one looks at the  QuadDoubleElement class,
> the fpu_fix_*() functions are called every time a quad double number
> is created  and destroyed, which I think is more appropriate. This
> might be the solution.

Correct me if I'm wrong, but I don't think that makes sense.
If I do this:

sage: a = RQDF(5)
sage: number_of_partitions(1000)
24061467864032622473692149727991
sage: del a

then during the number_of_partitions call the CPU is set to
the wrong mode.

One possibility is that one wrap _add_c_impl, _sub_c_impl,
etc., by setting the CPU mode, doing the op, then unsetting
the cpu mode.   This is probably the robust solution (??),
but might have potential efficiency issues (which should be
investigated with careful benchmarking).

 -- William

--~--~---------~--~----~------------~-------~--~----~
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