Opened 6 years ago

Closed 5 years ago

#22073 closed defect (fixed)

Surprising matrix solve error message

Reported by: Ralf Stephan Owned by:
Priority: major Milestone: sage-8.1
Component: linear algebra Keywords:
Cc: Merged in:
Authors: Alina Bucur, Renata Paramastri Reviewers: Kiran Kedlaya, Caitlin Lienkaemper, Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 358f873 (Commits, GitHub, GitLab) Commit: 358f873e6a40a2a8a03bc104273f4d4e21bf9f7a
Dependencies: Stopgaps:

Status badges

Description

This cannot be right, can it?

sage: M = matrix([(3,-1,0,0),(1,1,-2,0),(0,0,0,-3)])
sage: B = matrix(QQ,3,1, [0,0,-1])
sage: M.rows()
[(3, -1, 0, 0), (1, 1, -2, 0), (0, 0, 0, -3)]
sage: B.rows()
[(0), (0), (-1)]
sage: M.nrows()
3
sage: B.nrows()
3
sage: M.solve_left(B)
...
ValueError: number of rows of self must equal number of rows of B

Change History (11)

comment:1 Changed 5 years ago by Alina Bucur

Branch: u/alina/surprising_matrix_solve_error_message

comment:2 Changed 5 years ago by Alina Bucur

Authors: Alina, Renata
Commit: fa579ae58ed1005a45fc8105e81f4082bc3cae3b
Status: newneeds_review

New commits:

fa579aefixed the error message for solve_left() when the number of columns is not the same on LHS and RHS

comment:3 Changed 5 years ago by Alyson Deines

Keywords: sd90 added

comment:4 Changed 5 years ago by Caitlin Lienkaemper

Authors: Alina, Renata
Keywords: sd90 removed
Reviewers: Caitlin Lienkaemper
Status: needs_reviewpositive_review

comment:5 Changed 5 years ago by Travis Scrimshaw

Milestone: sage-7.5sage-8.1
Status: positive_reviewneeds_work

The author name is now missing (should be in "First Last" format). Also, remove all of your (added) trailing whitespace and break this long line into <80 characters long:

        If the number of columns on the left and right hand sides is different it raises the error message 'number of columns                    of self must equal number of columns of B'

Actually, I would just remove that line altogether as it doesn't add anything practical to the documentation and you have the examples.

Last edited 5 years ago by Travis Scrimshaw (previous) (diff)

comment:6 Changed 5 years ago by Caitlin Lienkaemper

Authors: Alina Bucur, Renata Paramastri

put author info that I accidentally deleted back, now w/ last names

Last edited 5 years ago by Caitlin Lienkaemper (previous) (diff)

comment:7 Changed 5 years ago by Kiran Kedlaya

For the record, all doctests pass on k8s.

comment:8 Changed 5 years ago by git

Commit: fa579ae58ed1005a45fc8105e81f4082bc3cae3b358f873e6a40a2a8a03bc104273f4d4e21bf9f7a

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

358f873removed trailing white spaces and long sentence

comment:9 Changed 5 years ago by Alina Bucur

Status: needs_workneeds_review

Removed the long sentence completely as tscrim suggested and got rid of the trailing white spaces.

comment:10 Changed 5 years ago by Kiran Kedlaya

Reviewers: Caitlin LienkaemperKiran Kedlaya, Caitlin Lienkaemper, Travis Scrimshaw
Status: needs_reviewpositive_review

Looks good now (and all tests still pass). Positive review.

comment:11 Changed 5 years ago by Volker Braun

Branch: u/alina/surprising_matrix_solve_error_message358f873e6a40a2a8a03bc104273f4d4e21bf9f7a
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.