diff options
author | Mark Wiebe <mwwiebe@gmail.com> | 2011-08-19 18:42:09 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2011-08-27 07:26:58 -0600 |
commit | 3710f2bc8fa0efe0189f7477544ee0a2996bc3e5 (patch) | |
tree | 731dfe78d8e9231f32e96267121de43dd9038dae | |
parent | a686aef330730fceb549097d64890a9f038dbbbf (diff) | |
download | numpy-3710f2bc8fa0efe0189f7477544ee0a2996bc3e5.tar.gz |
DOC: nditer: Document NpyIter_IsFirstVisit function
-rw-r--r-- | doc/source/reference/c-api.iterator.rst | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/source/reference/c-api.iterator.rst b/doc/source/reference/c-api.iterator.rst index 283f8f7d6..7173418ee 100644 --- a/doc/source/reference/c-api.iterator.rst +++ b/doc/source/reference/c-api.iterator.rst @@ -1074,6 +1074,28 @@ Construction and Destruction Returns ``NPY_SUCCEED`` or ``NPY_FAIL``. +.. cfunction:: npy_bool NpyIter_IsFirstVisit(NpyIter* iter, int iop) + + Checks to see whether this is the first time the elements of the + specified reduction operand which the iterator points at are being + seen for the first time. The function returns a reasonable answer + for reduction operands and when buffering is disabled. The answer + may be incorrect for buffered non-reduction operands. + + This function is intended to be used in EXTERNAL_LOOP mode only, + and will produce some wrong answers when that mode is not enabled. + + If this function returns true, the caller should also check the inner + loop stride of the operand, because if that stride is 0, then only + the first element of the innermost external loop is being visited + for the first time. + + *WARNING*: For performance reasons, 'iop' is not bounds-checked, + it is not confirmed that 'iop' is actually a reduction operand, + and it is not confirmed that EXTERNAL_LOOP mode is enabled. These + checks are the responsibility of the caller, and should be done + outside of any inner loops. + Functions For Iteration ----------------------- |