-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve performance of choices, add randrange step
Roughly double the performance of choices and choose_weighted, add a step parameter to randrange to match the standard library.
- Loading branch information
Showing
5 changed files
with
99 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version: 0.2.1-{build} | ||
version: 0.3.0-{build} | ||
pull_requests: | ||
do_not_increment_build_number: true | ||
environment: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
from libc.stdint cimport int32_t, uint16_t, uint32_t, uint64_t | ||
|
||
cpdef double random() nogil | ||
|
||
cdef unsigned short bit_length(unsigned long n) nogil | ||
cdef uint16_t bit_length(uint32_t n) nogil | ||
|
||
cdef unsigned long getrandbits(unsigned short k) nogil | ||
cdef uint32_t getrandbits(uint16_t k) nogil | ||
|
||
cpdef long randrange(long start, long stop) nogil | ||
cpdef int32_t randrange(int32_t start, int32_t stop, uint32_t step=?) nogil | ||
|
||
cpdef long randint(long a, long b) nogil | ||
cpdef int32_t randint(int32_t a, int32_t b) nogil | ||
|
||
cpdef double uniform(double a, double b) nogil | ||
|
||
cpdef double triangular(double low=?, double high=?, double mode=?) nogil | ||
|
||
cpdef long triangular_int(long low, long high, long mode) nogil | ||
cpdef int32_t triangular_int(int32_t low, int32_t high, int32_t mode) nogil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters