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
5190f6bd
Commit
5190f6bd
authored
Oct 15, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new ndarray.base setter/getter functions by Neal Becker
parent
48a0d2fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
Cython/Includes/numpy.pxd
Cython/Includes/numpy.pxd
+19
-2
No files found.
Cython/Includes/numpy.pxd
View file @
5190f6bd
...
...
@@ -17,7 +17,7 @@
DEF
_buffer_format_string_len
=
255
cimport
python_buffer
as
pybuf
from
python_ref
cimport
PyObject
from
python_ref
cimport
PyObject
,
Py_XINCREF
,
Py_XDECREF
cimport
stdlib
cimport
stdio
...
...
@@ -904,5 +904,22 @@ cdef extern from "numpy/ufuncobject.h":
int
,
char
*
,
char
*
,
int
,
char
*
)
void
import_ufunc
()
cdef
inline
void
set_array_base
(
ndarray
arr
,
object
base
):
cdef
PyObject
*
baseptr
cdef
ndarray
raw
=
arr
if
base
is
None
:
baseptr
=
NULL
else
:
baseptr
=
<
PyObject
*>
base
Py_XINCREF
(
baseptr
)
# important to do this before decref below!
Py_XDECREF
(
raw
.
base
)
raw
.
base
=
baseptr
cdef
inline
object
get_array_base
(
ndarray
arr
):
cdef
ndarray
raw
=
arr
if
raw
.
base
==
NULL
:
return
None
else
:
return
<
object
>
raw
.
base
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