public void CanConvertToVector()
        {
            HugeArray <uint> a = new HugeArray <uint>(8, 1, 11, 94, 5, 0, 0, 0, 8);
            Vector <uint>    v = a.AcquireAsSingleVector();

            Assert.Equal(a[0], v[0]);
            Assert.Equal(a[3], v[3]);
            Assert.Equal(a[7], v[7]);
            HugeArray <uint> a2 = new HugeArray <uint>(12, 11, 112, 594, 65, 0, 0, 0, 8, 14, 90, 2, 8);
            Vector <uint>    v2 = a2.AcquireSliceToVector(0);

            Assert.Equal(11u, v2[0]);
            Assert.Equal(8u, v2[7]);
            HugeArray <uint> a3 = new HugeArray <uint>((ulong)Int32.MaxValue + 10000);

            a3.Fill(7u);
            a3[(ulong)Int32.MaxValue + 100] = 9;
            a3[(ulong)Int32.MaxValue + 101] = 4;
            Vector <uint> v3 = a3.AcquireSliceToVector((ulong)Int32.MaxValue + 99);

            Assert.Equal(9u, v3[1]);
            Assert.Equal(4u, v3[2]);
            Assert.Equal(a3[(ulong)Int32.MaxValue + 99], v3[0]);
            Assert.Equal(7u, v3[0]);
            Assert.Equal(7u, v3[7]);
            a.Close();
            a2.Close();
            a3.Close();
        }
        public void CanFill()
        {
            HugeArray <int> array = new HugeArray <int>(1000);

            array.Fill(33);
            Assert.Equal(33, array[999]);
            array.Close();
        }
Beispiel #3
0
        public void FillHugeNativeArray()
        {
            T             fill  = GetArrayFillValue();
            HugeArray <T> array = new HugeArray <T>(ArraySize);

            array.Fill(fill);
            T r = array[ArraySize / 2];
        }
Beispiel #4
0
        public void FillHugeNativeArray()
        {
            T fill = GM <T> .Random();

            HugeArray <T> array = new HugeArray <T>(ArraySize);

            array.Fill(fill);
            T r = array[ArraySize / 2];
        }