Hi Rob,
On 21 Jun., 22:17, Rob Beezer <[email protected]> wrote:
> sage: F.<d> = GF(3^2)
> sage: d._pari_()
> Mod(d, Mod(1, 3)*d^2 + Mod(2, 3)*d + Mod(2, 3))
> sage: d._pari_init_("m")
> 'Mom(m, Mom(1, 3)*m^2 + Mom(2, 3)*m + Mom(2, 3))'
> sage: d._pari_init_("p")
> 'Mop(p, Mop(1, 3)*p^2 + Mop(2, 3)*p + Mop(2, 3))'
> sage: d._pari_init_("b")
> 'Mob(b, Mob(1, 3)*b^2 + Mob(2, 3)*b + Mob(2, 3))'
WHAT? We actually have
sage: d._pari_init_??
...
g = self.parent()._finite_field_ext_pari_modulus_as_str()
f = str(self.polynomial())
s = 'Mod(%s, %s)'%(f, g)
if var is None:
return s
return s.replace(self.parent().variable_name(), var)
Not good to use "replace" here...
But what else? A regular expression, perhaps?
Cheers,
Simon
--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org