#18448: Add test if a matroid is binary
-------------------------------------+-------------------------------------
Reporter: Rudi | Owner: Rudi
Type: enhancement | Status: needs_review
Priority: minor | Milestone: sage-6.8
Component: matroid theory | Resolution:
Keywords: | Merged in:
Authors: Rudi Pendavingh | Reviewers: Travis Scrimshaw
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/tscrim/binary_matroid-18448 | ada67429271b6cee84b18067de07648e3116ab55
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by Rudi):
Hi Travis,
I was not able to trace that misaligned item myself, so thanks for making
those changes. Building docs is not going smoothly on my machine, though
it may have nothing to do with this patch:
{{{
[ -f local/etc/sage-started.txt ] || local/bin/sage-starts
build/pipestatus "./sage --docbuild --no-pdf-links all html 2>&1" "tee -a
logs/dochtml.log"
Traceback (most recent call last):
File
"/Users/rudi/Documents/Development/sage-6.7/src/doc/common/builder.py",
line 16, in <module>
import sphinx.cmdline
File "/Users/rudi/Documents/Development/sage-6.7/local/lib/python2.7
/site-packages/Sphinx-1.2.2-py2.7.egg/sphinx/cmdline.py", line 18, in
<module>
from docutils.utils import SystemMessage
File "/Users/rudi/Documents/Development/sage-6.7/local/lib/python2.7
/site-packages/docutils/utils/__init__.py", line 20, in <module>
import docutils.io
File "/Users/rudi/Documents/Development/sage-6.7/local/lib/python2.7
/site-packages/docutils/io.py", line 18, in <module>
from docutils.utils.error_reporting import locale_encoding,
ErrorString, ErrorOutput
File "/Users/rudi/Documents/Development/sage-6.7/local/lib/python2.7
/site-packages/docutils/utils/error_reporting.py", line 47, in <module>
locale_encoding = locale.getlocale()[1] or
locale.getdefaultlocale()[1]
File
"/Users/rudi/Documents/Development/sage-6.7/local/lib/python/locale.py",
line 543, in getdefaultlocale
return _parse_localename(localename)
File
"/Users/rudi/Documents/Development/sage-6.7/local/lib/python/locale.py",
line 475, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
make: *** [doc-html] Error 1
}}}
About making _local_binary_matroid() public... Well now that you bring
this up, I agree that getting the actual binary representation itself may
be useful to the user too. But with this pair of methods, if the user now
wants a verified binary representation, they need to run both methods, one
repeating the work of the other. And there would be two public methods in
the interface dealing with one issue.
Also, next up are ternary and quaternary matroids. For quaternary
matroids the situation is more subtle. Unlike `local_binary_matroid`, the
`local_quaternary_matroid` method may arrive at the conclusion that there
is no quaternary representation. My idea was to let it output `None` in
such cases. So then you would have very similar public methods behaving
slightly different.
There may be another solution. I could rewrite `is_binary()` to a method
`binary_representation()`, which outputs a `BinaryMatroid` equal to
`self`, or `None` if no such binary matroid exists. The changes would be
minimal. The user could still do `if M.binary_representation():` if they
only care about existence.
What do you think about this? If I promise not to mess up the docstrings
this time ...
Cheers,
Rudi
--
Ticket URL: <http://trac.sagemath.org/ticket/18448#comment:27>
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.