コード例 #1
0
        public void Log10()
        {
            // arrange
            const int NumElements = 3;
            var       targetData  = new double[NumElements];
            var       srcData     = new[] { 1.0, 10.0, 100.0 };

            var target = new DataAndLayout <double>(targetData, new FastAccess(new Layout(new int[] { NumElements }, 0, new int[] { 1 })));
            var src    = new DataAndLayout <double>(srcData, new FastAccess(new Layout(new int[] { NumElements }, 0, new int[] { 1 })));

            // action
            ScalarOps.Log10(target, src);

            // assert
            const double Epsilon = 1e-8;

            Assert.IsTrue(Math.Abs(targetData[0] - 0.0) < Epsilon);
            Assert.IsTrue(Math.Abs(targetData[1] - 1.0) < Epsilon);
            Assert.IsTrue(Math.Abs(targetData[2] - 2.0) < Epsilon);
        }