numpy  2.0.0
src/umath/loops.c.src File Reference
#include "Python.h"
#include "npy_config.h"
#include "numpy/npy_common.h"
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "numpy/npy_math.h"
#include "numpy/halffloat.h"
#include "lowlevel_strided_loops.h"
#include "npy_pycompat.h"
#include "ufunc_object.h"
#include <string.h>
#include "simd.inc"

Defines

#define _UMATHMODULE
#define NPY_NO_DEPRECATED_API   NPY_API_VERSION
#define PY_ARRAY_UNIQUE_SYMBOL   _npy_umathmodule_ARRAY_API
#define NO_IMPORT_ARRAY
#define PW_BLOCKSIZE   128
#define IS_UNARY_CONT(tin, tout)
#define IS_BINARY_REDUCE
#define IS_BINARY_CONT(tin, tout)
#define IS_BINARY_CONT_S1(tin, tout)
#define IS_BINARY_CONT_S2(tin, tout)
#define OUTPUT_LOOP
#define UNARY_LOOP
#define BASE_UNARY_LOOP(tin, tout, op)
#define UNARY_LOOP_FAST(tin, tout, op)
#define UNARY_LOOP_TWO_OUT
#define BINARY_LOOP
#define BASE_BINARY_LOOP(tin, tout, op)
#define BASE_BINARY_LOOP_S(tin, tout, cin, cinp, vin, vinp, op)
#define BINARY_LOOP_FAST(tin, tout, op)
#define BINARY_REDUCE_LOOP_INNER
#define BINARY_REDUCE_LOOP(TYPE)
#define BINARY_LOOP_TWO_OUT
#define TYPE   @_floor_divide @TYPE@_divide
#define TYPE   @_fmax @TYPE@_maximum
#define TYPE   @_fmin @TYPE@_minimum
#define TYPE   @_true_divide @TYPE@_divide
#define _HALF_LOGICAL_AND(a, b)   (!npy_half_iszero(a) && !npy_half_iszero(b))
#define _HALF_LOGICAL_OR(a, b)   (!npy_half_iszero(a) || !npy_half_iszero(b))
#define HALF_true_divide   HALF_divide
#define CGE(xr, xi, yr, yi)
#define CLE(xr, xi, yr, yi)
#define CGT(xr, xi, yr, yi)
#define CLT(xr, xi, yr, yi)
#define CEQ(xr, xi, yr, yi)   (xr == yr && xi == yi)
#define CNE(xr, xi, yr, yi)   (xr != yr || xi != yi)
#define TYPE   @_true_divide @TYPE@_divide

Typedefs

typedef float halfUnaryFunc (npy_half x)
typedef float floatUnaryFunc (float x)
typedef double doubleUnaryFunc (double x)
typedef npy_longdouble longdoubleUnaryFunc (npy_longdouble x)
typedef npy_half halfBinaryFunc (npy_half x, npy_half y)
typedef float floatBinaryFunc (float x, float y)
typedef double doubleBinaryFunc (double x, double y)
typedef npy_longdouble longdoubleBinaryFunc (npy_longdouble x, npy_longdouble y)
typedef void cdoubleUnaryFunc (npy_cdouble *x, npy_cdouble *r)
typedef void cfloatUnaryFunc (npy_cfloat *x, npy_cfloat *r)
typedef void clongdoubleUnaryFunc (npy_clongdouble *x, npy_clongdouble *r)
typedef void cdoubleBinaryFunc (npy_cdouble *x, npy_cdouble *y, npy_cdouble *r)
typedef void cfloatBinaryFunc (npy_cfloat *x, npy_cfloat *y, npy_cfloat *r)
typedef void clongdoubleBinaryFunc (npy_clongdouble *x, npy_clongdouble *y, npy_clongdouble *r)

Functions

