Opened 11 years ago

Last modified 8 years ago

#12518 closed enhancement

Enumerated set from iterator — at Version 4

Reported by: Vincent Delecroix Owned by: Vincent Delecroix
Priority: major Milestone: sage-5.6
Component: combinatorics Keywords: set, iterator
Cc: Štěpán Starosta Merged in:
Authors: vdelecroix Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Vincent Delecroix)

Implementation of a set (using the category framework) from a function that returns an iterator as in

sage: from sage.sets.set_from_iterator import EnumeratedSetFromIterator
sage: E = EnumeratedSetFromIterator(graphs)
{Graph on 0 vertices, Graph on 1 vertex, Graph on 2 vertices, Graph on 2 vertices, Graph on 3 vertices, Graph on 3 vertices, ...}

Note that in order to be able to pickle, we do not build directly a set from an iterator.

A previous implementation in sage-combinat was CombinatorialClassFromIterator? (in sage.combinat.combinat) which is now deprecated.

Change History (4)

comment:1 Changed 11 years ago by Vincent Delecroix

Hi,

I'm in trouble with two points:

1) What to do with the equality test when the set are both infinite ? (see in the patch the warning printing on stderr)

2) What is the good way to implement the decorator for a method ? The implementation for functions work quite well but in sage.misc.cachefunc the implementation for methods rather than functions seem more tricky.

comment:2 Changed 11 years ago by Štěpán Starosta

Cc: Štěpán Starosta added

comment:3 Changed 11 years ago by Vincent Delecroix

Description: modified (diff)

comment:4 Changed 11 years ago by Vincent Delecroix

Description: modified (diff)
Status: newneeds_review
Note: See TracTickets for help on using tickets.