numpy  2.0.0
src/umath/loops.h.src File Reference

Defines

#define _NPY_UMATH_LOOPS_H_
#define BOOL_invert   BOOL_logical_not
#define BOOL_negative   BOOL_logical_not
#define BOOL_add   BOOL_logical_or
#define BOOL_bitwise_and   BOOL_logical_and
#define BOOL_bitwise_or   BOOL_logical_or
#define BOOL_logical_xor   BOOL_not_equal
#define BOOL_bitwise_xor   BOOL_logical_xor
#define BOOL_multiply   BOOL_logical_and
#define BOOL_subtract   BOOL_logical_xor
#define BOOL_maximum   BOOL_logical_or
#define BOOL_minimum   BOOL_logical_and
#define BOOL_fmax   BOOL_maximum
#define BOOL_fmin   BOOL_minimum
#define S   @@TYPE@_floor_divide @S@@TYPE@_divide
#define S   @@TYPE@_fmax @S@@TYPE@_maximum
#define S   @@TYPE@_fmin @S@@TYPE@_minimum
#define TYPE   @_true_divide @TYPE@_divide
#define CGE(xr, xi, yr, yi)   (xr > yr || (xr == yr && xi >= yi));
#define CLE(xr, xi, yr, yi)   (xr < yr || (xr == yr && xi <= yi));
#define CGT(xr, xi, yr, yi)   (xr > yr || (xr == yr && xi > yi));
#define CLT(xr, xi, yr, yi)   (xr < yr || (xr == yr && xi < yi));
#define CEQ(xr, xi, yr, yi)   (xr == yr && xi == yi);
#define CNE(xr, xi, yr, yi)   (xr != yr || xi != yi);
#define C   @TYPE@_true_divide C@TYPE@_divide
#define TIMEDELTA_mq_m_true_divide   TIMEDELTA_mq_m_divide
#define TIMEDELTA_md_m_true_divide   TIMEDELTA_md_m_divide
#define TIMEDELTA_mm_d_true_divide   TIMEDELTA_mm_d_divide
#define TIMEDELTA_mq_m_floor_divide   TIMEDELTA_mq_m_divide
#define TIMEDELTA_md_m_floor_divide   TIMEDELTA_md_m_divide
#define TIMEDELTA_fmin   TIMEDELTA_minimum
#define TIMEDELTA_fmax   TIMEDELTA_maximum
#define DATETIME_fmin   DATETIME_minimum
#define DATETIME_fmax   DATETIME_maximum

Functions

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 S TYPE __ones_like (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void S TYPE _square isa (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void S TYPE
_conjugate 
isa (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void S TYPE _true_divide (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void S TYPE _power (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void S TYPE _fmod (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void U TYPE _absolute (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void U 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 TYPE _sqrt (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
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 _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 C TYPE _multiply (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void C TYPE __arg (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 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 OBJECT_sign (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))

Define Documentation

vim:syntax=c
#define BOOL_add   BOOL_logical_or
#define BOOL_bitwise_and   BOOL_logical_and
#define BOOL_bitwise_or   BOOL_logical_or
#define BOOL_fmax   BOOL_maximum
#define BOOL_fmin   BOOL_minimum
#define BOOL_invert   BOOL_logical_not
#define BOOL_logical_xor   BOOL_not_equal
#define BOOL_maximum   BOOL_logical_or
#define BOOL_minimum   BOOL_logical_and
#define BOOL_multiply   BOOL_logical_and
#define BOOL_negative   BOOL_logical_not
#define C   @TYPE@_true_divide C@TYPE@_divide
end repeat1*

Referenced by c().

#define CEQ (   xr,
  xi,
  yr,
  yi 
)    (xr == yr && xi == yi);
#define CGE (   xr,
  xi,
  yr,
  yi 
)    (xr > yr || (xr == yr && xi >= yi));
end repeat*

* COMPLEX LOOPS **

#define CGT (   xr,
  xi,
  yr,
  yi 
)    (xr > yr || (xr == yr && xi > yi));
#define CLE (   xr,
  xi,
  yr,
  yi 
)    (xr < yr || (xr == yr && xi <= yi));
#define CLT (   xr,
  xi,
  yr,
  yi 
)    (xr < yr || (xr == yr && xi < yi));
#define CNE (   xr,
  xi,
  yr,
  yi 
)    (xr != yr || xi != yi);
#define DATETIME_fmax   DATETIME_maximum
#define DATETIME_fmin   DATETIME_minimum
#define S   @@TYPE@_floor_divide @S@@TYPE@_divide

* INTEGER LOOPS

begin repeat
TYPE = BYTE, SHORT, INT, LONG, LONGLONG#
begin repeat1
both signed and unsigned integer types #s = , u# S = , U#
#define S   @@TYPE@_fmax @S@@TYPE@_maximum

* INTEGER LOOPS

begin repeat
TYPE = BYTE, SHORT, INT, LONG, LONGLONG#
begin repeat1
both signed and unsigned integer types #s = , u# S = , U#
#define S   @@TYPE@_fmin @S@@TYPE@_minimum

* INTEGER LOOPS

begin repeat
TYPE = BYTE, SHORT, INT, LONG, LONGLONG#
begin repeat1
both signed and unsigned integer types #s = , u# S = , U#
#define TIMEDELTA_fmax   TIMEDELTA_maximum
#define TIMEDELTA_fmin   TIMEDELTA_minimum
#define TIMEDELTA_mm_d_floor_divide TIMEDELTA_mm_d_divide
Special case equivalents to above functions
#define TYPE   @_true_divide @TYPE@_divide

Function Documentation

NPY_NO_EXPORT void C TYPE __arg ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void S TYPE __ones_like ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)
begin repeat
TYPE = DATETIME, TIMEDELTA#
begin repeat
#type = npy_datetime, npy_timedelta# TYPE = DATETIME, TIMEDELTA#
begin repeat
TYPE = DATETIME, TIMEDELTA#
NPY_NO_EXPORT void U TYPE _absolute ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat1*
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 TYPE _conjugate ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void 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 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 S 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 TYPE _logical_not ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)

References BINARY_LOOP.

NPY_NO_EXPORT void 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 C 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 S TYPE _power ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void 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 U 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 _sqrt ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat*

* FLOAT LOOPS **

begin repeat
TYPE = FLOAT, DOUBLE#

* 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 TYPE _square ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)
end repeat1*
NPY_NO_EXPORT void S TYPE _true_divide ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat2*
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 S TYPE _reciprocal isa ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)
begin repeat2
isa = , _avx2#
NPY_NO_EXPORT void S TYPE _logical_xor isa ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
begin repeat3

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 repeat3*
begin repeat3
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 repeat3*
NPY_NO_EXPORT void BOOL_ 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,
logical_and, logical_or, absolute, logical_not#
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.
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, copysign, nextafter, spacing# #func = npy_isnan, npy_isinf, npy_isfinite, npy_signbit, npy_copysign, nextafter, spacing#
end repeat1*
begin repeat1
kind = maximum, minimum# OP = >=, <=#
end repeat1*
begin repeat1
kind = fmax, fmin# 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= 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#
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#

* 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 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 
)