Hi Florent,

Thanks! I do not understand how to use it though. If I inherit

from sage.structure.list_clone import ClonableIntArray, ClonableElement

and replace

class LinearExtensionOfPoset(CombinatorialObject, Element):

by

class LinearExtensionOfPoset(ClonableIntArray, ClonableElement):

and put

        ClonableIntArray.__init__(self, linear_extension)
        ClonableElement.__init__(self, parent)

in my _init__ file, then I get a lot of error messages (whereas all tests pass 
before the
change).

Do I need to replace

 Element = LinearExtensionOfPoset

as well by

  ClonableElement = LinearExtensionOfPoset?

Cheers,

Anne

On 2/18/12 12:43 PM, Florent Hivert wrote:
>       Hi Anne,
> 
>> Thanks! The only problem is that when it is not yet imported one gets the
>> same error and hence it is hard to locate:
> 
> You should use "search_src":
> 
> sage: search_src("ClonableInt")
> sets/finite_set_map_cy.pxd:14:from sage.structure.list_clone cimport 
> ClonableIntArray
> sets/finite_set_map_cy.pxd:16:cdef class FiniteSetMap_MN(ClonableIntArray):
> [...]
> structure/list_clone.pxd:47:cdef class ClonableIntArray(ClonableElement):
> structure/list_clone.pxd:52:    cpdef ClonableIntArray __copy__(self)
> 
> 
>>
>> sage: import_statements(ClonableIntArray)
>> ---------------------------------------------------------------------------
>> NameError                                 Traceback (most recent call last)
>>
>> /Applications/sage-5.0.beta3/devel/sage-combinat/sage/combinat/<ipython 
>> console> in <module>()
>>
>> NameError: name 'ClonableIntArray' is not defined
> 
>> So what would be the advantage to use ClonableInArray over
>> CombintorialObject?
> 
> 1] CombintorialObject will shortly be deprecated;
> 
> 2] ClonableInArray is Cython which could potentially speedup things: eg: as I
> remember, for our computation on NDPF monoids, FiniteSetMaps are nearly 100
> time faster than the previous implementation;
> 
> 3] They use the Parent/Element pattern which is required in Sage;
> 
> 4] The memory footprint is much smaller.
> 
> Cheers,
> 
> Florent

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.

Reply via email to