| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
There is no good reason it needs to be its own module.
Also removes the undocumented pymath alter/restore functions.
|
|
|
|
| |
and use them in scalarmathmodule.c instead of the old (disabled) ones.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit de9f1c92d3ca0920bce915438f0406f587aa98db, reversing
changes made to d958dec676beeac218a118fac084fa8b14bc9171.
There is a change of behavior in conversion of signed to unsigned
PyLong that shows up on my machine. For some reason this did not show
up in the travisbot tests. This reverts the merge that led to this
problem until it can be sorted out. Error shows up as
numpy/core/arrayprint.py",
line 653, in __call__
if _MININT < x < _MAXINT:
OverflowError: can't convert negative int to unsigned
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
There is a bottleneck in scalar operations, when trying to extract the
underlying C value from a Python integer/float. I have avoid conversion
for know integer type but extracting its value.
|
|
|
|
| |
Now is as good a time as any with open PR's at a low.
|
|\
| |
| | |
Avoid conversion to NumPy Scalar
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After profiling I noticed that a bottleneck for NumPy scalar operations
occurs when trying to extract the underlying C value from a Python float
because it first converts the Python scalar into its matching NumPy
scalar (e.g. PyFloat -> float64) and then it extracts the C value from
the NumPy scalar.
For some types, it is a lot faster to just extract the value directly
from the Python scalar.
I only did for PyFloat in this modified code but the code is laid out
such that it can be easily extended to other types such as Integers. I
did not do them because I was unsure if there was a special scenario to
handle across OS and/or between 32 and 64 bit platforms. The ratio of
speed to do different operations are listed below (Old time / New time
with modifications). In other words, the bigger the number, the bigger
the speed up we get.
Tested in Python 2.6 Windows
RATIO TEST
1.1 Array * Array
1.1 PyFloat * Array
1.1 Float64 * Array
1.0 PyFloat + Array
1.3 Float64 + Array
1.1 PyFloat * PyFloat
1.0 Float64 * Float64
4.0 PyFloat * Float64
2.9 PyFloat * vector1[1]
3.9 PyFloat + Float64
9.8 PyFloat < Float64
9.9 PyFloat < Float64
1.0 Create array from list
1.0 Assign PyFloat to all
1.0 Assign Float64 to all
4.2 Float64 * pyFloat * pyFloat * pyFloat * pyFloat
1.0 pyFloat * pyFloat * pyFloat * pyFloat * pyFloat
1.0 Float64 * Float64 * Float64 * Float64 * Float64
1.0 Float64 ** 2
1.0 pyFloat ** 2
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Because Numpy 1.8.0 will no longer supports Python versions < 2.6 we
no longer need to check for that and can also remove the code that is
specific to those earlier versions.
To make this a bit safer, the toplevel setup.py file now contains a
check of the Python version number and raises an error when run by an
unsupported version.
|
|\ \
| | |
| | | |
vectorize sqrt ufunc with SSE2
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
specialize the sqrt ufunc for float and double and vectorize it using
SSE2.
improves performance by 4/2 for float/double if one is not memory bound
due to non-cached data.
performance is always better on all tested machines (amd phenom X2,
intel xeon 5xxx/7xxx, core2duo, corei7)
This version will not set errno on invalid input, but numpy only checks
the fpu flags so the behavior is the same.
In principle the compiler could autovectorize it when setting ffast-math
(for no errno) and specializing the loop for the vectorizable strides
and giving it some hints (restrict, __builtin_assume_aligned, etc.),
but its simpler and more reliable to simply vectorize it by hand.
|
|/ /
| |
| |
| |
| | |
implicit declarations, wrong declarations, unused variables and fixes a
comparison typo bug in multiarraymodule.c
|
|\ \
| |/
|/| |
First attempt at BF for 2165 and added better tests for scalarmath pow function
|
| |
| |
| | |
Got rid of some white space in scalarmathmodule.c.src
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
The sources don't define NPY_NO_PREFIX and consequently none of the
unprefixed macros are defined. Using them can lead to some unexpected
results.
|
| |
| |
| |
| | |
See https://github.com/scipy/scipy/pull/279
|
|/
|
|
|
|
| |
npy_pycompat.h
npy_3kcompat.h is semi-private, so this can be done.
|
|
|
|
|
|
|
|
| |
Two templates were broken up and specialized. The corresponding
substitution loops could also be specialized, but this wasn't
done this time through. Breaking up the templates clarifies the
code at the expense of extra text, but I think the improved
clarity is a good tradeoff.
|
|
|
|
| |
versioned
|
| |
|
|
|
|
|
| |
Also a fair amount of stylistic cleanups. This module lives in a
state of stylistic sin and needs an intervention.
|
|
|
|
|
| |
With the exception of the numarray fixups these were all instances
that were results of code generation.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
more consistently
|
| |
|
| |
|
|
|
|
| |
reordering (#1671)
|
|
|
|
| |
warning comes from the correct location (#1639)
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
them to comments
|
| |
|
|
|
|
| |
Thanks to Francesc Alted.
|
| |
|
|
|
|
| |
Also, implement tp_richcompare for flagsobject.
|
|
|
|
| |
Some entries were removed in Py3K -- easy to adapt to.
|
|
|
|
| |
Remove hard tabs.
|
| |
|