Comments (4)
from mitm-sage.
@nthiery I think you misunderstood the question about the canonical function to build a polynomial.
I need a function f such that f(R, d) returns a polynomial in polynomial ring R with coefficient dictionary d.
from mitm-sage.
Sorry if I have not made my point clear. Up to curyfication, R is that function:
def f(R, d):
return R(d)
from mitm-sage.
I've added the code as envisioned, but there are still some issues.
Nicolas recommends hooking directly into the pickling.
He expects the unpickling-based work flow will not work for nested objects.
The necessary code would be
from sage.rings.polynomial.multi_polynomial_ring_base import MPolynomialRing_base
from sage.rings.polynomial.polynomial_ring import PolynomialRing_general
from sage.rings.polynomial.polynomial_element import Polynomial
def pickle_polynomial(p):
return lambda R,d: R(d), (p.parent(), p.dict())
copyreg.pickle(Polynomial, pickle_polynomial)
def pickle_polynomial_ring(p):
return lambda br,vn: PolynomialRing(br,vn), (p.base_ring(), p.varnames())
copyreg.pickle(MPolynomialRing_base, pickle_polynomial_ring)
We should also double-check what common base class Sage polynomials have. I received different results at two different times.
from mitm-sage.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mitm-sage.