コード例 #1
0
        public void TransformInplace(int totalLength, int bufferLength)
        {
            using MemoryGroup <int> src = this.CreateTestGroup(10, 20, true);

            src.TransformInplace(s => MultiplyAllBy2(s, s));

            int cnt = 1;

            for (MemoryGroupIndex i = src.MinIndex(); i < src.MaxIndex(); i += 1)
            {
                int val = src.GetElementAt(i);
                Assert.Equal(expected: cnt * 2, val);
                cnt++;
            }
        }