Opened 5 years ago
Closed 5 years ago
#16870 closed enhancement (fixed)
Use float("inf") instead of Infinity
Reported by:  ncohen  Owned by:  

Priority:  major  Milestone:  sage6.4 
Component:  combinatorial designs  Keywords:  
Cc:  vdelecroix  Merged in:  
Authors:  Nathann Cohen  Reviewers:  Vincent Delecroix 
Report Upstream:  N/A  Work issues:  
Branch:  583622d (Commits)  Commit:  583622deb2721df9db51a93990c118498917ff3c 
Dependencies:  #16868  Stopgaps: 
Description
Yes, it makes a difference in speed T_T
Nathann
Change History (11)
comment:1 Changed 5 years ago by
 Branch set to public/16870
 Component changed from PLEASE CHANGE to combinatorial designs
 Status changed from new to needs_review
comment:2 Changed 5 years ago by
 Commit set to ab25059e918cfd4ffc1b5cbabca724219f319b7f
comment:3 Changed 5 years ago by
 Commit changed from ab25059e918cfd4ffc1b5cbabca724219f319b7f to 583622deb2721df9db51a93990c118498917ff3c
Branch pushed to git repo; I updated commit sha1. New commits:
583622d  trac #16870: remove an import

comment:4 Changed 5 years ago by
new timings
sage: from sage.combinat.designs.latin_squares import MOLS_table sage: %time MOLS_table(30) ... CPU times: user 11.2 s, sys: 20 ms, total: 11.2 s Wall time: 11.2 s
old timings
sage: from sage.combinat.designs.latin_squares import MOLS_table sage: %time MOLS_table(30) ... CPU times: user 12.1 s, sys: 28 ms, total: 12.1 s Wall time: 12.1 s
Approximately one second to compare Sage infinity to an integer... WTF!
Vincent
comment:5 Changed 5 years ago by
 Status changed from needs_review to positive_review
comment:6 Changed 5 years ago by
 Reviewers set to Vincent Delecroix
comment:7 Changed 5 years ago by
I've come across this before; it has something to do with the comparisons involving coercions IIRC. The nice thing is that it works exactly like an infinity:
sage: float('inf') == oo True
comment:8 Changed 5 years ago by
...... and it has not been implemented in Sage, so there is some hope that it is somehow efficient _
Nathann
comment:9 Changed 5 years ago by
 Status changed from positive_review to needs_review
This ticket has a dependency in needs review... so it has to wait.
Vincent
comment:10 Changed 5 years ago by
 Status changed from needs_review to positive_review
Now this is ok!
comment:11 Changed 5 years ago by
 Branch changed from public/16870 to 583622deb2721df9db51a93990c118498917ff3c
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
trac #16864: use Python string .format() + doc
trac #16817: OA for n=205,254,469,520,522,524,1262
trac #16817: docfix
trac #16846: a difference_matrices module
trac #16846: Remove obsolete functions
trac #16846: Broken doctests
trac #16846: Merge with updated #16817
trac #16846: review
trac #16868: A real difference matrix has k columns
trac #16870: Use float("inf") instead of Infinity