#15291: The Matroid() function should support rings that don't implement 
is_field()
----------------------------------+------------------------
       Reporter:  Stefan          |        Owner:
           Type:  enhancement     |       Status:  new
       Priority:  minor           |    Milestone:  sage-6.2
      Component:  matroid theory  |   Resolution:
       Keywords:  matroid         |    Merged in:
        Authors:                  |    Reviewers:
Report Upstream:  N/A             |  Work issues:
         Branch:                  |       Commit:
   Dependencies:                  |     Stopgaps:
----------------------------------+------------------------

Comment (by Rajesh_Veeranki):

 I'm not sure what should be written inside the except block.How do we
 construct a matroid from a ring which is not a field, and which function
 to use.Please clarify,seeing the code i've pasted!
 ----

 {{{
 #!python
 if 'matrix' in kwds:
             if base_ring == GF(2):
                 M = BinaryMatroid(groundset=kwds['groundset'], matrix=A)
             elif base_ring == GF(3):
                 M = TernaryMatroid(groundset=kwds['groundset'], matrix=A)
             else:
                 try:
                     if base_ring.is_field():
                         try:
                             if base_ring.order() == 4:  # GF(4) can have
 different generators.
                                 M =
 QuaternaryMatroid(groundset=kwds['groundset'], matrix=A)
                             else:
                                 M =
 LinearMatroid(groundset=kwds['groundset'], matrix=A, ring=base_ring)
                         except NotImplementedError:
                             raise NotImplementedError
                 except NotImplementedError:
                     raise NotImplementedError
 }}}

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

Reply via email to