#18347: implement the shard intersection order on permutations
-------------------------+-------------------------------------------------
Reporter: | Owner:
chapoton | Status: needs_work
Type: | Milestone: sage-6.7
enhancement | Resolution:
Priority: minor | Merged in:
Component: | Reviewers:
combinatorics | Work issues:
Keywords: poset | Commit:
Authors: | c8d90002fe00c2ace0fa56abd7b035974645ed38
Frédéric Chapoton | Stopgaps:
Report Upstream: N/A |
Branch: |
u/chapoton/18347 |
Dependencies: |
-------------------------+-------------------------------------------------
Changes (by vdelecroix):
* status: needs_review => needs_work
Comment:
Hello,
1. In `decreasing_runs` why are you creating a list to return a tuple? You
would better use
{{{
return tuple(tuple([n + 1 - i for i in r]) for r in s_bar.runs())
}}}
2. What is the point of the `cached_function` on `shard_preorder_graph`?
As far as I understand the information is only temporarily used to
construct the poset. The poset constructor basically makes comparison
between all pairs. So you are storing information that will never be used
beyond constructing the poset.
- proposition 1: implement better the data to initialize the poset from
- (ugly) proposition 2: clear the cache when you are done
{{{
Sn = [s.decreasing_runs() for s in Permutations(n)]
P = Poset([Sn, shard_compares], cover_relations=False)
shard_compares.clear_cache()
return P
}}}
3. This
{{{
dico1 = {}
# conversion: integer -> index of run in r1
for i, bloc in enumerate(r1):
for j in bloc:
dico1[j] = i
}}}
can be
{{{
dico1 = {j:i for i,bloc in enumerate(r1) for j in bloc}
}}}
Vincent
--
Ticket URL: <http://trac.sagemath.org/ticket/18347#comment:6>
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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.