Opened 3 years ago
Closed 2 years ago
#22073 closed defect (fixed)
Surprising matrix solve error message
Reported by:  rws  Owned by:  

Priority:  major  Milestone:  sage8.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)  Commit:  358f873e6a40a2a8a03bc104273f4d4e21bf9f7a 
Dependencies:  Stopgaps: 
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 2 years ago by
 Branch set to u/alina/surprising_matrix_solve_error_message
comment:2 Changed 2 years ago by
 Commit set to fa579ae58ed1005a45fc8105e81f4082bc3cae3b
 Status changed from new to needs_review
comment:3 Changed 2 years ago by
 Keywords sd90 added
comment:4 Changed 2 years ago by
 Keywords sd90 removed
 Reviewers set to Caitlin Lienkaemper
 Status changed from needs_review to positive_review
comment:5 Changed 2 years ago by
 Milestone changed from sage7.5 to sage8.1
 Status changed from positive_review to needs_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.
comment:6 Changed 2 years ago by
put author info that I accidentally deleted back, now w/ last names
comment:7 Changed 2 years ago by
For the record, all doctests pass on k8s.
comment:8 Changed 2 years ago by
 Commit changed from fa579ae58ed1005a45fc8105e81f4082bc3cae3b to 358f873e6a40a2a8a03bc104273f4d4e21bf9f7a
Branch pushed to git repo; I updated commit sha1. New commits:
358f873  removed trailing white spaces and long sentence

comment:9 Changed 2 years ago by
 Status changed from needs_work to needs_review
Removed the long sentence completely as tscrim suggested and got rid of the trailing white spaces.
comment:10 Changed 2 years ago by
 Reviewers changed from Caitlin Lienkaemper to Kiran Kedlaya, Caitlin Lienkaemper, Travis Scrimshaw
 Status changed from needs_review to positive_review
Looks good now (and all tests still pass). Positive review.
comment:11 Changed 2 years ago by
 Branch changed from u/alina/surprising_matrix_solve_error_message to 358f873e6a40a2a8a03bc104273f4d4e21bf9f7a
 Resolution set to fixed
 Status changed from positive_review to closed
New commits:
fixed the error message for solve_left() when the number of columns is not the same on LHS and RHS