예제 #1
0
        public void And()
        {
            // arrange
            const int NumElements = 4;
            var       targetData  = new bool[NumElements];
            var       src1Data    = new[] { false, false, true, true };
            var       src2Data    = new[] { false, true, false, true };

            var target = new DataAndLayout <bool>(targetData, new FastAccess(new Layout(new int[] { NumElements }, 0, new int[] { 1 })));
            var src1   = new DataAndLayout <bool>(src1Data, new FastAccess(new Layout(new int[] { NumElements }, 0, new int[] { 1 })));
            var src2   = new DataAndLayout <bool>(src2Data, new FastAccess(new Layout(new int[] { NumElements }, 0, new int[] { 1 })));

            // action
            ScalarOps.And(target, src1, src2);

            // assert
            CollectionAssert.AreEqual(new[] { false, false, false, true }, targetData);
        }