Skip to content

Matrices _matrix_() method is inconsistent with expected arguments #14314

@tscrim

Description

@tscrim
sage: m = matrix({(0,0):4,(5,3):2})
sage: matrix(m) 
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-24-c5a0911a1542> in <module>()
----> 1 matrix(m)

/home/travis/sage-5.8.beta1/local/lib/python2.7/site-packages/sage/matrix/constructor.pyc in _matrix_constructor(*args, **kwds)
    526                 return args[0]._matrix_(sparse=sparse)
    527         except TypeError:
--> 528                 return args[0]._matrix_()
    529     elif len(args) == 2:
    530         if hasattr(args[0], '_matrix_'):

TypeError: _matrix_() takes exactly one argument (0 given)

In both sparse and dense integer matrices (I didn't check for other kinds), the expected input is 1 argument of a new ring for the entries.

Component: linear algebra

Author: Travis Scrimshaw

Reviewer: Andrey Novoseltsev

Merged: sage-5.9.beta3

Issue created by migration from https://trac.sagemath.org/ticket/14314

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions