Ejemplo n.º 1
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));
            }
        }
Ejemplo n.º 2
0
 private static bool NpyIter_IterationNeedsAPI(NpyIter dst_iter)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 3
0
 private static VoidPtr NpyIter_GetInnerLoopSizePtr(NpyIter dst_iter)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 4
0
 private static npy_intp[] NpyIter_GetInnerStrideArray(NpyIter dst_iter)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
 internal static NpyIter_IterNextFunc NpyIter_GetIterNext(NpyIter dst_iter, object p)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 6
0
        /*NUMPY_API
         * Deallocate an iterator
         */
        internal static int NpyIter_Deallocate(NpyIter iter)
        {
            //ITERFLAGS itflags;
            ///*int ndim = NIT_NDIM(iter);*/
            //int iop, nop;
            //NpyArray_Descr[] dtype;
            //NpyArray[] _object;

            //if (iter == null)
            //{
            //    return npy_defs.NPY_SUCCEED;
            //}

            //itflags = NIT_ITFLAGS(iter);
            //nop = NIT_NOP(iter);
            //dtype = NIT_DTYPES(iter);
            //_object = NIT_OPERANDS(iter);

            ///* Deallocate any buffers and buffering data */
            //if (itflags & ITERFLAGS.NPY_ITFLAG_BUFFER)
            //{
            //    NpyIter_BufferData* bufferdata = NIT_BUFFERDATA(iter);
            //    VoidPtr[] buffers;
            //    NpyAuxData[] transferdata;

            //    /* buffers */
            //    buffers = NBF_BUFFERS(bufferdata);
            //    for (iop = 0; iop < nop; ++iop)
            //    {
            //        NpyArray_free(buffers[iop]);
            //    }
            //    /* read bufferdata */
            //    transferdata = NBF_READTRANSFERDATA(bufferdata);
            //    for (iop = 0; iop < nop; ++iop)
            //    {
            //        if (transferdata[iop]!= null)
            //        {
            //            NPY_AUXDATA_FREE(transferdata[iop]);
            //        }
            //    }
            //    /* write bufferdata */
            //    transferdata = NBF_WRITETRANSFERDATA(bufferdata);
            //    for (iop = 0; iop < nop; ++iop)
            //    {
            //        if (transferdata[iop] != null)
            //        {
            //            NPY_AUXDATA_FREE(transferdata[iop]);
            //        }
            //    }
            //}

            ///* Deallocate all the dtypes and objects that were iterated */
            //for (iop = 0; iop < nop; ++iop)
            //{
            //    Npy_XDECREF(dtype[iop]);
            //    Npy_XDECREF(_object[iop]);
            //}

            ///* Deallocate the iterator memory */
            //NpyObject_Free(iter);

            return(npy_defs.NPY_SUCCEED);
        }
Ejemplo n.º 7
0
 private static byte NIT_NOP(NpyIter iter)
 {
     return(iter.nop);
 }
Ejemplo n.º 8
0
 private static ITERFLAGS NIT_ITFLAGS(NpyIter iter)
 {
     return(iter.itflags);
 }