#19275: handle empty matroid in partition
-------------------------------------+-------------------------------------
       Reporter:  chaoxu             |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  trivial            |    Milestone:  sage-6.9
      Component:  matroid theory     |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Chao Xu            |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/chaoxu/partitiondividebyzero     |  79f01f9100ea8e9d8275ba72e712bcb478343102
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by tscrim):

 Yea, that is better.

 In a related issue; I tried the following ways to naturally create an
 empty matroid:
 {{{
 sage: Matroid()
 ...
 UnboundLocalError: local variable 'M' referenced before assignment
 sage: Matroid([])
 ...
 ValueError: min() arg is an empty sequence
 sage: Matroid(groundset=[], bases=[])
 ...
 ValueError: min() arg is an empty sequence
 }}}
 You might want to consider changing things so that these could give you an
 empty matroid. Also, is this correct?
 {{{
 sage: M = Matroid(Graph()); M
 Regular matroid of rank 0 on 0 elements with 1 bases
 sage: list(M.bases())
 [frozenset()]
 }}}
 (All of that is another ticket.)

 However, this worked:
 {{{
 sage: Matroid(matrix([]))
 Linear matroid of rank 0 on 0 elements represented over the Rational Field
 }}}
 Could you use that for the test since it uses the top-level interface?

--
Ticket URL: <http://trac.sagemath.org/ticket/19275#comment:7>
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.

Reply via email to