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:

Status badges

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)

trac_10537_dictionary_vector_input.patch (7.9 KB) - added by Rob Beezer 12 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 12 years ago by Rob Beezer

Authors: Rob Beezer
Status: newneeds_review

Patchbot:

Apply trac_10537_dictionary_vector_input.patch

Depends on #10364

Changed 12 years ago by Rob Beezer

comment:2 Changed 12 years ago by Dima Pasechnik

Status: needs_reviewpositive_review

comment:3 Changed 12 years ago by Jeroen Demeyer

Reviewers: Dmitrii Pasechnik

comment:4 Changed 12 years ago by Jeroen Demeyer

Merged in: sage-4.6.2.alpha3
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.