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

just in case this helps anyone:

if I take the old unit test from Math.NET Iridium:
file: InterpolationTest.cs
test: TestInterpolationMethod_NevillePolynomial

code:
  NumericAssert.AreAlmostEqual(.57225000000000000000, method.Differentiate(0.1, out dx, out d2x);, 1e-15, "B 0.1");
this PASSES in Math.NET Iridium, as you would expect.

however, if we port code to Math.NET Numerics (using replacement 4b) above) then the above Assert will fail.
This seems to be because the return value is now the first differential, instead of the interpolated value.

quick fix in test code: check the correct value (the interpolated value):
method.Differentiate(0.1, out dx, out d2x);
NumericAssert.AreAlmostEqual(.57225000000000000000, dx, 1e-15, "B 0.1");

Viewing all articles
Browse latest Browse all 971

Trending Articles



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