Opened 5 years ago

Closed 4 years ago

#19700 closed defect (duplicate)

Inconsistency in Matrix_*_dense.__init__

Reported by: mmezzarobba Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: linear algebra Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

The behaviour of __init__ when called with an iterable Element as initializer is not consistent between different types of dense matrices:

sage: vec = vector(ZZ, [1])
sage: MatrixSpace(RR, 1, 1)(vec)
[1.00000000000000]
sage: MatrixSpace(CC, 1, 1)(vec)
[1.00000000000000]
sage: MatrixSpace(ZZ, 1, 1)(vec)
[...]
TypeError: unable to coerce entry to an integer
sage: MatrixSpace(QQ, 1, 1)(vec)
[...]
TypeError: entries must be coercible to a list or integer
sage: MatrixSpace(ZZ['t'], 1, 1)(vec)
[1]

Specialized versions probably should follow what generic matrices do.

Change History (1)

comment:1 Changed 4 years ago by jdemeyer

  • Milestone changed from sage-6.10 to sage-duplicate/invalid/wontfix
  • Resolution set to duplicate
  • Status changed from new to closed

Moving this to #20211.

Note: See TracTickets for help on using tickets.