diff options
author | Jay Bourque <jay.bourque@continuum.io> | 2013-04-16 14:52:05 -0500 |
---|---|---|
committer | Jay Bourque <jay.bourque@continuum.io> | 2013-05-06 14:39:40 -0500 |
commit | 1a285423e1a4d48cab7e66266d22a5c65e8fe66e (patch) | |
tree | 39d3f4422c92ca04ab11df9a8ae6cb53c0a8ff18 /doc | |
parent | fdb42c4f9b27c6cfe5b071bd89eae97c0053297f (diff) | |
download | numpy-1a285423e1a4d48cab7e66266d22a5c65e8fe66e.tar.gz |
Update c api documentation
Diffstat (limited to 'doc')
-rw-r--r-- | doc/release/1.8.0-notes.rst | 18 | ||||
-rw-r--r-- | doc/source/reference/c-api.types-and-structures.rst | 10 |
2 files changed, 28 insertions, 0 deletions
diff --git a/doc/release/1.8.0-notes.rst b/doc/release/1.8.0-notes.rst index c5c9d6e8d..e65658ad3 100644 --- a/doc/release/1.8.0-notes.rst +++ b/doc/release/1.8.0-notes.rst @@ -159,3 +159,21 @@ General Use of non-integer indices has been deprecated. Previously float indices were truncated to integers without warning. +C-API +~~~~~ + +New Features +============ + +When creating a ufunc, the default ufunc operand flags can be overridden +via the new op_flags attribute of the ufunc object. For example, to set +the operand flag for the first input to read/write: + +PyObject \*ufunc = PyUFunc_FromFuncAndData(...); +ufunc->op_flags[0] = NPY_ITER_READWRITE; + +This allows a ufunc to perform an operation in place. Also, global nditer flags +can be overridden via the new iter_flags attribute of the ufunc object. +For example, to set the reduce flag for a ufunc: + +ufunc->iter_flags = NPY_ITER_REDUCE_OK; diff --git a/doc/source/reference/c-api.types-and-structures.rst b/doc/source/reference/c-api.types-and-structures.rst index 07c7e07be..79a888912 100644 --- a/doc/source/reference/c-api.types-and-structures.rst +++ b/doc/source/reference/c-api.types-and-structures.rst @@ -652,6 +652,8 @@ PyUFunc_Type void *ptr; PyObject *obj; PyObject *userloops; + npy_uint32 *op_flags; + npy_uint32 *iter_flags; } PyUFuncObject; .. cmacro:: PyUFuncObject.PyObject_HEAD @@ -755,6 +757,14 @@ PyUFunc_Type numbers are always larger than :cdata:`NPY_USERDEF`. + .. cmember:: npy_uint32 PyUFuncObject.op_flags + + Override the default operand flags for each ufunc operand. + + .. cmember:: npy_uint32 PyUFuncObject.iter_flags + + Override the default nditer flags for the ufunc. + PyArrayIter_Type ---------------- |