#18223: cartesian products with orders
-------------------------------------+-------------------------------------
Reporter: dkrenn | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.7
Component: categories | Resolution:
Keywords: sd67 | Merged in:
Authors: Daniel Krenn | Reviewers:
Report Upstream: N/A | Work issues:
Branch: u/dkrenn/cat | Commit:
/cartesian-product-posets | 9352031b310b81f83c09ecac11b1ce15163f55f9
Dependencies: #18586 | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by {'newvalue': u'Daniel Krenn', 'oldvalue': ''}):
* status: needs_work => needs_review
* author: => Daniel Krenn
* dependencies: => #18586
* branch: public/ticket/18223 => u/dkrenn/cat/cartesian-product-posets
* commit: b924b94bc2e1aa12021cc70b3a919532aa1e350a =>
9352031b310b81f83c09ecac11b1ce15163f55f9
Old description:
> Create categories for cartesian products which have a particular order
> (lexicographically or component-wise) on its elements.
New description:
Create cartesian products which have a particular order (lexicographically
or component-wise) on its elements.
--
Comment:
I've now derived a class from
{{{sets.cartesian_product.CartesianProduct}}} for posets. One can specify
by a parameter which order one wants to take. User defined orderes can be
used as well.
{{{
sage: P = Poset((srange(3), lambda left, right: left <= right))
sage: P.CartesianProduct =
sage.sets.cartesian_product.CartesianProductPosets
sage: Cl = cartesian_product((P, P), order='lex')
sage: Cl((1, 1)) <= Cl((2, 0))
True
sage: Cc = cartesian_product((P, P), order='components')
sage: Cc((1, 1)) <= Cc((2, 0))
False
sage: def le_sum(left, right):
....: return (sum(left) < sum(right) or
....: sum(left) == sum(right) and left[0] <= right[0])
sage: Cs = cartesian_product((P, P), order=le_sum)
sage: Cs((1, 1)) <= Cs((2, 0))
True
}}}
----
Last 10 new commits:
||[http://git.sagemath.org/sage.git/commit/?id=7b098f7d1e9b4e0d26bfce6dad46889afbf19117
7b098f7]||{{{parameter extra_category for cartesian products}}}||
||[http://git.sagemath.org/sage.git/commit/?id=c6a01f816703c97cb3c2845c4d8c557567c3d0e7
c6a01f8]||{{{allow kwargs in CartesianProduct (to be used in inherited
classes)}}}||
||[http://git.sagemath.org/sage.git/commit/?id=85f44f3001f43b68ab7829b8356a56937ef10ba2
85f44f3]||{{{pass on keyword arguments in cartesian product of the sets
category}}}||
||[http://git.sagemath.org/sage.git/commit/?id=ba5dab93e6c7b33eeefc0c937dd2a7d11098807a
ba5dab9]||{{{update docstring and complete doctests}}}||
||[http://git.sagemath.org/sage.git/commit/?id=55a7020df64790be37b1bb4527f74444bc21a602
55a7020]||{{{create class for cartesian products of posets}}}||
||[http://git.sagemath.org/sage.git/commit/?id=6ed924696625f67a5e0e814c758ca5b53885bdcc
6ed9246]||{{{method "le"}}}||
||[http://git.sagemath.org/sage.git/commit/?id=4c9f72ce4920838b49e87bc8efd05ce6c6aecdef
4c9f72c]||{{{methods for comparing lexicographically and component-
wise}}}||
||[http://git.sagemath.org/sage.git/commit/?id=e589e9b6f474c1ae87781e135a462c8717c27700
e589e9b]||{{{create Element: implement <=, <, >=, >}}}||
||[http://git.sagemath.org/sage.git/commit/?id=69335cc0f8d0e4344804b3ca1de76471a8a91574
69335cc]||{{{write a class description}}}||
||[http://git.sagemath.org/sage.git/commit/?id=9352031b310b81f83c09ecac11b1ce15163f55f9
9352031]||{{{change one word in docstring}}}||
--
Ticket URL: <http://trac.sagemath.org/ticket/18223#comment:13>
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.