Defines |
#define | PY_SSIZE_T_CLEAN |
#define | NPY_NO_DEPRECATED_API |
#define | _MULTIARRAYMODULE |
#define | NPY_NO_PREFIX |
#define | CHECK_MEMORY |
#define | SMALL_STRING 2048 |
#define | _rstrip_loop(CMP) |
#define | _reg_loop(CMP) |
#define | _loop(CMP) |
Functions |
NPY_NO_EXPORT npy_intp | PyArray_Size (PyObject *op) |
NPY_NO_EXPORT int | PyArray_CopyObject (PyArrayObject *dest, PyObject *src_object) |
NPY_NO_EXPORT int | PyArray_TypeNumFromName (char *str) |
static void | array_dealloc (PyArrayObject *self) |
static int | dump_data (char **string, int *n, int *max_n, char *data, int nd, npy_intp *dimensions, npy_intp *strides, PyArrayObject *self) |
static PyObject * | array_repr_builtin (PyArrayObject *self, int repr) |
NPY_NO_EXPORT void | PyArray_SetStringFunction (PyObject *op, int repr) |
NPY_NO_EXPORT void | PyArray_SetDatetimeParseFunction (PyObject *op) |
static PyObject * | array_repr (PyArrayObject *self) |
static PyObject * | array_str (PyArrayObject *self) |
NPY_NO_EXPORT int | PyArray_CompareUCS4 (npy_ucs4 *s1, npy_ucs4 *s2, size_t len) |
NPY_NO_EXPORT int | PyArray_CompareString (char *s1, char *s2, size_t len) |
static int | _myunincmp (PyArray_UCS4 *s1, PyArray_UCS4 *s2, int len1, int len2) |
static int | _mystrncmp (char *s1, char *s2, int len1, int len2) |
static void | _rstripw (char *s, int n) |
static void | _unistripw (PyArray_UCS4 *s, int n) |
static char * | _char_copy_n_strip (char *original, char *temp, int nc) |
static void | _char_release (char *ptr, int nc) |
static char * | _uni_copy_n_strip (char *original, char *temp, int nc) |
static void | _uni_release (char *ptr, int nc) |
static int | _compare_strings (PyObject *result, PyArrayMultiIterObject *multi, int cmp_op, void *func, int rstrip) |
NPY_NO_EXPORT PyObject * | _strings_richcompare (PyArrayObject *self, PyArrayObject *other, int cmp_op, int rstrip) |
static PyObject * | _void_compare (PyArrayObject *self, PyArrayObject *other, int cmp_op) |
NPY_NO_EXPORT PyObject * | array_richcompare (PyArrayObject *self, PyObject *other, int cmp_op) |
NPY_NO_EXPORT int | PyArray_ElementStrides (PyObject *arr) |
NPY_NO_EXPORT Bool | PyArray_CheckStrides (int elsize, int nd, npy_intp numbytes, npy_intp offset, npy_intp *dims, npy_intp *newstrides) |
static PyObject * | array_new (PyTypeObject *subtype, PyObject *args, PyObject *kwds) |
static PyObject * | array_iter (PyArrayObject *arr) |
static PyObject * | array_alloc (PyTypeObject *type, Py_ssize_t NPY_UNUSED(nitems)) |
Variables |
static PyObject * | PyArray_StrFunction = NULL |
static PyObject * | PyArray_ReprFunction = NULL |
NPY_NO_EXPORT PyTypeObject | PyArray_Type |
VOID-type arrays can only be compared equal and not-equal in which case the fields are all compared by extracting the fields and testing one at a time... equality testing is performed using logical_ands on all the fields. in-equality testing is performed using logical_ors on all the fields.
VOID-type arrays without fields are compared for equality by comparing their memory at each location directly (using string-code).
If the field type has a non-trivial shape, additional dimensions will have been appended to <cite>a</cite> and <cite>b</cite>. In that case, reduce them using <cite>op</cite>.
If the type was multidimensional, collapse that part to 1-D
Reduce the extra dimension of <cite>temp</cite> using <cite>op</cite>
compare as a string. Assumes self and other have same descr->type
References NumericOps::equal, NumericOps::less, NumericOps::less_equal, n_ops, NumericOps::not_equal, PyArray_Check, PyArray_DESCR, PyArray_FromObject, PyArray_GenericBinaryFunction(), PyArray_NOTYPE, PyArray_OBJECT, and PyArray_VOID.
***************** end C-API functions *****************
array object functions
UPDATEIFCOPY means that base points to an array that should be updated with the contents of this array upon destruction. self->base->flags must have been WRITEABLE (checked previously) and it was locked here thus, unlock it.
<
hold on to self in next call
<blockquote> Don't need to DECREF -- because we are deleting</blockquote>
System Message: WARNING/2 (<string>
, line 2) Block quote ends without a blank line; unexpected unindent.
self already...
In any case base is pointing to something that we need to DECREF -- either a view or a buffer object
Free internal references if an Object array
<
hold on to self
Don't need to DECREF -- because we are deleting self already...
static PyObject* array_new |
( |
PyTypeObject * |
subtype, |
|
|
PyObject * |
args, |
|
|
PyObject * |
kwds |
|
) |
| [static] |
Usually called with shape and type but can also be called with buffer, strides, and swapped info For now, let's just use this to create an empty, contiguous array of a specific type and shape.
place Py_None in object positions
buffer given -- use it
get writeable and aligned
NPY_NO_EXPORT PyObject* array_richcompare |
( |
PyArrayObject * |
self, |
|
|
PyObject * |
other, |
|
|
int |
cmp_op |
|
) |
| |
Try to convert other to an array
If not successful, indicate that the items cannot be compared this way.
If the comparison results in NULL, then the two array objects can not be compared together; indicate that
Try to convert other to an array
If not successful, then objects cannot be compared this way
Try to handle string comparisons
Referenced by _strings_richcompare().
This routine checks to see if newstrides (of length nd) will not ever be able to walk outside of the memory implied numbytes and offset.
The available memory is assumed to start at -offset and proceed to numbytes-offset. The strides are checked to ensure that accessing memory using striding will not try to reach beyond this memory for any of the axes.
If numbytes is 0 it will be calculated using the dimensions and element-size.
This function checks for walking beyond the beginning and right-end of the buffer and therefore works for any integer stride (positive or negative).
NPY_NO_EXPORT int PyArray_CopyObject |
( |
PyArrayObject * |
dest, |
|
|
PyObject * |
src_object |
|
) |
| |
Special code to mimic Numeric behavior for character arrays.
Get either an array object we can copy from, or its parameters if there isn't a convenient array available.
If it's not an array, either assign from a sequence or as a scalar
If the input is scalar
If there's one dest element and src is a Python scalar
If there are more than enough dims, use AssignFromSequence because it can handle this style of broadcasting.
Otherwise convert to an array and do an array-based copy
If it's an array, do a move (handling possible overlapping data)
NPY_NO_EXPORT void PyArray_SetStringFunction |
( |
PyObject * |
op, |
|
|
int |
repr |
|
) |
| |
Set the array print function to be a Python function.
Dispose of previous callback
Add a reference to new callback
Remember new callback
Dispose of previous callback
Add a reference to new callback
Remember new callback