numpy
2.0.0
|
#include <Python.h>
#include "structmember.h"
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
#include "npy_config.h"
#include "npy_pycompat.h"
#include "numpy/npy_math.h"
#include "common.h"
#include "scalartypes.h"
#include "mapping.h"
#include "convert_datatype.h"
#include "_datetime.h"
#include "datetime_strings.h"
#define _MULTIARRAYMODULE |
#define NPY_NO_DEPRECATED_API NPY_API_VERSION |
#define PY_SSIZE_T_CLEAN |
static int _check_object_rec | ( | PyArray_Descr * | descr | ) | [static] |
static int can_cast_fields | ( | PyObject * | field1, |
PyObject * | field2, | ||
NPY_CASTING | casting | ||
) | [static] |
NPY_NO_EXPORT npy_bool can_cast_scalar_to | ( | PyArray_Descr * | scal_type, |
char * | scal_data, | ||
PyArray_Descr * | to, | ||
NPY_CASTING | casting | ||
) |
static int dtype_kind_to_ordering | ( | char | kind | ) | [static] |
static int dtype_kind_to_simplified_ordering | ( | char | kind | ) | [static] |
static PyArray_Descr* ensure_dtype_nbo | ( | PyArray_Descr * | type | ) | [static] |
static int min_scalar_type_num | ( | char * | valueptr, |
int | type_num, | ||
int * | is_small_unsigned | ||
) | [static] |
<blockquote>
NPY_FLOAT, is_small_unsigned);
</blockquote>
NPY_DOUBLE, is_small_unsigned);
NPY_LONGDOUBLE, is_small_unsigned);
References npy_cdouble::imag, NPY_CFLOAT, and npy_cdouble::real.
static PyArray_Descr* promote_types | ( | PyArray_Descr * | type1, |
PyArray_Descr * | type2, | ||
int | is_small_unsigned1, | ||
int | is_small_unsigned2 | ||
) | [static] |
Referenced by PyArray_DTypeFromObject(), and PyArray_DTypeFromObjectHelper().
NPY_NO_EXPORT void PyArray_AdaptFlexibleDType | ( | PyObject * | data_obj, |
PyArray_Descr * | data_dtype, | ||
PyArray_Descr ** | flex_dtype | ||
) |
Referenced by get_nbo_datetime_to_string_transfer_function().
NPY_NO_EXPORT npy_bool PyArray_CanCastArrayTo | ( | PyArrayObject * | arr, |
PyArray_Descr * | to, | ||
NPY_CASTING | casting | ||
) |
Referenced by array_diagonal(), PyUFunc_DefaultLegacyInnerLoopSelector(), and PyUFunc_ValidateCasting().
NPY_NO_EXPORT int PyArray_CanCastSafely | ( | int | fromtype, |
int | totype | ||
) |
Referenced by _ctype_negative(), and PyArray_CanCastScalar().
NPY_NO_EXPORT npy_bool PyArray_CanCastScalar | ( | PyTypeObject * | from, |
PyTypeObject * | to | ||
) |
References _npy_smallest_type_of_kind_table, NPY_NSCALARKINDS, PyArray_CanCastSafely(), and PyArray_DescrFromType().
NPY_NO_EXPORT npy_bool PyArray_CanCastTo | ( | PyArray_Descr * | from, |
PyArray_Descr * | to | ||
) |
NPY_NO_EXPORT npy_bool PyArray_CanCastTypeTo | ( | PyArray_Descr * | from, |
PyArray_Descr * | to, | ||
NPY_CASTING | casting | ||
) |
Referenced by PyUFunc_DefaultLegacyInnerLoopSelector(), and PyUFunc_ValidateCasting().
NPY_NO_EXPORT int PyArray_CastAnyTo | ( | PyArrayObject * | out, |
PyArrayObject * | mp | ||
) |
NPY_NO_EXPORT int PyArray_CastTo | ( | PyArrayObject * | out, |
PyArrayObject * | mp | ||
) |
References NPY_BOOL, NPY_DATETIME, NPY_OBJECT, NPY_TIMEDELTA, and NPY_VOID.
NPY_NO_EXPORT PyObject* PyArray_CastToType | ( | PyArrayObject * | arr, |
PyArray_Descr * | dtype, | ||
int | is_f_order | ||
) |
Referenced by fast_scalar_power().
NPY_NO_EXPORT PyArrayObject** PyArray_ConvertToCommonType | ( | PyObject * | op, |
int * | retn | ||
) |
NPY_NO_EXPORT PyArray_VectorUnaryFunc* PyArray_GetCastFunc | ( | PyArray_Descr * | descr, |
int | type_num | ||
) |
NPY_NO_EXPORT int PyArray_ObjectType | ( | PyObject * | op, |
int | minimum_type | ||
) |
Referenced by _pyarray_correlate(), and PyArray_CanCoerceScalar().
NPY_NO_EXPORT char* PyArray_One | ( | PyArrayObject * | arr | ) |
NPY_NO_EXPORT PyArray_Descr* PyArray_PromoteTypes | ( | PyArray_Descr * | type1, |
PyArray_Descr * | type2 | ||
) |
Referenced by PyArray_Clip(), PyUFunc_MultiplicationTypeResolver(), and PyUFunc_SubtractionTypeResolver().
NPY_NO_EXPORT PyArray_Descr* PyArray_ResultType | ( | npy_intp | narrs, |
PyArrayObject ** | arr, | ||
npy_intp | ndtypes, | ||
PyArray_Descr ** | dtypes | ||
) |
type promotion rules. Use this function when you have a set of input arrays, and need to determine an output array dtype.
If all the inputs are scalars (have 0 dimensions) or the maximum "kind" of the scalars is greater than the maximum "kind" of the arrays, does a regular type promotion.
Otherwise, does a type promotion on the MinScalarType of all the inputs. Data types passed directly are treated as array types.
NPY_NO_EXPORT int PyArray_ValidType | ( | int | type | ) |
NPY_NO_EXPORT char* PyArray_Zero | ( | PyArrayObject * | arr | ) |
static int type_num_unsigned_to_signed | ( | int | type_num | ) | [static] |
NPY_NO_EXPORT npy_intp REQUIRED_STR_LEN[] = {0, 3, 5, 10, 10, 20, 20, 20, 20} |
<blockquote> or 9223372036854775807</blockquote>