#11772: improving error reporting of random_matrix
------------------------------+---------------------------------------------
Reporter: dimpase | Owner: jason, was
Type: enhancement | Status: needs_work
Priority: minor | Milestone: sage-4.7.2
Component: linear algebra | Keywords:
Work_issues: | Upstream: N/A
Reviewer: Rob Beezer | Author:
Merged: | Dependencies:
------------------------------+---------------------------------------------
Changes (by dimpase):
* status: needs_review => needs_work
Comment:
there is at least one more problem with the code in
random_echelonizable_matrix
{{{
sage: random_matrix( QQ, 3, 3, algorithm='echelonizable', rank=1,
upper_bound=60)
---------------------------------------------------------------------------
UnboundLocalError Traceback (most recent call
last)
/Users/dima/<ipython console> in <module>()
/usr/local/src/sage/current/local/lib/python2.6/site-
packages/sage/matrix/constructor.pyc in random_matrix(ring, nrows, ncols,
algorithm, *args, **kwds)
1250 return random_rref_matrix(parent, *args, **kwds)
1251 elif algorithm == 'echelonizable':
-> 1252 return random_echelonizable_matrix(parent, *args, **kwds)
1253 elif algorithm == 'diagonalizable':
1254 return random_diagonalizable_matrix(parent, *args, **kwds)
/usr/local/src/sage/current/local/lib/python2.6/site-
packages/sage/matrix/constructor.pyc in
random_echelonizable_matrix(parent, rank, upper_bound)
2995
matrix_copy=matrix.with_added_multiple_of_row(row_index,matrix.pivot_rows()[pivots],randint(-5,5))
2996 # Range for scalar multiples determined
experimentally.
-> 2997 if
max(map(abs,matrix_copy.list()))<upper_bound:
2998 # Continue if the the largest entry after a
row operation is within the bound.
2999 matrix=matrix_copy
UnboundLocalError: local variable 'matrix_copy' referenced before
assignment
sage:
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11772#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.