numpy
2.0.0
|
00001 #ifndef _NPY_ARRAY_CTORS_H_ 00002 #define _NPY_ARRAY_CTORS_H_ 00003 00004 NPY_NO_EXPORT PyObject * 00005 PyArray_NewFromDescr(PyTypeObject *subtype, PyArray_Descr *descr, int nd, 00006 npy_intp *dims, npy_intp *strides, void *data, 00007 int flags, PyObject *obj); 00008 00009 NPY_NO_EXPORT PyObject * 00010 PyArray_NewFromDescr_int(PyTypeObject *subtype, PyArray_Descr *descr, int nd, 00011 npy_intp *dims, npy_intp *strides, void *data, 00012 int flags, PyObject *obj, int zeroed, 00013 int allow_emptystring); 00014 00015 NPY_NO_EXPORT PyObject *PyArray_New(PyTypeObject *, int nd, npy_intp *, 00016 int, npy_intp *, void *, int, int, PyObject *); 00017 00018 NPY_NO_EXPORT PyObject * 00019 PyArray_FromAny(PyObject *op, PyArray_Descr *newtype, int min_depth, 00020 int max_depth, int flags, PyObject *context); 00021 00022 NPY_NO_EXPORT PyObject * 00023 PyArray_CheckFromAny(PyObject *op, PyArray_Descr *descr, int min_depth, 00024 int max_depth, int requires, PyObject *context); 00025 00026 NPY_NO_EXPORT PyObject * 00027 PyArray_FromArray(PyArrayObject *arr, PyArray_Descr *newtype, int flags); 00028 00029 NPY_NO_EXPORT PyObject * 00030 PyArray_FromStructInterface(PyObject *input); 00031 00032 NPY_NO_EXPORT PyObject * 00033 PyArray_FromInterface(PyObject *input); 00034 00035 NPY_NO_EXPORT PyObject * 00036 PyArray_FromArrayAttr(PyObject *op, PyArray_Descr *typecode, 00037 PyObject *context); 00038 00039 NPY_NO_EXPORT PyObject * 00040 PyArray_EnsureArray(PyObject *op); 00041 00042 NPY_NO_EXPORT PyObject * 00043 PyArray_EnsureAnyArray(PyObject *op); 00044 00045 NPY_NO_EXPORT int 00046 PyArray_MoveInto(PyArrayObject *dest, PyArrayObject *src); 00047 00048 NPY_NO_EXPORT int 00049 PyArray_CopyAnyInto(PyArrayObject *dest, PyArrayObject *src); 00050 00051 NPY_NO_EXPORT PyObject * 00052 PyArray_CheckAxis(PyArrayObject *arr, int *axis, int flags); 00053 00054 /* TODO: Put the order parameter in PyArray_CopyAnyInto and remove this */ 00055 NPY_NO_EXPORT int 00056 PyArray_CopyAsFlat(PyArrayObject *dst, PyArrayObject *src, 00057 NPY_ORDER order); 00058 00059 /* FIXME: remove those from here */ 00060 NPY_NO_EXPORT void 00061 _array_fill_strides(npy_intp *strides, npy_intp *dims, int nd, size_t itemsize, 00062 int inflag, int *objflags); 00063 00064 NPY_NO_EXPORT void 00065 _unaligned_strided_byte_copy(char *dst, npy_intp outstrides, char *src, 00066 npy_intp instrides, npy_intp N, int elsize); 00067 00068 NPY_NO_EXPORT void 00069 _strided_byte_swap(void *p, npy_intp stride, npy_intp n, int size); 00070 00071 NPY_NO_EXPORT void 00072 copy_and_swap(void *dst, void *src, int itemsize, npy_intp numitems, 00073 npy_intp srcstrides, int swap); 00074 00075 NPY_NO_EXPORT void 00076 byte_swap_vector(void *p, npy_intp n, int size); 00077 00078 NPY_NO_EXPORT int 00079 PyArray_AssignFromSequence(PyArrayObject *self, PyObject *v); 00080 00081 /* 00082 * Calls arr_of_subclass.__array_wrap__(towrap), in order to make 'towrap' 00083 * have the same ndarray subclass as 'arr_of_subclass'. 00084 */ 00085 NPY_NO_EXPORT PyArrayObject * 00086 PyArray_SubclassWrap(PyArrayObject *arr_of_subclass, PyArrayObject *towrap); 00087 00088 00089 #endif