IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
14.6 One-dimensional API


14.6 One-dimensional API

The 1D in-place API is a set of functions for getting/setting elements from the innermost dimension of an array. These functions improve speed by moving type switches, ``behavior tests'', and function calls out of the per-element loop. The functions get/set a series of consequtive array elements to/from arrays of Int64, Float64, or Complex64. These functions are (even) more intrusive than the single element functions, but have better performance in many cases. They can operate on arrays of any type, with the exception of the Complex64 functions, which only handle Complex64. The functions return 0 on success and -1 on failure, with the Python error state already set. To be used profitably, the 1D API requires either a large single dimension which can be processeed in blocks or a multi-dimensional array such as an image. In the latter case, the 1D API is suitable for processing one (or more) scanlines at a time rather than the entire image at once. See the source distribution Examples/convolve/one_dimensionalmodule.c for an example of usage.

long NA_get_offset(PyArrayObject *, int N, ...)
This function applies a (variable length) set of N indices to an array and returns a byte offset into the array.

int NA_get1D_Int64(PyArrayObject *, long offset, int cnt, Int64 *out)

int NA_set1D_Int64(PyArrayObject *, long offset, int cnt, Int64 *in)

int NA_get1D_Float64(PyArrayObject *, long offset, int cnt, Float64 *out)

int NA_set1D_Float64(PyArrayObject *, long offset, int cnt, Float64 *in)

int NA_get1D_Complex64(PyArrayObject *, long offset, int cnt, Complex64 *out)

int NA_set1D_Complex64(PyArrayObject *, long offset, int cnt, Complex64 *in)

Send comments to the NumArray community.