On 11/6/07, Simon King <[EMAIL PROTECTED]> wrote:
> Dear sage-supporters,
>
> assume that i have defined some Singular object (say, via
> singular.eval), and later i want to produce a Sage object that refers
> to it. I tried:
> sage: singular.eval('ring r = 0,(x,y,z),dp')
> ''
> sage: R=singular('r')
>
> But unfortunately R does not refer to r but to a copy of r, as the
> following shows:
> sage: R.name()
> 'sage5'
>
> How can i make R directly point to r?

Unfortunately, this is not implemented.  Implementing it would require
changing SAGE_ROOT/devel/sage/sage/interfaces/singular.py, in some
slightly nontrivial ways -- in particular the __init__ method of
SingularElement would have to be changed, etc.

You can accomplish the same thing as follows, by simply changing the
._name attribute (and being sure to kill the sage5 _name that is
generated, to avoid a memory leak):

sage: singular.eval('ring r = 0,(x,y,z),dp')
''
sage: R = singular('r')
sage: singular.clear(R.name())
sage: R._name = 'r'
sage: R
//   characteristic : 0
//   number of vars : 3
//        block   1 : ordering dp
//                  : names    x y z
//        block   2 : ordering C

However, if your goal is maximizing speed, then doing the above
would be silly.

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to