numpy  2.0.0
src/umath/ufunc_type_resolution.h
Go to the documentation of this file.
00001 #ifndef _NPY_PRIVATE__UFUNC_TYPE_RESOLUTION_H_
00002 #define _NPY_PRIVATE__UFUNC_TYPE_RESOLUTION_H_
00003 
00004 NPY_NO_EXPORT int
00005 PyUFunc_SimpleBinaryComparisonTypeResolver(PyUFuncObject *ufunc,
00006                                 NPY_CASTING casting,
00007                                 PyArrayObject **operands,
00008                                 PyObject *type_tup,
00009                                 PyArray_Descr **out_dtypes);
00010 
00011 NPY_NO_EXPORT int
00012 PyUFunc_SimpleUnaryOperationTypeResolver(PyUFuncObject *ufunc,
00013                                 NPY_CASTING casting,
00014                                 PyArrayObject **operands,
00015                                 PyObject *type_tup,
00016                                 PyArray_Descr **out_dtypes);
00017 
00018 NPY_NO_EXPORT int
00019 PyUFunc_OnesLikeTypeResolver(PyUFuncObject *ufunc,
00020                                 NPY_CASTING casting,
00021                                 PyArrayObject **operands,
00022                                 PyObject *type_tup,
00023                                 PyArray_Descr **out_dtypes);
00024 
00025 NPY_NO_EXPORT int
00026 PyUFunc_SimpleBinaryOperationTypeResolver(PyUFuncObject *ufunc,
00027                                 NPY_CASTING casting,
00028                                 PyArrayObject **operands,
00029                                 PyObject *type_tup,
00030                                 PyArray_Descr **out_dtypes);
00031 
00032 NPY_NO_EXPORT int
00033 PyUFunc_AbsoluteTypeResolver(PyUFuncObject *ufunc,
00034                                 NPY_CASTING casting,
00035                                 PyArrayObject **operands,
00036                                 PyObject *type_tup,
00037                                 PyArray_Descr **out_dtypes);
00038 
00039 NPY_NO_EXPORT int
00040 PyUFunc_AdditionTypeResolver(PyUFuncObject *ufunc,
00041                                 NPY_CASTING casting,
00042                                 PyArrayObject **operands,
00043                                 PyObject *type_tup,
00044                                 PyArray_Descr **out_dtypes);
00045 
00046 NPY_NO_EXPORT int
00047 PyUFunc_SubtractionTypeResolver(PyUFuncObject *ufunc,
00048                                 NPY_CASTING casting,
00049                                 PyArrayObject **operands,
00050                                 PyObject *type_tup,
00051                                 PyArray_Descr **out_dtypes);
00052 
00053 NPY_NO_EXPORT int
00054 PyUFunc_MultiplicationTypeResolver(PyUFuncObject *ufunc,
00055                                 NPY_CASTING casting,
00056                                 PyArrayObject **operands,
00057                                 PyObject *type_tup,
00058                                 PyArray_Descr **out_dtypes);
00059 
00060 NPY_NO_EXPORT int
00061 PyUFunc_DivisionTypeResolver(PyUFuncObject *ufunc,
00062                                 NPY_CASTING casting,
00063                                 PyArrayObject **operands,
00064                                 PyObject *type_tup,
00065                                 PyArray_Descr **out_dtypes);
00066 
00067 /*
00068  * Does a linear search for the best inner loop of the ufunc.
00069  *
00070  * Note that if an error is returned, the caller must free the non-zero
00071  * references in out_dtype.  This function does not do its own clean-up.
00072  */
00073 NPY_NO_EXPORT int
00074 linear_search_type_resolver(PyUFuncObject *self,
00075                         PyArrayObject **op,
00076                         NPY_CASTING input_casting,
00077                         NPY_CASTING output_casting,
00078                         int any_object,
00079                         PyArray_Descr **out_dtype);
00080 
00081 /*
00082  * Does a linear search for the inner loop of the ufunc specified by type_tup.
00083  *
00084  * Note that if an error is returned, the caller must free the non-zero
00085  * references in out_dtype.  This function does not do its own clean-up.
00086  */
00087 NPY_NO_EXPORT int
00088 type_tuple_type_resolver(PyUFuncObject *self,
00089                         PyObject *type_tup,
00090                         PyArrayObject **op,
00091                         NPY_CASTING casting,
00092                         int any_object,
00093                         PyArray_Descr **out_dtype);
00094 
00095 NPY_NO_EXPORT int
00096 PyUFunc_DefaultLegacyInnerLoopSelector(PyUFuncObject *ufunc,
00097                                 PyArray_Descr **dtypes,
00098                                 PyUFuncGenericFunction *out_innerloop,
00099                                 void **out_innerloopdata,
00100                                 int *out_needs_api);
00101 
00102 NPY_NO_EXPORT int
00103 PyUFunc_DefaultMaskedInnerLoopSelector(PyUFuncObject *ufunc,
00104                             PyArray_Descr **dtypes,
00105                             PyArray_Descr *mask_dtypes,
00106                             npy_intp *NPY_UNUSED(fixed_strides),
00107                             npy_intp NPY_UNUSED(fixed_mask_stride),
00108                             PyUFunc_MaskedStridedInnerLoopFunc **out_innerloop,
00109                             NpyAuxData **out_innerloopdata,
00110                             int *out_needs_api);
00111 
00112 
00113 #endif