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)); }
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)); }
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); } }