-
-
Notifications
You must be signed in to change notification settings - Fork 688
Closed
Description
So I think this is a bug
sage: w=vector(RR,[1,2,3])
sage: d=diagonal_matrix(w)
UnboundLocalError: local variable 'v' referenced before assignment
The following fails as well
sage: d=diagonal_matrix(RR,w)
the only thing that works is
sage: d=diagonal_matrix(RR,list(w))
A stupid but easy fix is to try to turn any argument to diagonal_matrix into a list before bailing out (its in matrix/constructor.py), but there should probably be logic actually expecting vectors and analyzing the parents?
Component: linear algebra
Issue created by migration from https://trac.sagemath.org/ticket/3704