Opened 12 years ago
Last modified 12 months ago
#10116 new defect
norm method does not work for sparse matrices
Reported by: | Victor S. Miller | Owned by: | jason, was |
---|---|---|---|
Priority: | major | Milestone: | sage-6.4 |
Component: | linear algebra | Keywords: | matrices |
Cc: | Michael Orlitzky | Merged in: | |
Authors: | Victor Miller | Reviewers: | |
Report Upstream: | Reported upstream. No feedback yet. | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
sage: M = matrix(ZZ,4,4,sparse=True) sage: M.norm() Traceback (click to the left of this block for traceback) ... AttributeError: 'sage.matrix.matrix_generic_sparse.Matrix_generic_sparse' object has no attribute 'SVD' sage: M.norm(1) Traceback (click to the left of this block for traceback) ... TypeError: base_ring (=Category of objects) must be a ring and similarly for any other argument to norm. When I do sage: M.base_ring() Integer Ring But if I do sage: M = matrix(ZZ,4,4) # without sparse=True everything works ok
Change History (9)
comment:1 Changed 12 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 12 years ago by
comment:3 Changed 11 years ago by
Report Upstream: | Reported upstream. Little or no feedback. → Reported upstream. No feedback yet. |
---|
comment:4 Changed 9 years ago by
Milestone: | sage-5.11 → sage-5.12 |
---|
comment:5 Changed 9 years ago by
Milestone: | sage-6.1 → sage-6.2 |
---|
comment:6 Changed 9 years ago by
Milestone: | sage-6.2 → sage-6.3 |
---|
comment:7 Changed 8 years ago by
Milestone: | sage-6.3 → sage-6.4 |
---|
comment:8 Changed 12 months ago by
The lack of a sparse SVD can kill this in another way:
sage: A = matrix(RDF, 1, 1, [[1]], sparse=True) sage: A.norm() ... AttributeError: 'sage.matrix.matrix_generic_sparse.Matrix_generic_sparse' object has no attribute 'SVD'
comment:9 Changed 12 months ago by
Cc: | Michael Orlitzky added |
---|
Note: See
TracTickets for help on using
tickets.
Calculating the Frobenius norm also seems problematic with sparse matrices over higher precision floating point rings. As seen in the example below, sometimes it works and sometimes it doesn't. Note that the Frobenius norm can be calculated without using the SVD.