Exemple #1
0
        public void FitsAtArbitraryPointsWithMaple(double t, double x, double maxAbsoluteError)
        {
            IInterpolation interpolation = new LinearSplineInterpolation(_t, _x);

            Assert.AreEqual(x, interpolation.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t);

            var actual = interpolation.DifferentiateAll(t);

            Assert.AreEqual(x, actual.Item1, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t);
        }
Exemple #2
0
        public void FitsAtSamplePoints()
        {
            IInterpolation interpolation = new LinearSplineInterpolation(_t, _x);

            for (int i = 0; i < _x.Length; i++)
            {
                Assert.AreEqual(_x[i], interpolation.Interpolate(_t[i]), "A Exact Point " + i);

                var actual = interpolation.DifferentiateAll(_t[i]);
                Assert.AreEqual(_x[i], actual.Item1, "B Exact Point " + i);
            }
        }
        public void FitsAtArbitraryPointsWithMaple(double t, double x, double maxAbsoluteError)
        {
            IInterpolation interpolation = new LinearSplineInterpolation(_t, _x);

            Assert.AreEqual(x, interpolation.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t);

            var actual = interpolation.DifferentiateAll(t);
            Assert.AreEqual(x, actual.Item1, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t);
        }
        public void FitsAtSamplePoints()
        {
            IInterpolation interpolation = new LinearSplineInterpolation(_t, _x);

            for (int i = 0; i < _x.Length; i++)
            {
                Assert.AreEqual(_x[i], interpolation.Interpolate(_t[i]), "A Exact Point " + i);

                var actual = interpolation.DifferentiateAll(_t[i]);
                Assert.AreEqual(_x[i], actual.Item1, "B Exact Point " + i);
            }
        }