#11772: improving error reporting of random_matrix
------------------------------+---------------------------------------------
Reporter: dimpase | Owner: jason, was
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.7.2
Component: linear algebra | Keywords:
Work_issues: | Upstream: N/A
Reviewer: Rob Beezer | Author:
Merged: | Dependencies:
------------------------------+---------------------------------------------
Comment(by dimpase):
Replying to [comment:6 rbeezer]:
> Replying to [comment:4 dimpase]:
> > there is at least one more problem with the code in
random_echelonizable_matrix
>
> I've used the function ''all the time'' the past year, so that is indeed
a surprise. Looks like it is just the `rank=1` case, based on very
limited testing.
>
> How would you like to proceed?
the function in question has in general quite suspiciously looking code:
e.g. it has
{{{
if upper_bound==None:
upper_bound=50
size=False
}}}
but then, when {{{size==False}}}, {{{upper_bound}}} is not used; that
whole {{{size}}} thing can (and should, in a clearly written code) be
replaced by if-else...
My understanding of the code is that it first gets {{{matrix}}} of
specified {{{rank}}}, and then uses it to create the
result, of the same {{{rank}}}, but taking random vectors of the row space
of {{{matrix}}}.
WIth the {{{upper_bound}}} set (and {{{size==True}}}, I don't even see how
it always succeeds to terminate!
If I set {{{upper_bound=4}}}, I run into cases that look non-terminating.
E.g. try running
{{{
for i in range(100):
rk=randint(2,13)
print rk,i
m = random_matrix( QQ, 13, 13, algorithm='echelonizable', rank=rk,
upper_bound=4)
}}}
I bet it will never finish, or at least I usually see it printing only 1
row of output, and then basically going into
an infinite loop. It seems that {{{matrix}}} itself should have well-
controlled absolute values of entries, to begin with,
but it's not done.
I'd say this has either to be re-done, or scrapped...
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11772#comment:7>
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.