Exemplo n.º 1
0
        public unsafe void Indexer_GetScalarAt_SetScalarAt()
        {
            float sum = 0;

            Measure(Times, () =>
            {
                Block8x8F block = new Block8x8F();

                for (int i = 0; i < Block8x8F.ScalarCount; i++)
                {
                    Block8x8F.SetScalarAt(&block, i, i);
                }
                sum = 0;
                for (int i = 0; i < Block8x8F.ScalarCount; i++)
                {
                    sum += Block8x8F.GetScalarAt(&block, i);
                }
            });
            Assert.Equal(sum, 64f * 63f * 0.5f);
        }