Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
5bf7fea5
Commit
5bf7fea5
authored
Oct 27, 2009
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
numpy.pxd: Add intp_t and uintp_t
parent
ebcf2c43
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
Cython/Includes/numpy.pxd
Cython/Includes/numpy.pxd
+4
-2
tests/run/numpy_test.pyx
tests/run/numpy_test.pyx
+4
-0
No files found.
Cython/Includes/numpy.pxd
View file @
5bf7fea5
...
...
@@ -26,6 +26,7 @@ cdef extern from "Python.h":
cdef
extern
from
"numpy/arrayobject.h"
:
ctypedef
Py_intptr_t
npy_intp
ctypedef
size_t
npy_uintp
cdef
enum
NPY_TYPES
:
NPY_BOOL
...
...
@@ -193,7 +194,7 @@ cdef extern from "numpy/arrayobject.h":
cdef
bint
little_endian
=
((
<
char
*>&
endian_detector
)[
0
]
!=
0
)
ndim
=
PyArray_NDIM
(
self
)
if
sizeof
(
npy_intp
)
!=
sizeof
(
Py_ssize_t
):
copy_shape
=
1
else
:
...
...
@@ -735,7 +736,8 @@ ctypedef double complex complex128_t
# numpy.int corresponds to 'l' and numpy.long to 'q'
ctypedef
npy_long
int_t
ctypedef
npy_longlong
long_t
ctypedef
npy_intp
intp_t
ctypedef
npy_uintp
uintp_t
ctypedef
npy_ulong
uint_t
ctypedef
npy_ulonglong
ulong_t
...
...
tests/run/numpy_test.pyx
View file @
5bf7fea5
...
...
@@ -140,6 +140,8 @@ try:
>>> test_dtype(np.long, inc1_long_t)
>>> test_dtype(np.float, inc1_float_t)
>>> test_dtype(np.double, inc1_double_t)
>>> test_dtype(np.intp, inc1_intp_t)
>>> test_dtype(np.uintp, inc1_uintp_t)
>>> test_dtype(np.longdouble, inc1_longdouble_t)
...
...
@@ -315,6 +317,8 @@ def inc1_long_t(np.ndarray[np.long_t] arr): arr[1] += 1
def
inc1_float_t
(
np
.
ndarray
[
np
.
float_t
]
arr
):
arr
[
1
]
+=
1
def
inc1_double_t
(
np
.
ndarray
[
np
.
double_t
]
arr
):
arr
[
1
]
+=
1
def
inc1_longdouble_t
(
np
.
ndarray
[
np
.
longdouble_t
]
arr
):
arr
[
1
]
+=
1
def
inc1_intp_t
(
np
.
ndarray
[
np
.
intp_t
]
arr
):
arr
[
1
]
+=
1
def
inc1_uintp_t
(
np
.
ndarray
[
np
.
uintp_t
]
arr
):
arr
[
1
]
+=
1
# The tests below only work on platforms that has the given types
def
inc1_int32_t
(
np
.
ndarray
[
np
.
int32_t
]
arr
):
arr
[
1
]
+=
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment