#7947: iteration error in QuadraticForm.vectors_by_length()
-------------------------------+--------------------------------------------
   Reporter:  tornaria         |       Owner:  tornaria       
       Type:  defect           |      Status:  positive_review
   Priority:  major            |   Milestone:  sage-4.3.2     
  Component:  quadratic forms  |    Keywords:                 
     Author:                   |    Upstream:  N/A            
   Reviewer:                   |      Merged:                 
Work_issues:                   |  
-------------------------------+--------------------------------------------
Changes (by jonhanke):

  * status:  needs_review => positive_review


Comment:

 This is a subtle bug which arises because negative numbers are created
 when the round and ceil functions cause upper and lower bounds to
 inadvertently move past each other.  The patch discards partial vectors
 where this happens by incrementing (successively if necessary) to the next
 possible partial vector, which is the correct thing to do.  Also the patch
 omits using a condition (i<n-1) as in Comment 3a slightly below the patch,
 which is ok because zero will always be an allowed value for the (n-1)st
 entry since that first allowed interval is not shifted at all.

 The patch looks good. =)

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