static private void TestPolyMatrix() { var N = NaturalCoordinate.ConstructInterpolationFunction(2, 2); var NTT = N.Transpose().Transpose(); var NNew = N.Integrate(0).Differentiate(0); for (int i = 0; i < N.Rows; i++) { for (int j = 0; j < N.Cols; j++) { int Length = N.Data [i, j].Coefficients.Length; for (int k = 0; k < Length; k++) { if (N.Data [i, j].Coefficients [k] != NTT.Data [i, j].Coefficients [k]) { throw new Exception("This should be the same!"); } if (N.Data [i, j].Coefficients [k] != NNew.Data [i, j].Coefficients [k]) { throw new Exception("This should be the same!"); } } } } }
static private void TestNaturalCoordinates() { var N = NaturalCoordinate.ConstructInterpolationFunction(1, 1); var N2 = NaturalCoordinate.ConstructInterpolationFunction(2, 2); var N3 = NaturalCoordinate.ConstructInterpolationFunction(3, 2); //Console.WriteLine ("1D Order Linear Interpolation"); //PrintNaturalCoordinates (N); //Console.WriteLine ("2D Order Quadratic Interpolation"); //PrintNaturalCoordinates (N2); //Console.WriteLine ("3D Order Cubic Interpolation"); //PrintNaturalCoordinates (N3); }