Hi Marc,

On 2017-01-07, Marc Mezzarobba <m...@mezzarobba.net> wrote:
> Another trick you can use if you are creating the polynomial rings 
> yourself and only need to do basic arithmetic is to define them by
>
> PolynomialRing_field(base, var, element_class=Polynomial_generic_dense)
>
> instead of PolynomialRing(base, var). You then loose a few features 
> specific to polynomial rings over fields, but you're basically saving a 
> call to Polynomial_absolute_number_field_dense.__init__() after every 
> operation, which can make basic arithmetic operations quite a bit 
> faster.

Wouldn't it be better to speed up
Polynomial_absolute_number_field_dense.__init__(), or change the
arithmetic operations by *avoiding* a call to __init__()? There are
examples in SageMath's code where the result of an arithmetic operation
X*Y is created by calling X.new(), which only calls .__new__() and
initialises the resulting element by copying from X, without __init__().

I don't know whether I will have the time to have a look at the code,
though.

Best regards,
Simon


-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to