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: sage-6.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 ncohen

  • 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 git

  • Commit set to ab25059e918cfd4ffc1b5cbabca724219f319b7f

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

bfbad46trac #16864: use Python string .format() + doc
3ca48dctrac #16817: OA for n=205,254,469,520,522,524,1262
f9e6569trac #16817: docfix
c92e9bftrac #16846: a difference_matrices module
fdab06etrac #16846: Remove obsolete functions
f7afe6ftrac #16846: Broken doctests
fd1bbc6trac #16846: Merge with updated #16817
c66c19btrac #16846: review
361c403trac #16868: A real difference matrix has k columns
ab25059trac #16870: Use float("inf") instead of Infinity

comment:3 Changed 5 years ago by git

  • Commit changed from ab25059e918cfd4ffc1b5cbabca724219f319b7f to 583622deb2721df9db51a93990c118498917ff3c

Branch pushed to git repo; I updated commit sha1. New commits:

583622dtrac #16870: remove an import

comment:4 Changed 5 years ago by vdelecroix

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 vdelecroix

  • Status changed from needs_review to positive_review

comment:6 Changed 5 years ago by vdelecroix

  • Reviewers set to Vincent Delecroix

comment:7 Changed 5 years ago by tscrim

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 ncohen

...... 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 vdelecroix

  • 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 vdelecroix

  • Status changed from needs_review to positive_review

Now this is ok!

comment:11 Changed 5 years ago by vbraun

  • 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.