NUMPY_API * Creates a new array with the same shape as the provided one, * with possible memory layout order and data type changes. * * prototype - The array the new one should be like. * order - NPY_CORDER - C-contiguous result. * NPY_FORTRANORDER - Fortran-contiguous result. * NPY_ANYORDER - Fortran if prototype is Fortran, C otherwise. * NPY_KEEPO
| 1155 | * dtype->subarray is true, dtype will be decrefed. |
| 1156 | */ |
| 1157 | NPY_NO_EXPORT PyObject * |
| 1158 | PyArray_NewLikeArray(PyArrayObject *prototype, NPY_ORDER order, |
| 1159 | PyArray_Descr *dtype, int subok) |
| 1160 | { |
| 1161 | if (prototype == NULL) { |
| 1162 | PyErr_SetString(PyExc_ValueError, |
| 1163 | "prototype is NULL in PyArray_NewLikeArray"); |
| 1164 | return NULL; |
| 1165 | } |
| 1166 | return PyArray_NewLikeArrayWithShape(prototype, order, dtype, -1, NULL, subok); |
| 1167 | } |
| 1168 | |
| 1169 | /*NUMPY_API |
| 1170 | * Generic new array creation routine. |
no test coverage detected