#18223: cartesian products with orders
-------------------------------------+-------------------------------------
Reporter: dkrenn | Owner:
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-6.7
Component: categories | Resolution:
Keywords: sd67 | Merged in:
Authors: Daniel Krenn | Reviewers: Benjamin Hackl
Report Upstream: N/A | Work issues:
Branch: u/dkrenn/cat | Commit:
/cartesian-product-posets | e87db1a0f635bb81e3510dfa7ca1617e31462380
Dependencies: #18586 | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by dkrenn):
Replying to [comment:19 vdelecroix]:
> 5. Instead of `order=components` I would use `order=product` which is
the standard name (see [https://en.wikipedia.org/wiki/Product_order
wikipedia]). And put it first in your list in view of comment 4.
Changed.
> 6. Why
> {{{
> super(CartesianProductPosets, self).__init__(sets, category, **kwargs)
> from sage.categories.posets import Posets
> self._refine_category_(Posets())
> }}}
> instead of
> {{{
> category = category.join(Posets())
> CartesianProduct.__init__(sets, category, **kwargs)
> }}}
> I guess that the refine category operation is highly non trivial
(perhaps even sloppy).
Yes, it was kind of sloppy. Changed now.
> 7. (from your doctest) This is ugly
> {{{
> sage: QQ.CartesianProduct =
sage.sets.cartesian_product.CartesianProductPosets
> }}}
> Is this the way we are supposed to use to construct cartesian product
of posets!?
This changes, once `QQ` has category `Posets` as well (#19269).
> 8. Why not implementing `_richcmp_` (see #18305)? You would end up with
less code.
Skipped; see comment above.
> 9. It is always (should always be) faster to use `x <= y` instead of
`x.__le__(y)`. You avoid a lookup.
Ok, thanks for this hint.
--
Ticket URL: <http://trac.sagemath.org/ticket/18223#comment:26>
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.