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

inconsistent error messages for inverting singular matrices #10028

Closed
sagetrac-dmharvey mannequin opened this issue Sep 29, 2010 · 9 comments
Closed

inconsistent error messages for inverting singular matrices #10028

sagetrac-dmharvey mannequin opened this issue Sep 29, 2010 · 9 comments

Comments

@sagetrac-dmharvey
Copy link
Mannequin

sagetrac-dmharvey mannequin commented Sep 29, 2010

n = 2:

sage: Matrix([[1, 1], [1, 1]])^(-1)
...
ZeroDivisionError: 

apparently all other n:

sage: Matrix([[1, 1, 1], [1, 1, 1], [1, 1, 1]])^(-1)
...
ZeroDivisionError: input matrix must be nonsingular

Apply trac_10028_error_messages.patch

Component: linear algebra

Author: André Apitzsch

Reviewer: Rob Beezer

Merged: sage-4.6.2.alpha4

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

@rbeezer
Copy link
Mannequin

rbeezer mannequin commented Jan 28, 2011

comment:2

I just noticed these weak error messages the other day - it'd be great to have all the cases of non-invertible matrices give a common, and informative, message. Two suggestions:

(a) At the sage prompt run search_src("ZeroDivisionError") and I think you will find two or three more places in the matrix code that could also be improved.

(b) For Python 3 raising an error will require syntax like:

raise ZeroDivisionError("input matrix must be nonsingular") 

Might as well do it that way now.

Rob

@a-andre
Copy link

a-andre commented Jan 28, 2011

Attachment: trac_10028_error_messages.patch.gz

@a-andre
Copy link

a-andre commented Jan 28, 2011

comment:3

The new patch contains a lot of small changes (hopefully not too much), most of them are related to python3 syntax.

@rbeezer
Copy link
Mannequin

rbeezer mannequin commented Jan 28, 2011

Reviewer: Rob Beezer

@rbeezer
Copy link
Mannequin

rbeezer mannequin commented Jan 28, 2011

comment:4

Looks real good. Thanks for straightening this out. Passes all tests on 4.6.2.alpha2. Positive review.

@rbeezer
Copy link
Mannequin

rbeezer mannequin commented Jan 28, 2011

Author: Andre Apitzsch

@rbeezer

This comment has been minimized.

@jdemeyer
Copy link

jdemeyer commented Feb 7, 2011

Merged: sage-4.6.2.alpha4

@jdemeyer
Copy link

Changed author from Andre Apitzsch to André Apitzsch

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

4 participants