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

LinearMatroid.has_line_minor should catch NotImplementedError #15295

Open
sagetrac-Stefan mannequin opened this issue Oct 16, 2013 · 3 comments
Open

LinearMatroid.has_line_minor should catch NotImplementedError #15295

sagetrac-Stefan mannequin opened this issue Oct 16, 2013 · 3 comments

Comments

@sagetrac-Stefan
Copy link
Mannequin

sagetrac-Stefan mannequin commented Oct 16, 2013

The following code should not throw an error:

sage: R.<x,y> = ZZ['x','y']
sage: Q = R.quotient([x^2 - y + 1, y^3 + 3 * x - 7])
sage: M = LinearMatroid(ring=Q, reduced_matrix=Matrix([[1,0,1],[0,1,1]]))
sage: M.has_line_minor(3)
Traceback (most recent call last):
...
NotImplementedError:

Easy solution: add NotImplementedError to the except clause in the code.

Component: matroid theory

Branch/Commit: u/Rudi/ticket/15295 @ dd3ad7d

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

@sagetrac-Stefan sagetrac-Stefan mannequin added this to the sage-6.1 milestone Oct 16, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-Rudi
Copy link
Mannequin

sagetrac-Rudi mannequin commented Feb 11, 2014

Branch: u/Rudi/ticket/15295

@sagetrac-Rudi
Copy link
Mannequin

sagetrac-Rudi mannequin commented Feb 11, 2014

Commit: dd3ad7d

@sagetrac-Rudi
Copy link
Mannequin

sagetrac-Rudi mannequin commented Feb 11, 2014

comment:4

Added that exception clause. Now the same example raises another NotImplementedError, but one that gives more information. Essentially, computing ratios in that given ring Q is not possible, which is a problem in LinearMatroid._line_ratios().

So what is the policy here? Should has_line_minor() test if computing inverses is possible before handing the problem down?


New commits:

dd3ad7dAdded an exception clause to catch a NonImplementedError below LinearMatroid.has_minor()

@sagetrac-Rudi sagetrac-Rudi mannequin added the s: needs info label Feb 11, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
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