#10477: Add a random vector constructor
------------------------------+---------------------------------------------
   Reporter:  rbeezer         |       Owner:  jason, was  
       Type:  enhancement     |      Status:  needs_review
   Priority:  minor           |   Milestone:  sage-4.7    
  Component:  linear algebra  |    Keywords:              
     Author:  Rob Beezer      |    Upstream:  N/A         
   Reviewer:                  |      Merged:              
Work_issues:                  |  
------------------------------+---------------------------------------------

Comment(by rbeezer):

 Hi Felix,

 Thanks for the catch on the `degree` argument.  If no ring is specified,
 and a value is in the second slot (so assigned to the degree keyword) I
 have shoved it into the front-end of the argument list.  A new doctest
 shows this in action.  (Inserting a new random doctest then meant changing
 ''all'' of the subsequent random output.)

 So with this change in the new patch we have:

 Before:
 {{{
 sage: random_vector(10, 50)
 (1, 2, 1, 1, 3, 1, -2, -1, -63, 1)
 }}}

 After:
 {{{
 sage: random_vector(10, 50)
 (48, 24, 48, 33, 6, 9, 41, 14, 43, 44)
 }}}

 I think every one of the matrix constructors (random or otherwise)
 defaults to the integers.  I'd guess two reasons for this - Sage's roots
 in number theory, or matrices (vectors) over other rings will usually play
 nicely with integers (in other words, the integers will coerce smoothly
 into lots of rings).

 In any event, I used the integers only for some measure of consistency
 with the matrix constructors.

 Rob

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10477#comment:6>
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.

Reply via email to