Opened 5 years ago
Closed 4 years ago
#18186 closed defect (fixed)
Add cardinality() to MatrixSpace
Reported by:  jmantysalo  Owned by:  

Priority:  major  Milestone:  sage6.9 
Component:  linear algebra  Keywords:  
Cc:  Merged in:  
Authors:  Vincent Delecroix  Reviewers:  Nathann Cohen 
Report Upstream:  N/A  Work issues:  
Branch:  164f80e (Commits)  Commit:  164f80e6d9acd7a6d44f56f76c4774ac6bee55f8 
Dependencies:  Stopgaps: 
Description
For example MatrixSpace(GF(2), 3, 4).cardinality()
should return 2^(3*4)
, and matrix spaces over inifinite rings should return Infinity
. Also MatrixSpace(GF(3),4,5) in FiniteSets()
should return True
.
Change History (11)
comment:1 Changed 5 years ago by
comment:2 Changed 5 years ago by
comment:3 Changed 5 years ago by
Let's try a 'or' instead :P
sage: MatrixSpace(GF(2),0,3) Full MatrixSpace of 0 by 3 dense matrices over Finite Field of size 2
comment:4 Changed 5 years ago by
Uh, I just don't understand. foo in bar
means bar.__contains__(foo)
. Where is __contains__
defined for FiniteSets
? Someone else to do this?
comment:5 Changed 4 years ago by
 Branch set to u/vdelecroix/18186
 Commit set to 9b5e55e57ab80d0a3713f5fa84def3d56fadcc5d
 Milestone changed from sage6.6 to sage6.9
 Status changed from new to needs_review
comment:6 Changed 4 years ago by
 Status changed from needs_review to needs_work
sage t long src/sage/combinat/tutorial.py # 1 doctest failed sage t long src/sage/structure/parent.pyx # 1 doctest failed sage t long src/sage/matrix/matrix_space.py # 3 doctests failed sage t long src/sage/rings/ring.pyx # 1 doctest failed sage t long src/doc/en/thematic_tutorials/coercion_and_categories.rst # 4 doctests failed
comment:7 Changed 4 years ago by
 Commit changed from 9b5e55e57ab80d0a3713f5fa84def3d56fadcc5d to 164f80e6d9acd7a6d44f56f76c4774ac6bee55f8
Branch pushed to git repo; I updated commit sha1. New commits:
164f80e  Trac 18186: fix doctests

comment:8 Changed 4 years ago by
Thanks! Fixed in my last commit.
comment:9 Changed 4 years ago by
 Status changed from needs_work to needs_review
comment:10 Changed 4 years ago by
 Reviewers set to Nathann Cohen
 Status changed from needs_review to positive_review
Good !
comment:11 Changed 4 years ago by
 Branch changed from u/vdelecroix/18186 to 164f80e6d9acd7a6d44f56f76c4774ac6bee55f8
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
For the second point I would modify the constructor (i.e. the
__init__
method) with the following just before the call toParent.__init__
:Vincent