Accord.Tests.Statistics.InverseSquaredLinkFunctionTest.InverseSquaredLinkFunctionConstructorTest1 C# (CSharp) Метод

InverseSquaredLinkFunctionConstructorTest1() приватный Метод

private InverseSquaredLinkFunctionConstructorTest1 ( ) : void
Результат void
        public void InverseSquaredLinkFunctionConstructorTest1()
        {
            double beta = 3.14;
            double constant = 2.91;

            InverseSquaredLinkFunction target = new InverseSquaredLinkFunction(beta, constant);
            Assert.AreEqual(constant, target.A);
            Assert.AreEqual(beta, target.B);

            for (int i = 0; i < 11; i++)
            {
                double x = i / 10.0;
                double y = (1 / (x * x) - constant) / beta;

                Assert.AreEqual(y, target.Function(x), 1e-10);
                Assert.AreEqual(x, target.Inverse(y), 1e-10);
            }
        }