Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Vector_symbolic_dense: Fix pickling
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jun 14, 2021
1 parent 3c36bd2 commit 49f63a4
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/sage/modules/vector_symbolic_dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,23 @@ def apply(self, *args, **kwds):


class Vector_symbolic_dense(free_module_element.FreeModuleElement_generic_dense):
pass
"""
A dense element of a module over a symbolic ring.
"""

def __reduce__(self):
"""
Provide pickling support.
TESTS::
sage: var('x,y')
(x, y)
sage: v = vector([sin(x)^2 + cos(x)^2, log(x*y), sin(x/(x^2 + x)), factorial(x+1)/factorial(x)])
sage: loads(dumps(v)) == v
True
"""
return (self.__class__, (self.parent(), tuple(self), False, False))

# Add elementwise methods.
for method in ['simplify', 'simplify_factorial',
Expand Down

0 comments on commit 49f63a4

Please sign in to comment.