#18290: cardinality and is_finite methods for CartesianProduct
-------------------------------------+-------------------------------------
Reporter: vdelecroix | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.7
Component: categories | Resolution:
Keywords: cartesian_product | Merged in:
Authors: Vincent Delecroix | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/vdelecroix/18290 | 7311911a110c5c3f0c30ab049dbaf66df7e080c7
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Old description:
> We implement two missing methods in
> `sage.sets.cartesian_product.CartesianProduct`: `is_finite`
> and `cardinality`.
>
> For example, the following was hanging
> {{{
> sage: F = Permutations(10)
> sage: cartesian_product([ZZ, Set(), ZZ]).is_finite()
> True
> sage: cartesian_product([F, F]).is_finite()
> True
> sage: cartesian_product([F, F]).cardinality()
> 13168189440000
> }}}
New description:
We implement two missing methods in
`sage.sets.cartesian_product.CartesianProduct`: `is_finite`
and `cardinality`.
--
Comment (by ncohen):
HMmmmmmmm `O_o`
I don't know enough about this code to be helpful, but computing the
cardinality of those sets seems to be too much. Isn't it a 'is_empty'
functio in those classes that you could use instead? And you probably
should call `is_empty` before the `is_finite`. Deciding emptyness is
probably easier than deciding if it is finite?... Or perhaps not, in some
weird cases? `^^;;`
--
Ticket URL: <http://trac.sagemath.org/ticket/18290#comment:3>
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.