/// <summary>
        /// Create a burlish stoer rational interpolation based on arbitrary points.
        /// </summary>
        /// <param name="points">The sample points t. Supports both lists and arrays.</param>
        /// <param name="values">The sample point values x(t). Supports both lists and arrays.</param>
        /// <returns>
        /// An interpolation scheme optimized for the given sample points and values,
        /// which can then be used to compute interpolations and extrapolations
        /// on arbitrary points.
        /// </returns>
        public static IInterpolation RationalWithPoles(
            IList <double> points,
            IList <double> values)
        {
            BulirschStoerRationalInterpolation method = new BulirschStoerRationalInterpolation();

            method.Initialize(points, values);
            return(method);
        }
        public void FitsAtSamplePoints()
        {
            IInterpolation interpolation = new BulirschStoerRationalInterpolation(_t, _x);

            for (int i = 0; i < _x.Length; i++)
            {
                Assert.AreEqual(_x[i], interpolation.Interpolate(_t[i]), "A Exact Point " + i);
            }
        }
Пример #3
0
 /// <summary>
 /// Create a burlish stoer rational interpolation based on arbitrary points.
 /// </summary>
 /// <param name="points">The sample points t. Supports both lists and arrays.</param>
 /// <param name="values">The sample point values x(t). Supports both lists and arrays.</param>
 /// <returns>
 /// An interpolation scheme optimized for the given sample points and values,
 /// which can then be used to compute interpolations and extrapolations
 /// on arbitrary points.
 /// </returns>
 public static IInterpolation RationalWithPoles(
     IList<double> points,
     IList<double> values)
 {
     BulirschStoerRationalInterpolation method = new BulirschStoerRationalInterpolation();
     method.Initialize(points, values);
     return method;
 }
        public void FitsAtArbitraryPointsWithMaple(double t, double x, double maxAbsoluteError)
        {
            IInterpolation interpolation = new BulirschStoerRationalInterpolation(_t, _x);

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