コード例 #1
0
        public void Fill_Vector2D()
        {
            // arrange
            var data   = new int[24];
            var target = new DataAndLayout <int>(data, new FastAccess(new Layout(new int[] { 2, 3, 4 }, 0, new int[] { 12, 4, 1 })));

            const int FillPattern = 999;

            // action
            ScalarOps.Fill(FillPattern, target);

            // assert
            Assert.IsTrue(data.All(d => d == FillPattern));
        }
コード例 #2
0
        public void Fill_Scalar()
        {
            // arrange
            var data   = new int[1];
            var scalar = new DataAndLayout <int>(data, new FastAccess(new Layout(new int[] { }, 0, new int[] { })));

            // action
            const int FillPattern = 999;

            ScalarOps.Fill(FillPattern, scalar);

            // assert
            Assert.IsTrue(data.All(d => d == FillPattern));
        }
コード例 #3
0
        public void Fill_Vector1D()
        {
            // arrange
            const int BufferSize = 10;
            var       data       = new int[BufferSize];
            var       target     = new DataAndLayout <int>(data, new FastAccess(new Layout(new int[] { BufferSize }, 0, new int[] { 1 })));

            const int FillPattern = 999;

            // action
            ScalarOps.Fill(FillPattern, target);

            // assert
            Assert.IsTrue(data.All(d => d == FillPattern));
        }