#20057: Add iterator to DisjointSet class
-------------------------------------+-------------------------------------
       Reporter:  jmantysalo         |        Owner:
           Type:  enhancement        |       Status:  needs_info
       Priority:  major              |    Milestone:  sage-7.1
      Component:  combinatorics      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Jori Mäntysalo     |    Reviewers:  Travis Scrimshaw
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jmantysalo/iterate_disjoint_set  |  1f96bc01bd77eea0bd64613a97c3f41857789526
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by jmantysalo):

 I want to make a function computing congruence of a (finite) lattice
 generated by some element sets. The result is splitting of elements to
 sets, i.e. exactly disjoint union. Hence `DisjointUnion` feels natural
 choise. The code basically iterates "elements `a` and `b` must belong to
 same equivalnce class, so combine set containing `a` and set containing
 `b`."

 If I understood right, there is no way to make a fast iteration of values
 possible; the whole idea of this data structure is to avoid moving data in
 memory so that iterating would become fast.

 I think that `itervalues()` and not `iterkeys()` is the right solution, if
 we are going to make this. There is basically no "roots" in mathematical
 sense in disjoint union. So the question is about "expected to be
 efficient". I would vote against it: we can make a slow iterator.

--
Ticket URL: <http://trac.sagemath.org/ticket/20057#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to