| 1 | initial version |
So, I asked my question just a few minutes too soon. I had two problems: I needed to define the TestRingElement before TestRing, and I needed to specify the Element attribute of TestRing. After the right things are imported, the following code runs:
class TestRingElement(CombinatorialFreeModuleElement):
def __init__(self, M, x):
super(TestRingElement, self).__init__(M, x)
self.data = x
class TestRing(CombinatorialFreeModule):
Element = TestRingElement
def __init__(self, R, G):
super(TestRing, self).__init__(R, G)
I am still curious, though, if anyone can answer my other question about passing in lists to the constructor.
| 2 | No.2 Revision |
So, I asked my question just a few minutes too soon. I had two problems: I needed to define the TestRingElement before TestRing, and I needed to specify the Element attribute of TestRing. After the right things are imported, the following code runs:runs as expected:
class TestRingElement(CombinatorialFreeModuleElement):
def __init__(self, M, x):
super(TestRingElement, self).__init__(M, x)
self.data = x
class TestRing(CombinatorialFreeModule):
Element = TestRingElement
def __init__(self, R, G):
super(TestRing, self).__init__(R, G)
I am still curious, though, if anyone can answer my other question about passing in lists to the constructor.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.