Quantcast
Channel: Math.NET Numerics
Viewing all articles
Browse latest Browse all 971

New Post: help with porting code from Math.NET Iridium to Math.NET Numerics

$
0
0
hi Christoph

I finally got on to coding this task :)

There is 1 more case:

4a) old code:
points = new List<double> { start.XValue, middle.XValue, end.XValue };
values = new List<double> { start.YValues[0], middle.YValues[0], end.YValues[0] };

var method = Interpolation.CreatePolynomial(points, values);
var result = method.Interpolate(verticalX);
4b) replace with:
points = new List<double> { start.XValue, middle.XValue, end.XValue };
values = new List<double> { start.YValues[0], middle.YValues[0], end.YValues[0] };

var interpolate = new NevillePolynomialInterpolation(points, values);
var result = interpolate.Interpolate(verticalX);
note: I chose NevillePolynomialInterpolation to replace Interpolation.CreatePolynomial() because of a comment on Interpolation.CreatePolynomial() mentions 'Neville':

_"Create a polynomial (neville) interpolation based on arbitrary points."


note: I tried to take the unit tests for NevillePolynomialInterpolation and apply them to the old code Interpolation.CreatePolynomial() to check that the results would be the same. However, these tests are failing:
Constructor_SamplePointsNotUnique_Throws
InterpolationFitsAtArbitraryPointsWithMapleTest
InterpolationFitsAtSamplePointsTest
so when I saw the tests failing - I thought I better double check on this forum, if this replacement makes sense.

Does this replacement look correct ? ( using NevillePolynomialInterpolation to replace Interpolation.CreatePolynomial() )


thanks !

Sean

Viewing all articles
Browse latest Browse all 971

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>