NPY_NO_EXPORT void PyUFunc_e_e (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_e_e_As_f_f (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_e_e_As_d_d (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_f_f (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_f_f_As_d_d (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_ee_e (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_ee_e_As_ff_f (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_ee_e_As_dd_d (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_ff_f (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_ff_f_As_dd_d (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_d_d (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_dd_d (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_g_g (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_gg_g (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_F_F (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_F_F_As_D_D (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_FF_F (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_FF_F_As_DD_D (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_D_D (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_DD_D (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_G_G (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_GG_G (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_O_O (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_O_O_method (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_OO_O (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_OO_O_method (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_On_Om (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void BOOL_ kind (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void BOOL__ones_like (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void TYPE __ones_like (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void TYPE _true_divide (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _power (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _fmod (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT NPY_GCC_OPT_3
void TYPE 
_absolute (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT NPY_GCC_OPT_3
void TYPE 
_sign (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _divide (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _remainder (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_negative (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_absolute (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_sign (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _not_equal (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void DATETIME_Mm_M_add (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void DATETIME_mM_M_add (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_mm_m_add (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void DATETIME_Mm_M_subtract (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void DATETIME_MM_m_subtract (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_mm_m_subtract (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_mq_m_multiply (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_qm_m_multiply (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_md_m_multiply (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_dm_m_multiply (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_mq_m_divide (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_md_m_divide (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_mm_d_divide (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _sqrt (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
static type pairwise_sum_ TYPE (@dtype @*a, npy_uintp n, npy_intp stride)
NPY_NO_EXPORT void TYPE _logical_xor (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _logical_not (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _spacing (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _copysign (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _nextafter (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _floor_divide (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _square (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void TYPE _reciprocal (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void TYPE _conjugate (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _negative (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _modf (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _frexp (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _ldexp (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _ldexp_long (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_logical_xor (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_logical_not (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_spacing (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_copysign (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_nextafter (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_floor_divide (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_remainder (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_square (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void HALF_reciprocal (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void HALF__ones_like (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void HALF_conjugate (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_absolute (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_negative (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_sign (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_modf (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_frexp (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_ldexp (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_ldexp_long (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
static void pairwise_sum_ TYPE (@ftype @*rr,@ftype @*ri,@ftype @*a, npy_uintp n, npy_intp stride)
NPY_NO_EXPORT void TYPE _multiply (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE __arg (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void OBJECT_sign (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))

Define Documentation

#define _HALF_LOGICAL_AND (   a,
 
)    (!npy_half_iszero(a) && !npy_half_iszero(b))
end repeat*
#define _HALF_LOGICAL_OR (   a,
 
)    (!npy_half_iszero(a) || !npy_half_iszero(b))
#define _UMATHMODULE
#define BASE_BINARY_LOOP (   tin,
  tout,
  op 
)
Value:
BINARY_LOOP { \
        const tin in1 = *(tin *)ip1; \
        const tin in2 = *(tin *)ip2; \
        tout * out = (tout *)op1; \
        op; \
    }
loop with contiguous specialization op should be the code working on <cite>tin in1</cite>, <cite>tin in2</cite> and storing the result in <cite>tout * out</cite> combine with NPY_GCC_OPT_3 to allow autovectorization should only be used where its worthwhile to avoid code bloat
#define BASE_BINARY_LOOP_S (   tin,
  tout,
  cin,
  cinp,
  vin,
  vinp,
  op 
)
Value:
const tin cin = *(tin *)cinp; \
    BINARY_LOOP { \
        const tin vin = *(tin *)vinp; \
        tout * out = (tout *)op1; \
        op; \
    }
#define BASE_UNARY_LOOP (   tin,
  tout,
  op 
)
Value:
UNARY_LOOP { \
        const tin in = *(tin *)ip1; \
        tout * out = (tout *)op1; \
        op; \
    }
loop with contiguous specialization op should be the code working on <cite>tin in</cite> and storing the result in <cite>tout * out</cite> combine with NPY_GCC_OPT_3 to allow autovectorization should only be used where its worthwhile to avoid code bloat
#define BINARY_LOOP
Value:
char *ip1 = args[0], *ip2 = args[1], *op1 = args[2];\
    npy_intp is1 = steps[0], is2 = steps[1], os1 = steps[2];\
    npy_intp n = dimensions[0];\
    npy_intp i;\
    for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op1 += os1)

Referenced by _absolute(), _logical_not(), _not_equal(), HALF_ldexp(), HALF_logical_xor(), PyUFunc_DD_D(), PyUFunc_e_e_As_d_d(), PyUFunc_f_f(), PyUFunc_F_F(), PyUFunc_ff_f_As_dd_d(), PyUFunc_gg_g(), PyUFunc_On_Om(), PyUFunc_OO_O_method(), and TIMEDELTA_negative().

#define BINARY_LOOP_FAST (   tin,
  tout,
  op 
)
Value:
char *ip1 = args[0], *ip2 = args[1], *op1 = args[2], *op2 = args[3];\
    npy_intp is1 = steps[0], is2 = steps[1], os1 = steps[2], os2 = steps[3];\
    npy_intp n = dimensions[0];\
    npy_intp i;\
    for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op1 += os1, op2 += os2)
#define BINARY_REDUCE_LOOP (   TYPE)
Value:
char *iop1 = args[0]; \
    TYPE io1 = *(TYPE *)iop1; \
    BINARY_REDUCE_LOOP_INNER

Referenced by PyUFunc_On_Om(), TIMEDELTA_mm_d_divide(), and TIMEDELTA_mq_m_multiply().

Value:
char *ip2 = args[1]; \
    npy_intp is2 = steps[1]; \
    npy_intp n = dimensions[0]; \
    npy_intp i; \
    for(i = 0; i < n; i++, ip2 += is2)
#define CEQ (   xr,
  xi,
  yr,
  yi 
)    (xr == yr && xi == yi)
#define CGE (   xr,
  xi,
  yr,
  yi 
)
Value:
((xr > yr && !npy_isnan(xi) && !npy_isnan(yi)) \
                          || (xr == yr && xi >= yi))

* COMPLEX LOOPS **

#define CGT (   xr,
  xi,
  yr,
  yi 
)
Value:
((xr > yr && !npy_isnan(xi) && !npy_isnan(yi)) \
                          || (xr == yr && xi > yi))
#define CLE (   xr,
  xi,
  yr,
  yi 
)
Value:
((xr < yr && !npy_isnan(xi) && !npy_isnan(yi)) \
                          || (xr == yr && xi <= yi))
#define CLT (   xr,
  xi,
  yr,
  yi 
)
Value:
((xr < yr && !npy_isnan(xi) && !npy_isnan(yi)) \
                          || (xr == yr && xi < yi))
#define CNE (   xr,
  xi,
  yr,
  yi 
)    (xr != yr || xi != yi)
#define HALF_true_divide   HALF_divide
#define IS_BINARY_CONT (   tin,
  tout 
)
Value:
(steps[0] == sizeof(tin) && \
                                   steps[1] == sizeof(tin) && \
                                   steps[2] == sizeof(tout))
binary loop input and output contiguous
#define IS_BINARY_CONT_S1 (   tin,
  tout 
)
Value:
(steps[0] == 0 && \
                                   steps[1] == sizeof(tin) && \
                                   steps[2] == sizeof(tout))
binary loop input and output contiguous with first scalar
#define IS_BINARY_CONT_S2 (   tin,
  tout 
)
Value:
(steps[0] == sizeof(tin) && \
                                   steps[1] == 0 && \
                                   steps[2] == sizeof(tout))
binary loop input and output contiguous with second scalar
Value:
((args[0] == args[2])\
        && (steps[0] == steps[2])\
        && (steps[0] == 0))

Referenced by PyUFunc_On_Om().

#define IS_UNARY_CONT (   tin,
  tout 
)
Value:
(steps[0] == sizeof(tin) && \
                                  steps[1] == sizeof(tout))
include vectorized functions and dispatchers this file is safe to include also for generic builds platform specific instructions are either masked via the proprocessor or runtime detected

* UFUNC LOOPS **

unary loop input and output contiguous
#define NO_IMPORT_ARRAY
#define NPY_NO_DEPRECATED_API   NPY_API_VERSION
#define OUTPUT_LOOP
Value:
char *op1 = args[1];\
    npy_intp os1 = steps[1];\
    npy_intp n = dimensions[0];\
    npy_intp i;\
    for(i = 0; i < n; i++, op1 += os1)

Referenced by kind().

#define PW_BLOCKSIZE   128

<

for memchr
cutoff blocksize for pairwise summation decreasing it decreases errors slightly as more pairs are summed but also lowers performance, as the inner loop is unrolled eight times it is effectively 16

Referenced by _ldexp_long(), and DATETIME_mM_M_add().

#define PY_ARRAY_UNIQUE_SYMBOL   _npy_umathmodule_ARRAY_API
#define TYPE   @_floor_divide @TYPE@_divide

* INTEGER LOOPS

begin repeat
TYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
LONG, ULONG, LONGLONG, ULONGLONG#
#type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
npy_long, npy_ulong, npy_longlong, npy_ulonglong#
#ftype = npy_float, npy_float, npy_float, npy_float, npy_double, npy_double,
npy_double, npy_double, npy_double, npy_double#
System Message: WARNING/2 (<string>, line 8) Definition list ends without a blank line; unexpected unindent.

#SIGNED = 1, 0, 1, 0, 1, 0, 1, 0, 1, 0#

end repeat1*
#define TYPE   @_fmax @TYPE@_maximum

* INTEGER LOOPS

begin repeat
TYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
LONG, ULONG, LONGLONG, ULONGLONG#
#type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
npy_long, npy_ulong, npy_longlong, npy_ulonglong#
#ftype = npy_float, npy_float, npy_float, npy_float, npy_double, npy_double,
npy_double, npy_double, npy_double, npy_double#
System Message: WARNING/2 (<string>, line 8) Definition list ends without a blank line; unexpected unindent.

#SIGNED = 1, 0, 1, 0, 1, 0, 1, 0, 1, 0#

end repeat1*
#define TYPE   @_fmin @TYPE@_minimum

* INTEGER LOOPS

begin repeat
TYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
LONG, ULONG, LONGLONG, ULONGLONG#
#type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
npy_long, npy_ulong, npy_longlong, npy_ulonglong#
#ftype = npy_float, npy_float, npy_float, npy_float, npy_double, npy_double,
npy_double, npy_double, npy_double, npy_double#
System Message: WARNING/2 (<string>, line 8) Definition list ends without a blank line; unexpected unindent.

#SIGNED = 1, 0, 1, 0, 1, 0, 1, 0, 1, 0#

end repeat1*
#define TYPE   @_true_divide @TYPE@_divide

* INTEGER LOOPS

begin repeat
TYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
LONG, ULONG, LONGLONG, ULONGLONG#
#type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
npy_long, npy_ulong, npy_longlong, npy_ulonglong#
#ftype = npy_float, npy_float, npy_float, npy_float, npy_double, npy_double,
npy_double, npy_double, npy_double, npy_double#
System Message: WARNING/2 (<string>, line 8) Definition list ends without a blank line; unexpected unindent.

#SIGNED = 1, 0, 1, 0, 1, 0, 1, 0, 1, 0#

end repeat1*
#define TYPE   @_true_divide @TYPE@_divide

* INTEGER LOOPS

begin repeat
TYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
LONG, ULONG, LONGLONG, ULONGLONG#
#type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
npy_long, npy_ulong, npy_longlong, npy_ulonglong#
#ftype = npy_float, npy_float, npy_float, npy_float, npy_double, npy_double,
npy_double, npy_double, npy_double, npy_double#
System Message: WARNING/2 (<string>, line 8) Definition list ends without a blank line; unexpected unindent.

#SIGNED = 1, 0, 1, 0, 1, 0, 1, 0, 1, 0#

end repeat1*
#define UNARY_LOOP
Value:
char *ip1 = args[0], *op1 = args[1];\
    npy_intp is1 = steps[0], os1 = steps[1];\
    npy_intp n = dimensions[0];\
    npy_intp i;\
    for(i = 0; i < n; i++, ip1 += is1, op1 += os1)

Referenced by _reciprocal(), _true_divide(), HALF_remainder(), HALF_square(), PyUFunc_dd_d(), PyUFunc_e_e_As_f_f(), PyUFunc_F_F_As_D_D(), PyUFunc_ff_f(), PyUFunc_FF_F_As_DD_D(), and TIMEDELTA_mq_m_divide().

#define UNARY_LOOP_FAST (   tin,
  tout,
  op 
)
Value:
do { \ \
    if (IS_UNARY_CONT(tin, tout)) { \
        if (args[0] == args[1]) { \
            BASE_UNARY_LOOP(tin, tout, op) \
        } \
        else { \
            BASE_UNARY_LOOP(tin, tout, op) \
        } \
    } \
    else { \
        BASE_UNARY_LOOP(tin, tout, op) \
    } \
    } \
    while (0)
Value:
char *ip1 = args[0], *op1 = args[1], *op2 = args[2];\
    npy_intp is1 = steps[0], os1 = steps[1], os2 = steps[2];\
    npy_intp n = dimensions[0];\
    npy_intp i;\
    for(i = 0; i < n; i++, ip1 += is1, op1 += os1, op2 += os2)

Typedef Documentation

System Message: SEVERE/4 (<string>, line 1)
Title overline & underline mismatch.

                          GENERIC COMPLEX LOOPS                           **
 
typedef void cfloatUnaryFunc(npy_cfloat *x, npy_cfloat *r)
typedef double doubleBinaryFunc(double x, double y)
typedef double doubleUnaryFunc(double x)
typedef float floatBinaryFunc(float x, float y)
typedef float floatUnaryFunc(float x)
typedef float halfUnaryFunc(npy_half x)
System Message: SEVERE/4 (<string>, line 1)
Title overline & underline mismatch.

                          GENERIC FLOAT LOOPS                             **
 

Function Documentation

NPY_NO_EXPORT void TYPE __arg ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TYPE __ones_like ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)
begin repeat
#type = npy_datetime, npy_timedelta# TYPE = DATETIME, TIMEDELTA#
begin repeat
TYPE = DATETIME, TIMEDELTA#
NPY_NO_EXPORT void C TYPE _absolute ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat*
begin repeat
TYPE = BYTE, SHORT, INT, LONG, LONGLONG# #type = npy_byte, npy_short, npy_int, npy_long, npy_longlong#
end repeat*
begin repeat
TYPE = UBYTE, USHORT, UINT, ULONG, ULONGLONG# #type = npy_ubyte, npy_ushort, npy_uint, npy_ulong, npy_ulonglong#
add 0 to clear -0.0

References BINARY_LOOP.

NPY_NO_EXPORT void C TYPE _conjugate ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TYPE _copysign ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void C TYPE _divide ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
FIXME: On x86 at least, dividing the smallest representable integer by -1 causes a SIFGPE (division overflow). We treat this case here (to avoid a SIGFPE crash at python level), but a good solution would be to treat integer division problems separately from FPU exceptions (i.e. a different approach than npy_set_floatstatus_divbyzero()).
divide by zero should yield a complex inf or nan

References NPY_DISABLE_C_API.

NPY_NO_EXPORT void C TYPE _floor_divide ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat1*

References npy_float_to_half(), and npy_half_to_float().

NPY_NO_EXPORT void TYPE _fmod ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TYPE _frexp ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TYPE _ldexp ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TYPE _ldexp_long ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
Additional loop to handle npy_long integer inputs (cf. #866, #1633). npy_long != npy_int on many 64-bit platforms, so we need this second loop to handle the default integer type.
Range OK
Outside npy_int range -- also ldexp will overflow in this case, given that exponent has less bits than npy_int.

References NPY_PREFETCH, PW_BLOCKSIZE, and TYPE.

NPY_NO_EXPORT void C TYPE _logical_not ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)

References BINARY_LOOP.

NPY_NO_EXPORT void C TYPE _logical_xor ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat1*
NPY_NO_EXPORT void TYPE _modf ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TYPE _multiply ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat1*
NPY_NO_EXPORT void TYPE _negative ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TYPE _nextafter ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TYPE _not_equal ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat1*
2016-01-18, 1.11

References BINARY_LOOP, NPY_DATETIME_NAT, and npy_isfinite.

NPY_NO_EXPORT void TYPE _power ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void C TYPE _reciprocal ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)

References UNARY_LOOP.

NPY_NO_EXPORT void TYPE _remainder ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
handle mixed case the way Python does

References OP.

NPY_NO_EXPORT void C TYPE _sign ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
Sign of nan is nan
fixme: sign of nan is currently 0

References DEPRECATE_FUTUREWARNING, NPY_ALLOW_C_API, and NPY_ALLOW_C_API_DEF.

NPY_NO_EXPORT void TYPE _spacing ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat1*
NPY_NO_EXPORT void TYPE _sqrt ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)

* FLOAT LOOPS **

begin repeat
Float types
#type = npy_float, npy_double# TYPE = FLOAT, DOUBLE# #scalarf = npy_sqrtf, npy_sqrt#

References npy_isnan, and OP.

Referenced by half_ctype_power().

NPY_NO_EXPORT void C TYPE _square ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)
end repeat1*
NPY_NO_EXPORT void TYPE _true_divide ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat1*

References NPY_DATETIME_NAT, and UNARY_LOOP.

NPY_NO_EXPORT void BOOL__ones_like ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)
end repeat*
NPY_NO_EXPORT void DATETIME_Mm_M_add ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)
end repeat1*
end repeat*
NPY_NO_EXPORT void DATETIME_mM_M_add ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)

References PW_BLOCKSIZE.

NPY_NO_EXPORT void DATETIME_Mm_M_subtract ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void DATETIME_MM_m_subtract ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void HALF__ones_like ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)
NPY_NO_EXPORT void HALF_absolute ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void HALF_conjugate ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void HALF_copysign ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)

References c, and npy_floor().

NPY_NO_EXPORT void HALF_floor_divide ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat*
NPY_NO_EXPORT void HALF_frexp ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void HALF_ldexp ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)

References BINARY_LOOP, and npy_isnan.

NPY_NO_EXPORT void HALF_ldexp_long ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
Additional loop to handle npy_long integer inputs (cf. #866, #1633). npy_long != npy_int on many 64-bit platforms, so we need this second loop to handle the default integer type.
Range OK
Outside npy_int range -- also ldexp will overflow in this case, given that exponent has less bits than npy_int.
NPY_NO_EXPORT void HALF_logical_not ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void HALF_logical_xor ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat*

References BINARY_LOOP.

NPY_NO_EXPORT void HALF_modf ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void HALF_negative ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void HALF_nextafter ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void HALF_reciprocal ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)
NPY_NO_EXPORT void HALF_remainder ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void HALF_sign ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
Sign of nan is nan

References c, and npy_hypot().

NPY_NO_EXPORT void HALF_spacing ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat*
NPY_NO_EXPORT void HALF_square ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)

References UNARY_LOOP.

NPY_NO_EXPORT void OBJECT_ kind ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)

* BOOLEAN LOOPS **

begin repeat
kind = equal, not_equal, greater, greater_equal, less, less_equal# OP = ==, !=, >, >=, <, <=#
end repeat*
begin repeat
kind = logical_and, logical_or# OP = &&, ||# #SC = ==, !=# #and = 1, 0#
end repeat*
begin repeat
kind = absolute, logical_not# OP = !=, ==#
begin repeat1
isa = , _avx2# #ISA = , AVX2# #CHK = 1, HAVE_ATTRIBUTE_TARGET_AVX2# #ATTR = , NPY_GCC_TARGET_AVX2#
begin repeat2

Arithmetic kind = add, subtract, multiply, bitwise_and, bitwise_or, bitwise_xor,

System Message: ERROR/3 (<string>, line 4) Unexpected indentation.

<blockquote> left_shift, right_shift#</blockquote>

System Message: WARNING/2 (<string>, line 5) Block quote ends without a blank line; unexpected unindent.

OP = +, -,*, &, |, ^, <<, >>#

System Message: WARNING/2 (<string>, line 5); backlink Inline substitution_reference start-string without end-string.
end repeat2*
begin repeat2
kind = equal, not_equal, greater, greater_equal, less, less_equal,
logical_and, logical_or#
System Message: WARNING/2 (<string>, line 4) Definition list ends without a blank line; unexpected unindent.

OP = ==, !=, >, >=, <, <=, &&, ||#

end repeat2*
end repeat1*
begin repeat1
kind = maximum, minimum# OP = >, <#
begin repeat1
kind = equal, greater, greater_equal, less, less_equal# OP = ==, >, >=, <, <=#
begin repeat1
kind = maximum, minimum# OP = >, <#
end repeat*
begin repeat
Float types
#type = npy_float, npy_double, npy_longdouble# TYPE = FLOAT, DOUBLE, LONGDOUBLE# c = f, , l# C = F, , L#
begin repeat1

Arithmetic # kind = add, subtract, multiply, divide# # OP = +, -, *, /# # PW = 1, 0, 0, 0#

System Message: WARNING/2 (<string>, line 2); backlink Inline emphasis start-string without end-string.
end repeat1*
begin repeat1
kind = equal, not_equal, less, less_equal, greater, greater_equal,
logical_and, logical_or#
System Message: WARNING/2 (<string>, line 4) Definition list ends without a blank line; unexpected unindent.

OP = ==, !=, <, <=, >, >=, &&, ||#

begin repeat1
kind = isnan, isinf, isfinite, signbit# #func = npy_isnan, npy_isinf, npy_isfinite, npy_signbit#
begin repeat1
kind = maximum, minimum# OP = >=, <=#
end repeat1*
begin repeat1
kind = fmax, fmin# OP = >=, <=#
end repeat*

* HALF-FLOAT LOOPS **

begin repeat

Arithmetic # kind = add, subtract, multiply, divide# # OP = +, -, *, /# # PW = 1, 0, 0, 0#

System Message: WARNING/2 (<string>, line 2); backlink Inline emphasis start-string without end-string.
begin repeat
kind = equal, not_equal, less, less_equal, greater,
greater_equal, logical_and, logical_or#
OP = npy_half_eq, npy_half_ne, npy_half_lt, npy_half_le, npy_half_gt,
npy_half_ge, _HALF_LOGICAL_AND, _HALF_LOGICAL_OR#
begin repeat
kind = isnan, isinf, isfinite, signbit# #func = npy_half_isnan, npy_half_isinf, npy_half_isfinite, npy_half_signbit#
begin repeat
kind = maximum, minimum# OP = npy_half_ge, npy_half_le#
end repeat*
begin repeat
kind = fmax, fmin# OP = npy_half_ge, npy_half_le#
begin repeat1
arithmetic kind = add, subtract# OP = +, -# #PW = 1, 0#
begin repeat1
kind= greater, greater_equal, less, less_equal, equal, not_equal# OP = CGT, CGE, CLT, CLE, CEQ, CNE#
end repeat1*
begin repeat1
kind = logical_and, logical_or# #OP1 = ||, ||# #OP2 = &&, ||#
begin repeat1
kind = isnan, isinf, isfinite# #func = npy_isnan, npy_isinf, npy_isfinite# OP = ||, ||, &&#
begin repeat1
kind = maximum, minimum# OP = CGE, CLE#
end repeat1*
begin repeat1
kind = fmax, fmin# OP = CGE, CLE#
end repeat*

* OBJECT LOOPS **

begin repeat
kind = equal, not_equal, greater, greater_equal, less, less_equal# OP = EQ, NE, GT, GE, LT, LE# #identity = NPY_TRUE, NPY_FALSE, -1*4#
end repeat2*
begin repeat2
kind = maximum, minimum# OP = >, <#
end repeat*
begin repeat
Float types
TYPE = HALF, FLOAT, DOUBLE, LONGDOUBLE# c = f, f, , l# C = F, F, , L#
begin repeat1

Arithmetic # kind = add, subtract, multiply, divide# # OP = +, -, *, /#

System Message: WARNING/2 (<string>, line 2); backlink Inline emphasis start-string without end-string.
begin repeat1
kind = isnan, isinf, isfinite, signbit, copysign, nextafter, spacing# #func = npy_isnan, npy_isinf, npy_isfinite, npy_signbit, npy_copysign, nextafter, spacing#
end repeat1*
begin repeat1
kind = maximum, minimum# OP = >=, <=#
begin repeat
complex types TYPE = FLOAT, DOUBLE, LONGDOUBLE# c = f, , l# C = F, , L#
begin repeat1
arithmetic kind = add, subtract# OP = +, -#
begin repeat1
kind = equal, not_equal, greater, greater_equal, less, less_equal# OP = ==, !=, >, >=, <, <=#
end repeat1*
begin repeat1
kind = maximum, minimum# OP = >, <#

* OBJECT LOOPS **

begin repeat
kind = equal, not_equal, greater, greater_equal, less, less_equal# OP = EQ, NE, GT, GE, LT, LE#
for now only use libc on 32-bit/non-x86
np.any(), search for a non-zero (true) via comparing against zero blocks, memcmp is faster than memchr on SSE4 machines with glibc >= 2.12 and memchr can only check for equal 1

<

zero by C standard
2016-01-18, 1.11
Do not use RichCompareBool because it includes an identity check (for == and !=). This is wrong for elementwise behaviour, since it means that NaN can be equal to NaN and an array is equal to itself.
2014-01-26, 1.9
2014-01-26, 1.9
2014-01-26, 1.9

References OUTPUT_LOOP.

NPY_NO_EXPORT void OBJECT_sign ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat*
in1 is NaN
NPY_NO_EXPORT void PyUFunc_d_d ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_D_D ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_dd_d ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)

References UNARY_LOOP.

NPY_NO_EXPORT void PyUFunc_DD_D ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)

References BINARY_LOOP.

NPY_NO_EXPORT void PyUFunc_e_e ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_e_e_As_d_d ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)

References BINARY_LOOP.

NPY_NO_EXPORT void PyUFunc_e_e_As_f_f ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)

References UNARY_LOOP.

NPY_NO_EXPORT void PyUFunc_ee_e ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_ee_e_As_dd_d ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_ee_e_As_ff_f ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_f_f ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_F_F ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)

References BINARY_LOOP.

NPY_NO_EXPORT void PyUFunc_f_f_As_d_d ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_F_F_As_D_D ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)

References UNARY_LOOP.

NPY_NO_EXPORT void PyUFunc_ff_f ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)

References UNARY_LOOP.

NPY_NO_EXPORT void PyUFunc_FF_F ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_ff_f_As_dd_d ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)

References BINARY_LOOP.

NPY_NO_EXPORT void PyUFunc_FF_F_As_DD_D ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)

References UNARY_LOOP.

NPY_NO_EXPORT void PyUFunc_g_g ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_G_G ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_gg_g ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)

References BINARY_LOOP.

NPY_NO_EXPORT void PyUFunc_GG_G ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_O_O ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
System Message: SEVERE/4 (<string>, line 1)
Title overline & underline mismatch.

                         GENERIC OBJECT lOOPS                             **
 
NPY_NO_EXPORT void PyUFunc_O_O_method ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_On_Om ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
A general-purpose ufunc that deals with general-purpose Python callable. func is a structure with nin, nout, and a Python callable function
No output expected, no output received, continue
Single output expected, assign and continue
Multiple returns match expected number of outputs, assign and continue. Will also gobble empty tuples if nout == 0.
Mismatch between returns and expected outputs, exit

References _BOOL(), BINARY_LOOP, BINARY_REDUCE_LOOP, IS_BINARY_REDUCE, kind(), and OP.

NPY_NO_EXPORT void PyUFunc_OO_O ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_OO_O_method ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)

References BINARY_LOOP, and OP.

NPY_NO_EXPORT void TIMEDELTA_absolute ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TIMEDELTA_dm_m_multiply ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TIMEDELTA_md_m_divide ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TIMEDELTA_md_m_multiply ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)

References OP.

NPY_NO_EXPORT void TIMEDELTA_mm_d_divide ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)

References BINARY_REDUCE_LOOP, npy_isnan, and OP.

NPY_NO_EXPORT void TIMEDELTA_mm_m_add ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TIMEDELTA_mm_m_subtract ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TIMEDELTA_mq_m_divide ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
Note: Assuming 'q' == NPY_LONGLONG

References c, npy_spacing(), and UNARY_LOOP.

NPY_NO_EXPORT void TIMEDELTA_mq_m_multiply ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
Note: Assuming 'q' == NPY_LONGLONG

References BINARY_REDUCE_LOOP, OP, and TYPE.

NPY_NO_EXPORT void TIMEDELTA_negative ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat*

* DATETIME LOOPS **

References BINARY_LOOP, and NPY_DATETIME_NAT.

NPY_NO_EXPORT void TIMEDELTA_qm_m_multiply ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
Note: Assuming 'q' == NPY_LONGLONG
NPY_NO_EXPORT void TIMEDELTA_sign ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
static type pairwise_sum_ TYPE ( @dtype @*  a,
npy_uintp  n,
npy_intp  stride 
) [static]
end repeat*
begin repeat
Float types
#type = npy_float, npy_double, npy_longdouble, npy_float# #dtype = npy_float, npy_double, npy_longdouble, npy_half# TYPE = FLOAT, DOUBLE, LONGDOUBLE, HALF# c = f, , l, # C = F, , L, # #trf = , , , npy_half_to_float#
Pairwise summation, rounding error O(lg n) instead of O(n). The recursion depth is O(lg n) as well. when updating also update similar complex floats summation
sum a block with 8 accumulators 8 times unroll reduces blocksize to 16 and allows vectorization with avx without changing summation ordering
small blocksizes seems to mess with hardware prefetch
accumulate now to avoid stack spills for single peel loop
do non multiple of 8 rest
divide by two but avoid non-multiples of unroll factor
static void pairwise_sum_ TYPE ( @ftype @*  rr,
@ftype @*  ri,
@ftype @*  a,
npy_uintp  n,
npy_intp  stride 
) [static]
begin repeat
complex types TYPE = CFLOAT, CDOUBLE, CLONGDOUBLE# #ftype = npy_float, npy_double, npy_longdouble# c = f, , l# C = F, , L#
similar to pairwise sum of real floats
sum a block with 8 accumulators 8 times unroll reduces blocksize to 16 and allows vectorization with avx without changing summation ordering
small blocksizes seems to mess with hardware prefetch
accumulate now to avoid stack spills for single peel loop
do non multiple of 8 rest
divide by two but avoid non-multiples of unroll factor