예제 #1
0
        /*NUMPY_API
         * Allocate a new iterator for one array object.
         */
        internal static NpyIter NpyIter_New(NpyArray op, ITERFLAGS flags, NPY_ORDER order, NPY_CASTING casting, NpyArray_Descr dtype)
        {
            /* Split the flags into separate global and op flags */
            ITERFLAGS op_flags = flags & ITERFLAGS.NPY_ITER_PER_OP_FLAGS;

            flags &= ITERFLAGS.NPY_ITER_GLOBAL_FLAGS;

            return(NpyIter_AdvancedNew(1, &op, flags, order, casting,
                                       &op_flags, &dtype,
                                       -1, null, null, 0));
        }
예제 #2
0
        private static VoidPtr[] NpyIter_GetDataPtrArray(NpyIter iter)
        {
            ITERFLAGS itflags = NIT_ITFLAGS(iter);
            /*int ndim = NIT_NDIM(iter);*/
            int nop = NIT_NOP(iter);

            if (itflags & ITERFLAGS.NPY_ITFLAG_BUFFER)
            {
                NpyIter_BufferData *bufferdata = NIT_BUFFERDATA(iter);
                return(NBF_PTRS(bufferdata));
            }
            else
            {
                NpyIter_AxisData *axisdata = NIT_AXISDATA(iter);
                return(NAD_PTRS(axisdata));
            }
        }