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_NegativeTypeResolver(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_OnesLikeTypeResolver(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_SimpleBinaryOperationTypeResolver(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_AbsoluteTypeResolver(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_AdditionTypeResolver(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_SubtractionTypeResolver(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_MultiplicationTypeResolver(PyUFuncObject *ufunc,
00062                                    NPY_CASTING casting,
00063                                    PyArrayObject **operands,
00064                                    PyObject *type_tup,
00065                                    PyArray_Descr **out_dtypes);
00066 
00067 NPY_NO_EXPORT int
00068 PyUFunc_MixedDivisionTypeResolver(PyUFuncObject *ufunc,
00069                                   NPY_CASTING casting,
00070                                   PyArrayObject **operands,
00071                                   PyObject *type_tup,
00072                                   PyArray_Descr **out_dtypes);
00073 
00074 NPY_NO_EXPORT int
00075 PyUFunc_DivisionTypeResolver(PyUFuncObject *ufunc,
00076                              NPY_CASTING casting,
00077                              PyArrayObject **operands,
00078                              PyObject *type_tup,
00079                              PyArray_Descr **out_dtypes);
00080 
00081 /*
00082  * Does a linear search for the best inner loop of the ufunc.
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 linear_search_type_resolver(PyUFuncObject *self,
00089                             PyArrayObject **op,
00090                             NPY_CASTING input_casting,
00091                             NPY_CASTING output_casting,
00092                             int any_object,
00093                             PyArray_Descr **out_dtype);
00094 
00095 /*
00096  * Does a linear search for the inner loop of the ufunc specified by type_tup.
00097  *
00098  * Note that if an error is returned, the caller must free the non-zero
00099  * references in out_dtype.  This function does not do its own clean-up.
00100  */
00101 NPY_NO_EXPORT int
00102 type_tuple_type_resolver(PyUFuncObject *self,
00103                          PyObject *type_tup,
00104                          PyArrayObject **op,
00105                          NPY_CASTING casting,
00106                          int any_object,
00107                          PyArray_Descr **out_dtype);
00108 
00109 NPY_NO_EXPORT int
00110 PyUFunc_DefaultLegacyInnerLoopSelector(PyUFuncObject *ufunc,
00111                                        PyArray_Descr **dtypes,
00112                                        PyUFuncGenericFunction *out_innerloop,
00113                                        void **out_innerloopdata,
00114                                        int *out_needs_api);
00115 
00116 NPY_NO_EXPORT int
00117 PyUFunc_DefaultMaskedInnerLoopSelector(PyUFuncObject *ufunc,
00118                                       PyArray_Descr **dtypes,
00119                                       PyArray_Descr *mask_dtypes,
00120                                       npy_intp *NPY_UNUSED(fixed_strides),
00121                                       npy_intp NPY_UNUSED(fixed_mask_stride),
00122                                       PyUFunc_MaskedStridedInnerLoopFunc 
00123                                       **out_innerloop,
00124                                       NpyAuxData **out_innerloopdata,
00125                                       int *out_needs_api);
00126 
00127 
00128 #endif