diff options
Diffstat (limited to 'numpy/core/src')
-rw-r--r-- | numpy/core/src/arraymethods.c | 10 | ||||
-rw-r--r-- | numpy/core/src/arrayobject.c | 142 | ||||
-rw-r--r-- | numpy/core/src/arraytypes.inc.src | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarraymodule.c | 166 | ||||
-rw-r--r-- | numpy/core/src/scalartypes.inc.src | 18 |
5 files changed, 169 insertions, 169 deletions
diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c index 4927f184b..964c18dbd 100644 --- a/numpy/core/src/arraymethods.c +++ b/numpy/core/src/arraymethods.c @@ -246,7 +246,7 @@ array_swapaxes(PyArrayObject *self, PyObject *args) /* steals typed reference */ -/*OBJECT_API +/*NUMPY_API Get a subset of bytes from each element of the array */ static PyObject * @@ -295,7 +295,7 @@ array_getfield(PyArrayObject *self, PyObject *args, PyObject *kwds) } -/*OBJECT_API +/*NUMPY_API Set a subset of bytes from each element of the array */ static int @@ -351,7 +351,7 @@ array_setfield(PyArrayObject *self, PyObject *args, PyObject *kwds) /* This doesn't change the descriptor just the actual data... */ -/*OBJECT_API*/ +/*NUMPY_API*/ static PyObject * PyArray_Byteswap(PyArrayObject *self, Bool inplace) { @@ -1351,7 +1351,7 @@ array_setstate(PyArrayObject *self, PyObject *args) return Py_None; } -/*OBJECT_API*/ +/*NUMPY_API*/ static int PyArray_Dump(PyObject *self, PyObject *file, int protocol) { @@ -1376,7 +1376,7 @@ PyArray_Dump(PyObject *self, PyObject *file, int protocol) return 0; } -/*OBJECT_API*/ +/*NUMPY_API*/ static PyObject * PyArray_Dumps(PyObject *self, int protocol) { diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index deee178b7..cd934424d 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -21,7 +21,7 @@ */ /*#include <stdio.h>*/ -/*OBJECT_API +/*NUMPY_API * Get Priority from object */ static double @@ -68,7 +68,7 @@ The memory for the ptr still must be freed in any case; */ -/*OBJECT_API +/*NUMPY_API Get pointer to zero of correct type for array. */ static char * @@ -103,7 +103,7 @@ PyArray_Zero(PyArrayObject *arr) return zeroval; } -/*OBJECT_API +/*NUMPY_API Get pointer to one of correct type for array */ static char * @@ -149,7 +149,7 @@ static PyObject *PyArray_New(PyTypeObject *, int nd, intp *, /* Incref all objects found at this record */ -/*OBJECT_API +/*NUMPY_API */ static void PyArray_Item_INCREF(char *data, PyArray_Descr *descr) @@ -181,7 +181,7 @@ PyArray_Item_INCREF(char *data, PyArray_Descr *descr) } /* XDECREF all objects found at this record */ -/*OBJECT_API +/*NUMPY_API */ static void PyArray_Item_XDECREF(char *data, PyArray_Descr *descr) @@ -216,7 +216,7 @@ PyArray_Item_XDECREF(char *data, PyArray_Descr *descr) /* Used for arrays of python objects to increment the reference count of */ /* every python object in the array. */ -/*OBJECT_API +/*NUMPY_API For object arrays, increment all internal references. */ static int @@ -272,7 +272,7 @@ PyArray_INCREF(PyArrayObject *mp) return 0; } -/*OBJECT_API +/*NUMPY_API Decrement all internal references for object arrays. (or arrays with object fields) */ @@ -535,7 +535,7 @@ static PyArray_Descr **userdescrs=NULL; /* Helper functions */ -/*OBJECT_API*/ +/*NUMPY_API*/ static intp PyArray_PyIntAsIntp(PyObject *o) { @@ -635,7 +635,7 @@ PyArray_PyIntAsIntp(PyObject *o) static PyObject *array_int(PyArrayObject *v); -/*OBJECT_API*/ +/*NUMPY_API*/ static int PyArray_PyIntAsInt(PyObject *o) { @@ -745,7 +745,7 @@ index2ptr(PyArrayObject *mp, intp i) return NULL; } -/*OBJECT_API +/*NUMPY_API Compute the size of an array (in number of items) */ static intp @@ -1137,7 +1137,7 @@ _array_copy_into(PyArrayObject *dest, PyArrayObject *src, int usecopy) } } -/*OBJECT_API +/*NUMPY_API * Copy an Array into another array -- memory must not overlap * Does not require src and dest to have "broadcastable" shapes * (only the same number of elements). @@ -1216,7 +1216,7 @@ PyArray_CopyAnyInto(PyArrayObject *dest, PyArrayObject *src) return 0; } -/*OBJECT_API +/*NUMPY_API * Copy an Array into another array -- memory must not overlap. */ static int @@ -1226,7 +1226,7 @@ PyArray_CopyInto(PyArrayObject *dest, PyArrayObject *src) } -/*OBJECT_API +/*NUMPY_API * Move the memory of one array into another. */ static int @@ -1236,7 +1236,7 @@ PyArray_MoveInto(PyArrayObject *dest, PyArrayObject *src) } -/*OBJECT_API*/ +/*NUMPY_API*/ static int PyArray_CopyObject(PyArrayObject *dest, PyObject *src_object) { @@ -1300,7 +1300,7 @@ PyArray_CopyObject(PyArrayObject *dest, PyObject *src_object) /* They all zero-out the memory as previously done */ /* steals reference to descr -- and enforces native byteorder on it.*/ -/*OBJECT_API +/*NUMPY_API Like FromDimsAndData but uses the Descr structure instead of typecode as input. */ @@ -1333,7 +1333,7 @@ PyArray_FromDimsAndDataAndDescr(int nd, int *d, return ret; } -/*OBJECT_API +/*NUMPY_API Construct an empty array from dimensions and typenum */ static PyObject * @@ -1356,7 +1356,7 @@ PyArray_FromDims(int nd, int *d, int type) /* end old calls */ -/*OBJECT_API +/*NUMPY_API Copy an array. */ static PyObject * @@ -1388,7 +1388,7 @@ PyArray_NewCopy(PyArrayObject *m1, NPY_ORDER fortran) static PyObject *array_big_item(PyArrayObject *, intp); /* Does nothing with descr (cannot be NULL) */ -/*OBJECT_API +/*NUMPY_API Get scalar-equivalent to a region of memory described by a descriptor. */ static PyObject * @@ -1542,7 +1542,7 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base) /* Return Array Scalar if 0-d array object is encountered */ -/*OBJECT_API +/*NUMPY_API Return either an array or the appropriate Python object if the array is 0d and matches a Python type. */ @@ -1572,7 +1572,7 @@ PyArray_Return(PyArrayObject *mp) } -/*MULTIARRAY_API +/*NUMPY_API Initialize arrfuncs to NULL */ static void @@ -1643,7 +1643,7 @@ _default_copyswapn(void *dst, npy_intp dstride, void *src, found. Only works for user-defined data-types. */ -/*MULTIARRAY_API +/*NUMPY_API */ static int PyArray_TypeNumFromName(char *str) @@ -1665,7 +1665,7 @@ PyArray_TypeNumFromName(char *str) needs the userdecrs table and PyArray_NUMUSER variables defined in arraytypes.inc */ -/*MULTIARRAY_API +/*NUMPY_API Register Data type Does not change the reference count of descr */ @@ -1717,7 +1717,7 @@ PyArray_RegisterDataType(PyArray_Descr *descr) return typenum; } -/*MULTIARRAY_API +/*NUMPY_API Register Casting Function Replaces any function currently stored. */ @@ -1762,7 +1762,7 @@ _append_new(int *types, int insert) return newtypes; } -/*MULTIARRAY_API +/*NUMPY_API Register a type number indicating that a descriptor can be cast to it safely */ @@ -1811,7 +1811,7 @@ PyArray_RegisterCanCast(PyArray_Descr *descr, int totype, This will need the addition of a Fortran-order iterator. */ -/*OBJECT_API +/*NUMPY_API To File */ static int @@ -1952,7 +1952,7 @@ PyArray_ToFile(PyArrayObject *self, FILE *fp, char *sep, char *format) return 0; } -/*OBJECT_API +/*NUMPY_API * To List */ static PyObject * @@ -1987,7 +1987,7 @@ PyArray_ToList(PyArrayObject *self) return lp; } -/*OBJECT_API*/ +/*NUMPY_API*/ static PyObject * PyArray_ToString(PyArrayObject *self, NPY_ORDER order) { @@ -3365,7 +3365,7 @@ static NumericOps n_ops; /* NB: static objects initialized to zero */ } -/*OBJECT_API +/*NUMPY_API Set internal structure with number functions that all arrays will use */ int @@ -3413,7 +3413,7 @@ PyArray_SetNumericOps(PyObject *dict) (PyDict_SetItemString(dict, #op, n_ops.op)==-1)) \ goto fail; -/*OBJECT_API +/*NUMPY_API Get dictionary showing number functions that all arrays will use */ static PyObject * @@ -4362,7 +4362,7 @@ array_repr_builtin(PyArrayObject *self, int repr) static PyObject *PyArray_StrFunction=NULL; static PyObject *PyArray_ReprFunction=NULL; -/*OBJECT_API +/*NUMPY_API Set the array print function to be a Python function. */ static void @@ -4417,7 +4417,7 @@ array_str(PyArrayObject *self) -/*OBJECT_API +/*NUMPY_API */ static int PyArray_CompareUCS4(npy_ucs4 *s1, npy_ucs4 *s2, register size_t len) @@ -4433,7 +4433,7 @@ PyArray_CompareUCS4(npy_ucs4 *s1, npy_ucs4 *s2, register size_t len) return 0; } -/*MULTIARRAY_API +/*NUMPY_API */ static int PyArray_CompareString(char *s1, char *s2, size_t len) @@ -5028,7 +5028,7 @@ array_richcompare(PyArrayObject *self, PyObject *other, int cmp_op) } -/*MULTIARRAY_API +/*NUMPY_API PyArray_CheckAxis */ static PyObject * @@ -5079,7 +5079,7 @@ PyArray_CheckAxis(PyArrayObject *arr, int *axis, int flags) #include "arraymethods.c" /* Lifted from numarray */ -/*MULTIARRAY_API +/*NUMPY_API PyArray_IntTupleFromIntp */ static PyObject * @@ -5107,7 +5107,7 @@ PyArray_IntTupleFromIntp(int len, intp *vals) /* Returns the number of dimensions or -1 if an error occurred */ /* vals must be large enough to hold maxvals */ -/*MULTIARRAY_API +/*NUMPY_API PyArray_IntpFromSequence */ static int @@ -5255,7 +5255,7 @@ _IsWriteable(PyArrayObject *ap) } -/*OBJECT_API +/*NUMPY_API */ static int PyArray_ElementStrides(PyObject *arr) @@ -5271,7 +5271,7 @@ PyArray_ElementStrides(PyObject *arr) return 1; } -/*OBJECT_API +/*NUMPY_API Update Several Flags at once. */ static void @@ -5321,7 +5321,7 @@ PyArray_UpdateFlags(PyArrayObject *ret, int flagmask) or negative). */ -/*OBJECT_API*/ +/*NUMPY_API*/ static Bool PyArray_CheckStrides(int elsize, int nd, intp numbytes, intp offset, intp *dims, intp *newstrides) @@ -5389,7 +5389,7 @@ _array_fill_strides(intp *strides, intp *dims, int nd, size_t itemsize, return itemsize; } -/*OBJECT_API +/*NUMPY_API Generic new array creation routine. */ static PyObject * @@ -5492,7 +5492,7 @@ _update_descr_and_dimensions(PyArray_Descr **des, intp *newdims, /* steals a reference to descr (even on failure) */ -/*OBJECT_API +/*NUMPY_API Generic new array creation routine. */ static PyObject * @@ -5718,7 +5718,7 @@ _putzero(char *optr, PyObject *zero, PyArray_Descr *dtype) } -/*OBJECT_API +/*NUMPY_API Resize (reallocate data). Only works if nothing else is referencing this array and it is contiguous. If refcheck is 0, then the reference count is not checked @@ -5888,7 +5888,7 @@ _fillobject(char *optr, PyObject *obj, PyArray_Descr *dtype) } /* Assumes contiguous */ -/*OBJECT_API*/ +/*NUMPY_API*/ static void PyArray_FillObjectArray(PyArrayObject *arr, PyObject *obj) { @@ -5920,7 +5920,7 @@ PyArray_FillObjectArray(PyArrayObject *arr, PyObject *obj) } } -/*OBJECT_API*/ +/*NUMPY_API*/ static int PyArray_FillWithScalar(PyArrayObject *arr, PyObject *obj) { @@ -7738,7 +7738,7 @@ Array_FromSequence(PyObject *s, PyArray_Descr *typecode, int fortran, } -/*OBJECT_API +/*NUMPY_API Is the typenum valid? */ static int @@ -7758,7 +7758,7 @@ PyArray_ValidType(int type) /* For backward compatibility */ /* steals reference to at --- cannot be NULL*/ -/*OBJECT_API +/*NUMPY_API *Cast an array using typecode structure. */ static PyObject * @@ -7819,7 +7819,7 @@ PyArray_CastToType(PyArrayObject *mp, PyArray_Descr *at, int fortran) } -/*OBJECT_API +/*NUMPY_API Get a cast function to cast from the input descriptor to the output type_number (must be a registered data-type). Returns NULL if un-successful. @@ -8017,7 +8017,7 @@ _broadcast_cast(PyArrayObject *out, PyArrayObject *in, * as the size of the casting buffer. */ -/*OBJECT_API +/*NUMPY_API * Cast to an already created array. */ static int @@ -8181,7 +8181,7 @@ _bufferedcast(PyArrayObject *out, PyArrayObject *in, return retval; } -/*OBJECT_API +/*NUMPY_API Cast to an already created array. Arrays don't have to be "broadcastable" Only requirement is they have the same number of elements. */ @@ -8231,7 +8231,7 @@ PyArray_CastAnyTo(PyArrayObject *out, PyArrayObject *mp) /* steals reference to newtype --- acc. NULL */ -/*OBJECT_API*/ +/*NUMPY_API*/ static PyObject * PyArray_FromArray(PyArrayObject *arr, PyArray_Descr *newtype, int flags) { @@ -8489,7 +8489,7 @@ _array_typedescr_fromstr(char *str) return descr; } -/*OBJECT_API */ +/*NUMPY_API */ static PyObject * PyArray_FromStructInterface(PyObject *input) { @@ -8545,7 +8545,7 @@ PyArray_FromStructInterface(PyObject *input) #define PyIntOrLong_Check(obj) (PyInt_Check(obj) || PyLong_Check(obj)) -/*OBJECT_API*/ +/*NUMPY_API*/ static PyObject * PyArray_FromInterface(PyObject *input) { @@ -8696,7 +8696,7 @@ PyArray_FromInterface(PyObject *input) return NULL; } -/*OBJECT_API*/ +/*NUMPY_API*/ static PyObject * PyArray_FromArrayAttr(PyObject *op, PyArray_Descr *typecode, PyObject *context) { @@ -8745,7 +8745,7 @@ PyArray_FromArrayAttr(PyObject *op, PyArray_Descr *typecode, PyObject *context) /* Does not check for ENSURECOPY and NOTSWAPPED in flags */ /* Steals a reference to newtype --- which can be NULL */ -/*OBJECT_API*/ +/*NUMPY_API*/ static PyObject * PyArray_FromAny(PyObject *op, PyArray_Descr *newtype, int min_depth, int max_depth, int flags, PyObject *context) @@ -8873,14 +8873,14 @@ PyArray_FromAny(PyObject *op, PyArray_Descr *newtype, int min_depth, } /* new reference -- accepts NULL for mintype*/ -/*OBJECT_API*/ +/*NUMPY_API*/ static PyArray_Descr * PyArray_DescrFromObject(PyObject *op, PyArray_Descr *mintype) { return _array_find_type(op, mintype, MAX_DIMS); } -/*OBJECT_API +/*NUMPY_API Return the typecode of the array a Python object would be converted to */ @@ -8943,7 +8943,7 @@ PyArray_ObjectType(PyObject *op, int minimum_type) /* steals a reference to descr -- accepts NULL */ -/*OBJECT_API*/ +/*NUMPY_API*/ static PyObject * PyArray_CheckFromAny(PyObject *op, PyArray_Descr *descr, int min_depth, int max_depth, int requires, PyObject *context) @@ -8984,7 +8984,7 @@ PyArray_CheckFromAny(PyObject *op, PyArray_Descr *descr, int min_depth, /* Because it decrefs op if any conversion needs to take place so it can be used like PyArray_EnsureArray(some_function(...)) */ -/*OBJECT_API*/ +/*NUMPY_API*/ static PyObject * PyArray_EnsureArray(PyObject *op) { @@ -9009,7 +9009,7 @@ PyArray_EnsureArray(PyObject *op) return new; } -/*OBJECT_API*/ +/*NUMPY_API*/ static PyObject * PyArray_EnsureAnyArray(PyObject *op) { @@ -9017,7 +9017,7 @@ PyArray_EnsureAnyArray(PyObject *op) return PyArray_EnsureArray(op); } -/*OBJECT_API +/*NUMPY_API Check the type coercion rules. */ static int @@ -9124,7 +9124,7 @@ PyArray_CanCastSafely(int fromtype, int totype) } /* leaves reference count alone --- cannot be NULL*/ -/*OBJECT_API*/ +/*NUMPY_API*/ static Bool PyArray_CanCastTo(PyArray_Descr *from, PyArray_Descr *to) { @@ -9156,7 +9156,7 @@ PyArray_CanCastTo(PyArray_Descr *from, PyArray_Descr *to) return ret; } -/*OBJECT_API +/*NUMPY_API See if array scalars can be cast. */ static Bool @@ -9177,7 +9177,7 @@ PyArray_CanCastScalar(PyTypeObject *from, PyTypeObject *to) /* Aided by Peter J. Verveer's nd_image package and numpy's arraymap ****/ /* and Python's array iterator ***/ -/*OBJECT_API +/*NUMPY_API Get Iterator. */ static PyObject * @@ -9221,7 +9221,7 @@ PyArray_IterNew(PyObject *obj) return (PyObject *)it; } -/*MULTIARRAY_API +/*NUMPY_API Get Iterator broadcast to a particular shape */ static PyObject * @@ -9288,7 +9288,7 @@ PyArray_BroadcastToShape(PyObject *obj, intp *dims, int nd) -/*OBJECT_API +/*NUMPY_API Get Iterator that iterates over all but one axis (don't use this with PyArray_ITER_GOTO1D). The axis will be over-written if negative with the axis having the smallest stride. @@ -9338,7 +9338,7 @@ PyArray_IterAllButAxis(PyObject *obj, int *inaxis) /* don't use with PyArray_ITER_GOTO1D because factors are not adjusted */ -/*OBJECT_API +/*NUMPY_API Adjusts previously broadcasted iterators so that the axis with the smallest sum of iterator strides is not iterated over. Returns dimension which is smallest in the range [0,multi->nd). @@ -10119,7 +10119,7 @@ _convert_obj(PyObject *obj, PyArrayIterObject **iter) /* Adjust dimensionality and strides for index object iterators --- i.e. broadcast */ -/*OBJECT_API*/ +/*NUMPY_API*/ static int PyArray_Broadcast(PyArrayMultiIterObject *mit) { @@ -10761,7 +10761,7 @@ static PyTypeObject PyArrayMapIter_Type = { /** END of Subscript Iterator **/ -/*OBJECT_API +/*NUMPY_API Get MultiIterator, */ static PyObject * @@ -11033,7 +11033,7 @@ static PyTypeObject PyArrayMultiIter_Type = { 0 /* tp_weaklist */ }; -/*OBJECT_API*/ +/*NUMPY_API*/ static PyArray_Descr * PyArray_DescrNewFromType(int type_num) { @@ -11060,7 +11060,7 @@ PyArray_DescrNewFromType(int type_num) **/ /* base cannot be NULL */ -/*OBJECT_API*/ +/*NUMPY_API*/ static PyArray_Descr * PyArray_DescrNew(PyArray_Descr *base) { @@ -11701,7 +11701,7 @@ arraydescr_setstate(PyArray_Descr *self, PyObject *args) byte-order is not changed but any fields are: */ -/*OBJECT_API +/*NUMPY_API Deep bytorder change of a data-type descriptor *** Leaves reference count of self unchanged --- does not DECREF self *** */ @@ -12088,7 +12088,7 @@ static PyTypeObject PyArrayDescr_Type = { /** Array Flags Object **/ -/*OBJECT_API +/*NUMPY_API Get New ArrayFlagsObject */ static PyObject * diff --git a/numpy/core/src/arraytypes.inc.src b/numpy/core/src/arraytypes.inc.src index 7272fa5c4..5d327f6b3 100644 --- a/numpy/core/src/arraytypes.inc.src +++ b/numpy/core/src/arraytypes.inc.src @@ -2458,7 +2458,7 @@ static PyArray_Descr *_builtin_descrs[] = { &VOID_Descr, }; -/*OBJECT_API +/*NUMPY_API Get the PyArray_Descr structure for a type. */ static PyArray_Descr * diff --git a/numpy/core/src/multiarraymodule.c b/numpy/core/src/multiarraymodule.c index 7078a63bb..8b883f391 100644 --- a/numpy/core/src/multiarraymodule.c +++ b/numpy/core/src/multiarraymodule.c @@ -100,7 +100,7 @@ _arraydescr_fromobj(PyObject *obj) /* An Error object -- rarely used? */ static PyObject *MultiArrayError; -/*MULTIARRAY_API +/*NUMPY_API Multiply a List of ints */ static int @@ -111,7 +111,7 @@ PyArray_MultiplyIntList(register int *l1, register int n) return s; } -/*MULTIARRAY_API +/*NUMPY_API Multiply a List */ static intp @@ -122,7 +122,7 @@ PyArray_MultiplyList(register intp *l1, register int n) return s; } -/*MULTIARRAY_API +/*NUMPY_API Multiply a List of Non-negative numbers with over-flow detection. */ static intp @@ -138,7 +138,7 @@ PyArray_OverflowMultiplyList(register intp *l1, register int n) return s; } -/*MULTIARRAY_API +/*NUMPY_API Produce a pointer into array */ static void * @@ -152,7 +152,7 @@ PyArray_GetPtr(PyArrayObject *obj, register intp* ind) return (void *)dptr; } -/*MULTIARRAY_API +/*NUMPY_API Get axis from an object (possibly None) -- a converter function, */ static int @@ -170,7 +170,7 @@ PyArray_AxisConverter(PyObject *obj, int *axis) return PY_SUCCEED; } -/*MULTIARRAY_API +/*NUMPY_API Compare Lists */ static int @@ -184,7 +184,7 @@ PyArray_CompareLists(intp *l1, intp *l2, int n) } /* steals a reference to type -- accepts NULL */ -/*MULTIARRAY_API +/*NUMPY_API View */ static PyObject * @@ -222,7 +222,7 @@ PyArray_View(PyArrayObject *self, PyArray_Descr *type, PyTypeObject *pytype) /* Returns a contiguous array */ -/*MULTIARRAY_API +/*NUMPY_API Ravel */ static PyObject * @@ -260,7 +260,7 @@ power_of_ten(int n) return ret; } -/*MULTIARRAY_API +/*NUMPY_API Round */ static PyObject * @@ -382,7 +382,7 @@ PyArray_Round(PyArrayObject *a, int decimals, PyArrayObject *out) } -/*MULTIARRAY_API +/*NUMPY_API Flatten */ static PyObject * @@ -416,7 +416,7 @@ PyArray_Flatten(PyArrayObject *a, NPY_ORDER order) / * Not recommended */ -/*MULTIARRAY_API +/*NUMPY_API Reshape an array */ static PyObject * @@ -624,7 +624,7 @@ _fix_unknown_dimension(PyArray_Dims *newshape, intp s_original) copy-only-if-necessary */ -/*MULTIARRAY_API +/*NUMPY_API New shape for an array */ static PyObject * @@ -771,7 +771,7 @@ PyArray_Newshape(PyArrayObject *self, PyArray_Dims *newdims, return the same array. */ -/*MULTIARRAY_API*/ +/*NUMPY_API*/ static PyObject * PyArray_Squeeze(PyArrayObject *self) { @@ -811,7 +811,7 @@ PyArray_Squeeze(PyArrayObject *self) } -/*MULTIARRAY_API +/*NUMPY_API Mean */ static PyObject * @@ -843,7 +843,7 @@ PyArray_Mean(PyArrayObject *self, int axis, int rtype, PyArrayObject *out) } /* Set variance to 1 to by-pass square-root calculation and return variance */ -/*MULTIARRAY_API +/*NUMPY_API Std */ static PyObject * @@ -962,7 +962,7 @@ __New_PyArray_Std(PyArrayObject *self, int axis, int rtype, PyArrayObject *out, } -/*MULTIARRAY_API +/*NUMPY_API Sum */ static PyObject * @@ -978,7 +978,7 @@ PyArray_Sum(PyArrayObject *self, int axis, int rtype, PyArrayObject *out) return ret; } -/*MULTIARRAY_API +/*NUMPY_API Prod */ static PyObject * @@ -994,7 +994,7 @@ PyArray_Prod(PyArrayObject *self, int axis, int rtype, PyArrayObject *out) return ret; } -/*MULTIARRAY_API +/*NUMPY_API CumSum */ static PyObject * @@ -1010,7 +1010,7 @@ PyArray_CumSum(PyArrayObject *self, int axis, int rtype, PyArrayObject *out) return ret; } -/*MULTIARRAY_API +/*NUMPY_API CumProd */ static PyObject * @@ -1027,7 +1027,7 @@ PyArray_CumProd(PyArrayObject *self, int axis, int rtype, PyArrayObject *out) return ret; } -/*MULTIARRAY_API +/*NUMPY_API Any */ static PyObject * @@ -1044,7 +1044,7 @@ PyArray_Any(PyArrayObject *self, int axis, PyArrayObject *out) return ret; } -/*MULTIARRAY_API +/*NUMPY_API All */ static PyObject * @@ -1062,7 +1062,7 @@ PyArray_All(PyArrayObject *self, int axis, PyArrayObject *out) } -/*MULTIARRAY_API +/*NUMPY_API Compress */ static PyObject * @@ -1091,7 +1091,7 @@ PyArray_Compress(PyArrayObject *self, PyObject *condition, int axis, return ret; } -/*MULTIARRAY_API +/*NUMPY_API Nonzero */ static PyObject * @@ -1188,7 +1188,7 @@ _slow_array_clip(PyArrayObject *self, PyObject *min, PyObject *max, PyArrayObjec return res2; } -/*MULTIARRAY_API +/*NUMPY_API Clip */ static PyObject * @@ -1417,7 +1417,7 @@ PyArray_Clip(PyArrayObject *self, PyObject *min, PyObject *max, PyArrayObject *o } -/*MULTIARRAY_API +/*NUMPY_API Conjugate */ static PyObject * @@ -1447,7 +1447,7 @@ PyArray_Conjugate(PyArrayObject *self, PyArrayObject *out) } } -/*MULTIARRAY_API +/*NUMPY_API Trace */ static PyObject * @@ -1463,7 +1463,7 @@ PyArray_Trace(PyArrayObject *self, int offset, int axis1, int axis2, return ret; } -/*MULTIARRAY_API +/*NUMPY_API Diagonal */ static PyObject * @@ -1598,7 +1598,7 @@ PyArray_Diagonal(PyArrayObject *self, int offset, int axis1, int axis2) */ /* steals a reference to typedescr -- can be NULL*/ -/*MULTIARRAY_API +/*NUMPY_API Simulat a C-array */ static int @@ -1657,7 +1657,7 @@ PyArray_AsCArray(PyObject **op, void *ptr, intp *dims, int nd, /* Deprecated --- Use PyArray_AsCArray instead */ -/*MULTIARRAY_API +/*NUMPY_API Convert to a 1D C-array */ static int @@ -1673,7 +1673,7 @@ PyArray_As1D(PyObject **op, char **ptr, int *d1, int typecode) return 0; } -/*MULTIARRAY_API +/*NUMPY_API Convert to a 2D C-array */ static int @@ -1693,7 +1693,7 @@ PyArray_As2D(PyObject **op, char ***ptr, int *d1, int *d2, int typecode) /* End Deprecated */ -/*MULTIARRAY_API +/*NUMPY_API Free pointers created if As2D is called */ static int @@ -1748,7 +1748,7 @@ _swap_and_concat(PyObject *op, int axis, int n) /* If axis is MAX_DIMS or bigger, then each sequence object will be flattened before concatenation */ -/*MULTIARRAY_API +/*NUMPY_API Concatenate an arbitrary Python sequence into an array. */ static PyObject * @@ -1859,7 +1859,7 @@ PyArray_Concatenate(PyObject *op, int axis) return NULL; } -/*MULTIARRAY_API +/*NUMPY_API SwapAxes */ static PyObject * @@ -1906,7 +1906,7 @@ PyArray_SwapAxes(PyArrayObject *ap, int a1, int a2) return ret; } -/*MULTIARRAY_API +/*NUMPY_API Return Transpose. */ static PyObject * @@ -1978,7 +1978,7 @@ PyArray_Transpose(PyArrayObject *ap, PyArray_Dims *permute) return (PyObject *)ret; } -/*MULTIARRAY_API +/*NUMPY_API Repeat the array. */ static PyObject * @@ -2101,7 +2101,7 @@ _signbit_set(PyArrayObject *arr) } -/*OBJECT_API*/ +/*NUMPY_API*/ static NPY_SCALARKIND PyArray_ScalarKind(int typenum, PyArrayObject **arr) { @@ -2128,7 +2128,7 @@ PyArray_ScalarKind(int typenum, PyArrayObject **arr) return PyArray_OBJECT_SCALAR; } -/*OBJECT_API*/ +/*NUMPY_API*/ static int PyArray_CanCoerceScalar(int thistype, int neededtype, NPY_SCALARKIND scalar) @@ -2168,7 +2168,7 @@ PyArray_CanCoerceScalar(int thistype, int neededtype, } -/*OBJECT_API*/ +/*NUMPY_API*/ static PyArrayObject ** PyArray_ConvertToCommonType(PyObject *op, int *retn) { @@ -2284,7 +2284,7 @@ PyArray_ConvertToCommonType(PyObject *op, int *retn) return NULL; } -/*MULTIARRAY_API +/*NUMPY_API */ static PyObject * PyArray_Choose(PyArrayObject *ip, PyObject *op, PyArrayObject *ret, @@ -2645,7 +2645,7 @@ qsortCompare (const void *a, const void *b) } \ } -/*MULTIARRAY_API +/*NUMPY_API Sort an array in-place */ static int @@ -2731,7 +2731,7 @@ argsort_static_compare(const void *ip1, const void *ip2) global_obj); } -/*MULTIARRAY_API +/*NUMPY_API ArgSort an array */ static PyObject * @@ -2821,7 +2821,7 @@ PyArray_ArgSort(PyArrayObject *op, int axis, NPY_SORTKIND which) } -/*MULTIARRAY_API +/*NUMPY_API LexSort an array providing indices that will sort a collection of arrays lexicographically. The first key is sorted on first, followed by the second key -- requires that arg"merge"sort is available for each sort_key @@ -3086,7 +3086,7 @@ local_search_right(PyArrayObject *arr, PyArrayObject *key, PyArrayObject *ret) } -/*MULTIARRAY_API +/*NUMPY_API Convert object to searchsorted side */ static int @@ -3114,7 +3114,7 @@ PyArray_SearchsideConverter(PyObject *obj, void *addr) } -/*MULTIARRAY_API +/*NUMPY_API Numeric.searchsorted(a,v) */ static PyObject * @@ -3214,7 +3214,7 @@ new_array_for_sum(PyArrayObject *ap1, PyArrayObject *ap2, /* Could perhaps be redone to not make contiguous arrays */ -/*MULTIARRAY_API +/*NUMPY_API Numeric.innerproduct(a,v) */ static PyObject * @@ -3326,7 +3326,7 @@ PyArray_InnerProduct(PyObject *op1, PyObject *op2) /* just like inner product but does the swapaxes stuff on the fly */ -/*MULTIARRAY_API +/*NUMPY_API Numeric.matrixproduct(a,v) */ static PyObject * @@ -3458,7 +3458,7 @@ PyArray_MatrixProduct(PyObject *op1, PyObject *op2) return NULL; } -/*MULTIARRAY_API +/*NUMPY_API Fast Copy and Transpose */ static PyObject * @@ -3521,7 +3521,7 @@ PyArray_CopyAndTranspose(PyObject *op) return ret; } -/*MULTIARRAY_API +/*NUMPY_API Numeric.correlate(a1,a2,mode) */ static PyObject * @@ -3631,7 +3631,7 @@ PyArray_Correlate(PyObject *op1, PyObject *op2, int mode) } -/*MULTIARRAY_API +/*NUMPY_API ArgMin */ static PyObject * @@ -3661,7 +3661,7 @@ PyArray_ArgMin(PyArrayObject *ap, int axis, PyArrayObject *out) return ret; } -/*MULTIARRAY_API +/*NUMPY_API Max */ static PyObject * @@ -3678,7 +3678,7 @@ PyArray_Max(PyArrayObject *ap, int axis, PyArrayObject *out) return ret; } -/*MULTIARRAY_API +/*NUMPY_API Min */ static PyObject * @@ -3695,7 +3695,7 @@ PyArray_Min(PyArrayObject *ap, int axis, PyArrayObject *out) return ret; } -/*MULTIARRAY_API +/*NUMPY_API Ptp */ static PyObject * @@ -3730,7 +3730,7 @@ PyArray_Ptp(PyArrayObject *ap, int axis, PyArrayObject *out) } -/*MULTIARRAY_API +/*NUMPY_API ArgMax */ static PyObject * @@ -3839,7 +3839,7 @@ PyArray_ArgMax(PyArrayObject *op, int axis, PyArrayObject *out) } -/*MULTIARRAY_API +/*NUMPY_API Take */ static PyObject * @@ -4001,7 +4001,7 @@ PyArray_TakeFrom(PyArrayObject *self0, PyObject *indices0, int axis, return NULL; } -/*MULTIARRAY_API +/*NUMPY_API Put values into an array */ static PyObject * @@ -4167,7 +4167,7 @@ array_putmask(PyObject *module, PyObject *args, PyObject *kwds) return PyArray_PutMask((PyArrayObject *)array, values, mask); } -/*MULTIARRAY_API +/*NUMPY_API Put values into an array according to a mask. */ static PyObject * @@ -4276,7 +4276,7 @@ PyArray_PutMask(PyArrayObject *self, PyObject* values0, PyObject* mask0) as you get a new reference to it. */ -/*MULTIARRAY_API +/*NUMPY_API Useful to pass as converter function for O& processing in PyArgs_ParseTuple. */ @@ -4295,7 +4295,7 @@ PyArray_Converter(PyObject *object, PyObject **address) } } -/*MULTIARRAY_API +/*NUMPY_API Useful to pass as converter function for O& processing in PyArgs_ParseTuple for output arrays */ @@ -4319,7 +4319,7 @@ PyArray_OutputConverter(PyObject *object, PyArrayObject **address) } -/*MULTIARRAY_API +/*NUMPY_API Convert an object to true / false */ static int @@ -4333,7 +4333,7 @@ PyArray_BoolConverter(PyObject *object, Bool *val) return PY_SUCCEED; } -/*MULTIARRAY_API +/*NUMPY_API Convert an object to FORTRAN / C / ANY */ static int @@ -4372,7 +4372,7 @@ PyArray_OrderConverter(PyObject *object, NPY_ORDER *val) return PY_SUCCEED; } -/*MULTIARRAY_API +/*NUMPY_API Convert an object to NPY_RAISE / NPY_CLIP / NPY_WRAP */ static int @@ -4418,7 +4418,7 @@ PyArray_ClipmodeConverter(PyObject *object, NPY_CLIPMODE *val) -/*MULTIARRAY_API +/*NUMPY_API Typestr converter */ static int @@ -4551,7 +4551,7 @@ PyArray_TypestrConvert(int itemsize, int gentype) */ -/*MULTIARRAY_API +/*NUMPY_API Get buffer chunk from object */ static int @@ -4591,7 +4591,7 @@ PyArray_BufferConverter(PyObject *obj, PyArray_Chunk *buf) PyDimMem_FREE(seq.ptr)** */ -/*MULTIARRAY_API +/*NUMPY_API Get intp chunk from sequence */ static int @@ -5238,7 +5238,7 @@ _check_for_commastring(char *type, int len) */ -/*MULTIARRAY_API +/*NUMPY_API Get type-descriptor from an object forcing alignment if possible None goes to DEFAULT type. */ @@ -5267,7 +5267,7 @@ PyArray_DescrAlignConverter(PyObject *obj, PyArray_Descr **at) return PY_SUCCEED; } -/*MULTIARRAY_API +/*NUMPY_API Get type-descriptor from an object forcing alignment if possible None goes to NULL. */ @@ -5297,7 +5297,7 @@ PyArray_DescrAlignConverter2(PyObject *obj, PyArray_Descr **at) } -/*MULTIARRAY_API +/*NUMPY_API Get typenum from an object -- None goes to NULL */ static int @@ -5321,7 +5321,7 @@ PyArray_DescrConverter2(PyObject *obj, PyArray_Descr **at) */ /* new reference in *at */ -/*MULTIARRAY_API +/*NUMPY_API Get typenum from an object -- None goes to PyArray_DEFAULT */ static int @@ -5505,7 +5505,7 @@ PyArray_DescrConverter(PyObject *obj, PyArray_Descr **at) return PY_FAIL; } -/*MULTIARRAY_API +/*NUMPY_API Convert object to endian */ static int @@ -5543,7 +5543,7 @@ PyArray_ByteorderConverter(PyObject *obj, char *endian) return PY_SUCCEED; } -/*MULTIARRAY_API +/*NUMPY_API Convert object to sort kind */ static int @@ -5596,7 +5596,7 @@ _equivalent_fields(PyObject *field1, PyObject *field2) { equivalent (same basic kind and same itemsize). */ -/*MULTIARRAY_API*/ +/*NUMPY_API*/ static unsigned char PyArray_EquivTypes(PyArray_Descr *typ1, PyArray_Descr *typ2) { @@ -5618,7 +5618,7 @@ PyArray_EquivTypes(PyArray_Descr *typ1, PyArray_Descr *typ2) return (typ1->kind == typ2->kind); } -/*MULTIARRAY_API*/ +/*NUMPY_API*/ static unsigned char PyArray_EquivTypenums(int typenum1, int typenum2) { @@ -5768,7 +5768,7 @@ _array_fromobject(PyObject *ignored, PyObject *args, PyObject *kws) /* accepts NULL type */ /* steals referenct to type */ -/*MULTIARRAY_API +/*NUMPY_API Empty */ static PyObject * @@ -5889,7 +5889,7 @@ array_scalar(PyObject *ignored, PyObject *args, PyObject *kwds) /* steal a reference */ /* accepts NULL type */ -/*MULTIARRAY_API +/*NUMPY_API Zeros */ static PyObject * @@ -6172,7 +6172,7 @@ array_from_text(PyArray_Descr *dtype, intp num, char *sep, size_t *nread, } #undef FROM_BUFFER_SIZE -/*OBJECT_API +/*NUMPY_API Given a pointer to a string ``data``, a string length ``slen``, and a ``PyArray_Descr``, return an array corresponding to the data @@ -6332,7 +6332,7 @@ array_fromfile_binary(FILE *fp, PyArray_Descr *dtype, intp num, size_t *nread) return r; } -/*OBJECT_API +/*NUMPY_API Given a ``FILE *`` pointer ``fp``, and a ``PyArray_Descr``, return an array corresponding to the data encoded in that file. @@ -6452,7 +6452,7 @@ array_fromfile(PyObject *ignored, PyObject *args, PyObject *keywds) /* steals a reference to dtype (which cannot be NULL) */ -/*OBJECT_API */ +/*NUMPY_API */ static PyObject * PyArray_FromIter(PyObject *obj, PyArray_Descr *dtype, intp count) { @@ -6567,7 +6567,7 @@ array_fromiter(PyObject *ignored, PyObject *args, PyObject *keywds) } -/*OBJECT_API*/ +/*NUMPY_API*/ static PyObject * PyArray_FromBuffer(PyObject *buf, PyArray_Descr *type, intp count, intp offset) @@ -6737,7 +6737,7 @@ static PyObject *array_correlate(PyObject *dummy, PyObject *args, PyObject *kwds } -/*MULTIARRAY_API +/*NUMPY_API Arange, */ static PyObject * @@ -6841,7 +6841,7 @@ _calc_length(PyObject *start, PyObject *stop, PyObject *step, PyObject **next, i } /* this doesn't change the references */ -/*MULTIARRAY_API +/*NUMPY_API ArangeObj, */ static PyObject * @@ -7065,7 +7065,7 @@ array_set_ops_function(PyObject *self, PyObject *args, PyObject *kwds) } -/*MULTIARRAY_API +/*NUMPY_API Where */ static PyObject * @@ -7373,7 +7373,7 @@ compare_chararrays(PyObject *dummy, PyObject *args, PyObject *kwds) SIGJMP_BUF _NPY_SIGINT_BUF; -/*MULTIARRAY_API +/*NUMPY_API */ static void _PyArray_SigintHandler(int signum) @@ -7382,7 +7382,7 @@ _PyArray_SigintHandler(int signum) SIGLONGJMP(_NPY_SIGINT_BUF, signum); } -/*MULTIARRAY_API +/*NUMPY_API */ static void* _PyArray_GetSigintBuf(void) diff --git a/numpy/core/src/scalartypes.inc.src b/numpy/core/src/scalartypes.inc.src index 0534642de..c7b38b723 100644 --- a/numpy/core/src/scalartypes.inc.src +++ b/numpy/core/src/scalartypes.inc.src @@ -131,7 +131,7 @@ scalar_value(PyObject *scalar, PyArray_Descr *descr) /* no error checking is performed -- ctypeptr must be same type as scalar */ /* in case of flexible type, the data is not copied into ctypeptr which is expected to be a pointer to pointer */ -/*OBJECT_API +/*NUMPY_API Convert to c-type */ static void @@ -160,7 +160,7 @@ PyArray_ScalarAsCtype(PyObject *scalar, void *ctypeptr) /* This may not work right on narrow builds for NumPy unicode scalars. */ -/*OBJECT_API +/*NUMPY_API Cast Scalar to c-type */ static int @@ -197,7 +197,7 @@ PyArray_CastScalarToCtype(PyObject *scalar, void *ctypeptr, return 0; } -/*OBJECT_API +/*NUMPY_API Cast Scalar to c-type */ static int @@ -220,7 +220,7 @@ PyArray_CastScalarDirect(PyObject *scalar, PyArray_Descr *indescr, */ /* steals reference to outcode */ -/*OBJECT_API +/*NUMPY_API Get 0-dim array from scalar */ static PyObject * @@ -292,7 +292,7 @@ PyArray_FromScalar(PyObject *scalar, PyArray_Descr *outcode) return ret; } -/*OBJECT_API +/*NUMPY_API Get an Array Scalar From a Python Object Returns NULL if unsuccessful but error is only set if another error occurred. Currently only Numeric-like @@ -2720,7 +2720,7 @@ _descr_from_subtype(PyObject *type) } /*New reference */ -/*OBJECT_API +/*NUMPY_API */ static PyArray_Descr * PyArray_DescrFromTypeObject(PyObject *type) @@ -2785,7 +2785,7 @@ PyArray_DescrFromTypeObject(PyObject *type) return _descr_from_subtype(type); } -/*OBJECT_API +/*NUMPY_API Return the tuple of ordered field names from a dictionary. */ static PyObject * @@ -2812,7 +2812,7 @@ PyArray_FieldNames(PyObject *fields) } /* New reference */ -/*OBJECT_API +/*NUMPY_API Return descr object from array scalar. */ static PyArray_Descr * @@ -2856,7 +2856,7 @@ PyArray_DescrFromScalar(PyObject *sc) } /* New reference */ -/*OBJECT_API +/*NUMPY_API Get a typeobject from a type-number -- can return NULL. */ static PyObject * |