@@ -49,7 +49,7 @@ def testAsymptoticWeightsSTABLE(pType, scaleRef):
4949def testInterpolation (nNodes , weightComputation ):
5050 nodes = np .sort (np .random .rand (nNodes ))
5151 approx = LagrangeApproximation (nodes , weightComputation = weightComputation )
52-
52+
5353 times = np .random .rand (nNodes * 2 )
5454 P = approx .getInterpolationMatrix (times )
5555
@@ -66,7 +66,7 @@ def testEvaluation(nNodes, weightComputation):
6666 times = np .random .rand (nNodes * 2 )
6767 polyCoeffs = np .random .rand (nNodes )
6868 polyValues = np .polyval (polyCoeffs , nodes )
69-
69+
7070 approx = LagrangeApproximation (nodes , weightComputation = weightComputation , fValues = polyValues )
7171 P = approx .getInterpolationMatrix (times )
7272 refEvals = P @ polyValues
@@ -76,7 +76,7 @@ def testEvaluation(nNodes, weightComputation):
7676
7777 polyEvals = approx (t = times )
7878 assert np .allclose (polyEvals , refEvals )
79-
79+
8080
8181@pytest .mark .parametrize ("numQuad" , ["LEGENDRE_NUMPY" , "LEGENDRE_SCIPY" , "FEJER" ])
8282@pytest .mark .parametrize ("weightComputation" , ["AUTO" , "FAST" , "STABLE" , "CHEBFUN" ])
@@ -92,4 +92,19 @@ def testIntegration(nNodes, weightComputation, numQuad):
9292 polyNodes = np .polyval (polyCoeffs , nodes )
9393 polyInteg = np .polyval (np .polyint (polyCoeffs ), times ) - np .polyval (np .polyint (polyCoeffs ), 0 )
9494
95- assert np .allclose (polyInteg , P @ polyNodes )
95+ assert np .allclose (polyInteg , P @ polyNodes )
96+
97+
98+ @pytest .mark .parametrize ("weightComputation" , ["AUTO" , "FAST" , "STABLE" , "CHEBFUN" ])
99+ @pytest .mark .parametrize ("nNodes" , nNodeTests )
100+ def testDerivation (nNodes , weightComputation ):
101+ nodes = np .sort (np .random .rand (nNodes ))
102+ approx = LagrangeApproximation (nodes , weightComputation = weightComputation )
103+
104+ D = approx .getDerivationMatrix ()
105+
106+ polyCoeffs = np .random .rand (nNodes )
107+ polyNodes = np .polyval (polyCoeffs , nodes )
108+ polyDeriv = np .polyval (np .polyder (polyCoeffs ), nodes )
109+
110+ assert np .allclose (polyDeriv , D @ polyNodes )
0 commit comments