#11935: Make parent/element classes independent of base rings
---------------------------+------------------------------------------------
Reporter: SimonKing | Owner: nthiery
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-4.7.3
Component: categories | Keywords: parent class, element class,
category
Work_issues: | Upstream: N/A
Reviewer: | Author: Simon King
Merged: | Dependencies: #11900
---------------------------+------------------------------------------------
Comment(by SimonKing):
The second patch is posted as well. It implements approach 3. Hence, the
parent_class lazy attribute works around the cache of dynamic classes (by
not providing unpickling information when the class is created), inserting
the unpickling information only when the class has not been found in
cache.
By consequence, when first creating `Algebras(QQ).parent_class`, then its
cache key as a dynamic class only comprises the parent classes of the
super categories. Before returning it, the unpickling data (by
construction) is added. When `Algebras(GF(3)).parent_class` is created
later, it is found in the cache of dynamic classes and immediately
returned. The class returned will thus be unpickled as
`Algebras(QQ).parent_class`.
Similar to the first patch, it considerably speeds up the elliptic curve
computations:
{{{
sage: %time L = EllipticCurve('960d1').prove_BSD()
CPU times: user 3.05 s, sys: 0.07 s, total: 3.12 s
Wall time: 3.27 s
}}}
Apply only one of the two patches, at your choice!
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11935#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.