Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test if a matroid is ternary #18751

Closed
sagetrac-Rudi mannequin opened this issue Jun 20, 2015 · 28 comments
Closed

Add test if a matroid is ternary #18751

sagetrac-Rudi mannequin opened this issue Jun 20, 2015 · 28 comments

Comments

@sagetrac-Rudi
Copy link
Mannequin

sagetrac-Rudi mannequin commented Jun 20, 2015

There is a straightforward test to see if a matroid is ternary: generate the ternary representation local to a basis, and check matroid isomorphism. Implement this algorithm. See Matroid.is_binary(), ticket #18448.

CC: @sagetrac-yomcat

Component: matroid theory

Author: Rudi Pendavingh

Branch/Commit: 032b0a0

Reviewer: Michael Welsh

Issue created by migration from https://trac.sagemath.org/ticket/18751

@sagetrac-Rudi sagetrac-Rudi mannequin added this to the sage-6.8 milestone Jun 20, 2015
@sagetrac-Rudi
Copy link
Mannequin Author

sagetrac-Rudi mannequin commented Jun 20, 2015

Branch: u/Rudi/ternary_matroid

@sagetrac-Rudi
Copy link
Mannequin Author

sagetrac-Rudi mannequin commented Jun 20, 2015

New commits:

b28d3b9Ground work on ternary test
cf36955Initial implementation
a04a1bbSeems to work

@sagetrac-Rudi
Copy link
Mannequin Author

sagetrac-Rudi mannequin commented Jun 20, 2015

Author: Rudi Pendavingh

@sagetrac-Rudi
Copy link
Mannequin Author

sagetrac-Rudi mannequin commented Jun 20, 2015

Commit: a04a1bb

@sagetrac-Rudi sagetrac-Rudi mannequin self-assigned this Jun 20, 2015
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 20, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

f0720afFixed docstring

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 20, 2015

Changed commit from a04a1bb to f0720af

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 21, 2015

Changed commit from f0720af to 3538a8f

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 21, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

3538a8fSlightly more efficient shortest paths

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 21, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

55a4d0dDocstring of _local_ternary_matroid now has ALGORITHM section

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 21, 2015

Changed commit from 3538a8f to 55a4d0d

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 22, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

9ed83b4Make spanning forest, not spanning tree

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 22, 2015

Changed commit from 55a4d0d to 9ed83b4

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 22, 2015

Changed commit from 9ed83b4 to bba4ea5

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 22, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

bba4ea5picking entries more efficiently

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 22, 2015

Changed commit from bba4ea5 to 3830bb5

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 22, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

3830bb5Docstring fixes

@sagetrac-Rudi
Copy link
Mannequin Author

sagetrac-Rudi mannequin commented Jun 22, 2015

comment:10

All done as far as I can tell.

@sagetrac-Rudi sagetrac-Rudi mannequin added the s: needs review label Jun 22, 2015
@sagetrac-yomcat
Copy link
Mannequin

sagetrac-yomcat mannequin commented Jun 22, 2015

comment:11

Two bits of extra whitespace, both in linear_matroid.pyx:

            :meth:`M.ternary_matroid() 

(this line, twice)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 22, 2015

Changed commit from 3830bb5 to 032b0a0

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 22, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

032b0a0Whitespace begone

@sagetrac-Rudi
Copy link
Mannequin Author

sagetrac-Rudi mannequin commented Jun 22, 2015

comment:13

Argh, I really thought they were all gone.

Needs review again.

@sagetrac-Rudi sagetrac-Rudi mannequin removed the s: needs work label Jun 22, 2015
@sagetrac-Rudi sagetrac-Rudi mannequin added the s: needs review label Jun 22, 2015
@sagetrac-yomcat
Copy link
Mannequin

sagetrac-yomcat mannequin commented Jun 23, 2015

comment:14

Replying to @sagetrac-Rudi:

Argh, I really thought they were all gone.

If you use git trac review 18751 it gives you all of them highlighted with nasty red squares. For me at least.

Needs review again.

Happy with it. Just one question: If M is not ternary, then M.ternary_matroid() returns None, which appears to be a silent fail. Would an explicit error of some type be a better idea?

@sagetrac-Rudi
Copy link
Mannequin Author

sagetrac-Rudi mannequin commented Jun 23, 2015

comment:15

Replying to @sagetrac-yomcat:

Replying to @sagetrac-Rudi:

Argh, I really thought they were all gone.

If you use git trac review 18751 it gives you all of them highlighted with nasty red squares. For me at least.

Needs review again.

Happy with it. Just one question: If M is not ternary, then M.ternary_matroid() returns None, which appears to be a silent fail. Would an explicit error of some type be a better idea?

It's a matter of preference, I guess. Returning None is not a fail, it's giving information, and the docstring is quite explicit about that. If you are not certain if the matroid is ternary, you can test the output of ternary_matroid. This way, you can get the answer and the possible certificate in one fell swoop. If you just want to test, use is_ternary. Similarly, M.isomorphism(N) will also output None if the matroids are not isomorphic and is_isomorphic just performs the test.

To me, raising errors is what you do when something abnormal occurs. It is not abnormal that a matroid is not ternary.

@sagetrac-yomcat
Copy link
Mannequin

sagetrac-yomcat mannequin commented Jun 23, 2015

comment:16

Fair enough. All good now.

@tscrim
Copy link
Collaborator

tscrim commented Jun 23, 2015

comment:17

Reviewer name.

@sagetrac-Rudi
Copy link
Mannequin Author

sagetrac-Rudi mannequin commented Jun 23, 2015

Reviewer: Michael Welsh

@sagetrac-Rudi
Copy link
Mannequin Author

sagetrac-Rudi mannequin commented Jun 23, 2015

comment:18

Thanks for reviewing!

@vbraun
Copy link
Member

vbraun commented Jun 23, 2015

Changed branch from u/Rudi/ternary_matroid to 032b0a0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants