Exemplo n.º 1
0
        public unsafe void CopyBlockToShiftDataInSameOffsettedPointer()
        {
            const int size = 1_000_000;
            var       a    = new DoubleArrayUnmanaged(size, 1, true);

            for (int i = 0; i < size; i++)
            {
                a.Address[i] = i;
            }

            Unsafe.CopyBlock(a.Address + 1, a.Address, (uint)(sizeof(double) * (a.Count - 1) * a.Properties));

            for (int i = 1; i < size; i++)
            {
                a.Address[i].Should().Be(i - 1);
            }
        }
Exemplo n.º 2
0
 public SlicedDoubleArrayUnmanaged(DoubleArrayUnmanaged slicedArray, int start, int stop) : base(slicedArray.Address + start, stop - start, slicedArray.Properties, false, null)
 {
     internalArray = slicedArray;
     this.start    = start;
     this.stop     = stop;
 }