Opened 12 years ago
Closed 12 years ago
#10537 closed defect (fixed)
Fix dictionary input to sparse vector constructor
Reported by: | Rob Beezer | Owned by: | jason, was |
---|---|---|---|
Priority: | major | Milestone: | sage-4.6.2 |
Component: | linear algebra | Keywords: | |
Cc: | Merged in: | sage-4.6.2.alpha3 | |
Authors: | Rob Beezer | Reviewers: | Dmitrii Pasechnik |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
A dictionary can be used to specify the entries of a vector, and then the result will be sparse. The degree of the vector is implicitly determined by the largest key/index. You can fool this by creating a zero entry with a large key/index. But then problems arise later if you try to use this constructor with a dictionary created programatically - you can't fool it twice.
So working with sparse matrices is either unreliable (as described), or inefficient (convert from dictionaries to lists and back again).
Patch slowly ate away at the old prepare_dict
until almost nothing was left, and then it got subsumed into prepare
. Passes all tests in sage/modules and I will run full tests overnight.
Depends on 4.6.1.alpha3 and #10364 which had improved error messages for this situation.
Attachments (1)
Change History (5)
comment:1 Changed 12 years ago by
Authors: | → Rob Beezer |
---|---|
Status: | new → needs_review |
Changed 12 years ago by
Attachment: | trac_10537_dictionary_vector_input.patch added |
---|
comment:2 Changed 12 years ago by
Status: | needs_review → positive_review |
---|
comment:3 Changed 12 years ago by
Reviewers: | → Dmitrii Pasechnik |
---|
comment:4 Changed 12 years ago by
Merged in: | → sage-4.6.2.alpha3 |
---|---|
Resolution: | → fixed |
Status: | positive_review → closed |
Patchbot:
Apply trac_10537_dictionary_vector_input.patch
Depends on #10364