numpy  2.0.0
src/multiarray/multiarray_tests.c.src File Reference
#include <Python.h>
#include "numpy/arrayobject.h"
#include "npy_pycompat.h"

Defines

#define NPY_NO_DEPRECATED_API   NPY_API_VERSION
#define RETVAL

Typedefs

typedef void(* inplace_map_binop )(PyArrayMapIterObject *, PyArrayIterObject *)

Functions

static int copy_ name (PyArrayIterObject *itx, PyArrayNeighborhoodIterObject *niterx, npy_intp *bounds, PyObject **out)
static int copy_object (PyArrayIterObject *itx, PyArrayNeighborhoodIterObject *niterx, npy_intp *bounds, PyObject **out)
static PyObject * test_neighborhood_iterator (PyObject *NPY_UNUSED(self), PyObject *args)
static int copy_double_double (PyArrayNeighborhoodIterObject *itx, PyArrayNeighborhoodIterObject *niterx, npy_intp *bounds, PyObject **out)
static PyObject * test_neighborhood_iterator_oob (PyObject *NPY_UNUSED(self), PyObject *args)
static void test_hook (void *old, void *new, size_t size, void *user_data)
static PyObject * test_pydatamem_seteventhook_start (PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args))
static PyObject * test_pydatamem_seteventhook_end (PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args))
static void npy_float64_inplace_add (PyArrayMapIterObject *mit, PyArrayIterObject *it)
static int map_increment (PyArrayMapIterObject *mit, PyObject *op, inplace_map_binop add_inplace)
static PyObject * inplace_increment (PyObject *dummy, PyObject *args)
PyMODINIT_FUNC initmultiarray_tests (void)

Variables

static int malloc_free_counts [2]
static PyDataMem_EventHookFuncold_hook = NULL
static void * old_data
inplace_map_binop addition_funcs []
int type_numbers []
static PyMethodDef Multiarray_TestsMethods []

Define Documentation

#define NPY_NO_DEPRECATED_API   NPY_API_VERSION
#define RETVAL

Typedef Documentation


Function Documentation

static int copy_double_double ( PyArrayNeighborhoodIterObject itx,
PyArrayNeighborhoodIterObject niterx,
npy_intp bounds,
PyObject **  out 
) [static]
For each point in itx, copy the current neighborhood into an array which is appended at the output list
static int copy_object ( PyArrayIterObject itx,
PyArrayNeighborhoodIterObject niterx,
npy_intp bounds,
PyObject **  out 
) [static]
end repeat*
For each point in itx, copy the current neighborhood into an array which is appended at the output list

References PyArrayIterObject_tag::ao, PyArrayNeighborhoodIterObject::dataptr, NPY_OBJECT, PyArray_DATA, PyArray_ITER_NEXT, PyArray_NDIM, PyArray_SimpleNew, PyArrayNeighborhoodIter_Next(), PyArrayNeighborhoodIter_Reset(), and PyArrayNeighborhoodIterObject::size.

PyMODINIT_FUNC initmultiarray_tests ( void  )
static PyObject* inplace_increment ( PyObject *  dummy,
PyObject *  args 
) [static]
static int map_increment ( PyArrayMapIterObject mit,
PyObject *  op,
inplace_map_binop  add_inplace 
) [static]
static int copy_ name ( PyArrayIterObject itx,
PyArrayNeighborhoodIterObject niterx,
npy_intp bounds,
PyObject **  out 
) [static]
TODO:
  • Handle mode
begin repeat
name = double, int# #type = npy_double, npy_int# #typenum = NPY_DOUBLE, NPY_INT#
For each point in itx, copy the current neighborhood into an array which is appended at the output list

References PyArray_DATA, PyArray_ITER_NEXT, PyArray_NDIM, PyArray_SimpleNew, PyArrayNeighborhoodIter_Next(), and PyArrayNeighborhoodIter_Reset().

static void npy_float64_inplace_add ( PyArrayMapIterObject mit,
PyArrayIterObject it 
) [static]
static void test_hook ( void *  old,
void *  new,
size_t  size,
void *  user_data 
) [static]

<

malloc counter

<

free counter
static PyObject* test_neighborhood_iterator ( PyObject *  NPY_UNUSEDself,
PyObject *  args 
) [static]
Compute boundaries for the neighborhood iterator
Create the neighborhood iterator
static PyObject* test_neighborhood_iterator_oob ( PyObject *  NPY_UNUSEDself,
PyObject *  args 
) [static]
Compute boundaries for the neighborhood iterator
Create the neighborhood iterator
static PyObject* test_pydatamem_seteventhook_end ( PyObject *  NPY_UNUSEDself,
PyObject *  NPY_UNUSEDargs 
) [static]
static PyObject* test_pydatamem_seteventhook_start ( PyObject *  NPY_UNUSEDself,
PyObject *  NPY_UNUSEDargs 
) [static]

Variable Documentation

int malloc_free_counts[2] [static]
PyDataMem_SetHook tests
PyMethodDef Multiarray_TestsMethods[] [static]
Initial value:
 {
    {"test_neighborhood_iterator",
        test_neighborhood_iterator,
        METH_VARARGS, NULL},
    {"test_neighborhood_iterator_oob",
        test_neighborhood_iterator_oob,
        METH_VARARGS, NULL},
    {"test_pydatamem_seteventhook_start",
        test_pydatamem_seteventhook_start,
        METH_NOARGS, NULL},
    {"test_pydatamem_seteventhook_end",
        test_pydatamem_seteventhook_end,
        METH_NOARGS, NULL},
    {"test_inplace_increment",
        inplace_increment,
        METH_VARARGS, NULL},
    {NULL, NULL, 0, NULL}        
}
void* old_data [static]
int type_numbers[]
Initial value:
 {
NPY_FLOAT64,
-1000}