示例#1
0
        public void TestNormalDistribution()
        {
            var input    = new double[] { 1, 2, 3, 4, 1, 0, 1, 2 };
            var expected = new[] { 0.24197072451914337, 0.3989422804014327, 0.24197072451914337, 0.053990966513188063, 0.24197072451914337, 0.053990966513188063, 0.24197072451914337, 0.3989422804014327 };
            var result   = WaveMath.NormalDistribution(input, 2, 1);

            Assert.IsTrue(result.SequenceEqual(expected));

            input    = new double[] { 0 };
            expected = new[] { 0.053990966513188063 };
            result   = WaveMath.NormalDistribution(input, 2, 1);
            Assert.IsTrue(result.SequenceEqual(expected));

            input    = new double[] { };
            expected = new double[] { };
            result   = WaveMath.NormalDistribution(input, 2, 1);
            Assert.IsTrue(result.SequenceEqual(expected));
        }