|
|
|
@ -4,7 +4,7 @@ |
|
|
|
// http://github.com/mathnet/mathnet-numerics
|
|
|
|
// http://mathnetnumerics.codeplex.com
|
|
|
|
//
|
|
|
|
// Copyright (c) 2002-2011 Math.NET
|
|
|
|
// Copyright (c) 2002-2013 Math.NET
|
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person
|
|
|
|
// obtaining a copy of this software and associated documentation
|
|
|
|
@ -31,9 +31,6 @@ |
|
|
|
namespace MathNet.Numerics.UnitTests.InterpolationTests |
|
|
|
{ |
|
|
|
using System; |
|
|
|
using System.Globalization; |
|
|
|
using System.IO; |
|
|
|
using System.Linq; |
|
|
|
using Interpolation; |
|
|
|
using NUnit.Framework; |
|
|
|
|
|
|
|
@ -65,10 +62,8 @@ namespace MathNet.Numerics.UnitTests.InterpolationTests |
|
|
|
{ |
|
|
|
Assert.AreEqual(_x[i], interpolation.Interpolate(_t[i]), "A Exact Point " + i); |
|
|
|
|
|
|
|
double interpolatedValue; |
|
|
|
double secondDerivative; |
|
|
|
interpolation.Differentiate(_t[i], out interpolatedValue, out secondDerivative); |
|
|
|
Assert.AreEqual(_x[i], interpolatedValue, "B Exact Point " + i); |
|
|
|
var actual = interpolation.DifferentiateAll(_t[i]); |
|
|
|
Assert.AreEqual(_x[i], actual.Item1, "B Exact Point " + i); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -98,10 +93,8 @@ namespace MathNet.Numerics.UnitTests.InterpolationTests |
|
|
|
|
|
|
|
Assert.AreEqual(x, interpolation.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t); |
|
|
|
|
|
|
|
double interpolatedValue; |
|
|
|
double secondDerivative; |
|
|
|
interpolation.Differentiate(t, out interpolatedValue, out secondDerivative); |
|
|
|
Assert.AreEqual(x, interpolatedValue, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t); |
|
|
|
var actual = interpolation.DifferentiateAll(t); |
|
|
|
Assert.AreEqual(x, actual.Item1, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -116,10 +109,8 @@ namespace MathNet.Numerics.UnitTests.InterpolationTests |
|
|
|
{ |
|
|
|
Assert.AreEqual(_x[i], interpolation.Interpolate(_t[i]), "A Exact Point " + i); |
|
|
|
|
|
|
|
double interpolatedValue; |
|
|
|
double secondDerivative; |
|
|
|
interpolation.Differentiate(_t[i], out interpolatedValue, out secondDerivative); |
|
|
|
Assert.AreEqual(_x[i], interpolatedValue, "B Exact Point " + i); |
|
|
|
var actual = interpolation.DifferentiateAll(_t[i]); |
|
|
|
Assert.AreEqual(_x[i], actual.Item1, "B Exact Point " + i); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -149,10 +140,8 @@ namespace MathNet.Numerics.UnitTests.InterpolationTests |
|
|
|
|
|
|
|
Assert.AreEqual(x, interpolation.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t); |
|
|
|
|
|
|
|
double interpolatedValue; |
|
|
|
double secondDerivative; |
|
|
|
interpolation.Differentiate(t, out interpolatedValue, out secondDerivative); |
|
|
|
Assert.AreEqual(x, interpolatedValue, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t); |
|
|
|
var actual = interpolation.DifferentiateAll(t); |
|
|
|
Assert.AreEqual(x, actual.Item1, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -167,10 +156,8 @@ namespace MathNet.Numerics.UnitTests.InterpolationTests |
|
|
|
{ |
|
|
|
Assert.AreEqual(_x[i], interpolation.Interpolate(_t[i]), "A Exact Point " + i); |
|
|
|
|
|
|
|
double interpolatedValue; |
|
|
|
double secondDerivative; |
|
|
|
interpolation.Differentiate(_t[i], out interpolatedValue, out secondDerivative); |
|
|
|
Assert.AreEqual(_x[i], interpolatedValue, "B Exact Point " + i); |
|
|
|
var actual = interpolation.DifferentiateAll(_t[i]); |
|
|
|
Assert.AreEqual(_x[i], actual.Item1, "B Exact Point " + i); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -200,10 +187,8 @@ namespace MathNet.Numerics.UnitTests.InterpolationTests |
|
|
|
|
|
|
|
Assert.AreEqual(x, interpolation.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t); |
|
|
|
|
|
|
|
double interpolatedValue; |
|
|
|
double secondDerivative; |
|
|
|
interpolation.Differentiate(t, out interpolatedValue, out secondDerivative); |
|
|
|
Assert.AreEqual(x, interpolatedValue, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t); |
|
|
|
var actual = interpolation.DifferentiateAll(t); |
|
|
|
Assert.AreEqual(x, actual.Item1, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|