#13555: Doctests of random functions needs to be improved.
---------------------------------------------------------------------------------------------+
       Reporter:  JoalHeagney                                                   
             |         Owner:  mvngu   
           Type:  defect                                                        
             |        Status:  new     
       Priority:  major                                                         
             |     Milestone:  sage-5.5
      Component:  doctest                                                       
             |    Resolution:          
       Keywords:  random, matrices, random_matrix, properties of random 
objects, properties  |   Work issues:          
Report Upstream:  N/A                                                           
             |     Reviewers:          
        Authors:                                                                
             |     Merged in:          
   Dependencies:                                                                
             |      Stopgaps:          
---------------------------------------------------------------------------------------------+

Comment (by JoalHeagney):

 I also got the second lambda function incorrect. We're testing if any
 values are outside the range 4 (inclusive) to 10 exclusive in my example
 matrix.

 so it should be something like:

 {{{
 lambda x: (x < 4 | x >= 10)
 }}}
 or even better

 {{{
 lambda x: x not in range(4,10)
 }}}
 I did get an iterator-only method for getting elements of a matrix using
 this:

 {{{
 (A[valrow][valcolm] for valrow in xrange(A.dimensions()[0]) for valcolm in
 xrange(A.dimensions()[1]))

 }}}
 But then I realized that since we're only using this function
 (theoretically) in doc-checking, we probably don't have to worry about
 memory concerns and iterators versus lists. jhpalmieri's approach seems
 nice and simple.

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