示例#1
0
        internal static npy_intp SetItem(NpyArray arr, npy_intp index, object value)
        {
            var      offsetHelper     = new NpyArrayOffsetHelper(arr);
            npy_intp CalculatedOffset = offsetHelper.CalculateOffset(index);

            return(arr.descr.f.setitem(CalculatedOffset * arr.ItemSize, value, arr));
        }
示例#2
0
        public static object GetItem(NpyArray arr, npy_intp index)
        {
            var      offsetHelper     = new NpyArrayOffsetHelper(arr);
            npy_intp CalculatedOffset = offsetHelper.CalculateOffset(index);

            return(arr.descr.f.getitem(CalculatedOffset * arr.ItemSize, arr));
        }
示例#3
0
        internal static void GetItems(NpyArray arr, object[] buffer, npy_intp index, npy_intp length)
        {
            var offsetHelper = new NpyArrayOffsetHelper(arr);

            int i = 0;

            for (; index < length; index++)
            {
                npy_intp CalculatedOffset = offsetHelper.CalculateOffset(index);

                buffer[i++] = arr.descr.f.getitem(CalculatedOffset * arr.ItemSize, arr);
            }
        }