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