Opened 9 years ago
Closed 9 years ago
#10537 closed defect (fixed)
Fix dictionary input to sparse vector constructor
Reported by: | rbeezer | 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 9 years ago by
- Status changed from new to needs_review
Changed 9 years ago by
comment:2 Changed 9 years ago by
- Status changed from needs_review to positive_review
comment:3 Changed 9 years ago by
- Reviewers set to Dmitrii Pasechnik
comment:4 Changed 9 years ago by
- Merged in set to sage-4.6.2.alpha3
- Resolution set to fixed
- Status changed from positive_review to closed
Patchbot:
Apply trac_10537_dictionary_vector_input.patch
Depends on #10364