@Test public void test() { final ParameterizedCurveVectorFunctionProvider pro = new ParameterizedCurveVectorFunctionProvider(s_PCurve); final double[] points = new double[] {-1.0, 0.0, 1.0 }; final VectorFunction f = pro.from(points); assertEquals(2, f.getLengthOfDomain()); assertEquals(3, f.getLengthOfRange()); final DoubleArray x = DoubleArray.of(0.5, 2.0); //the parameters a & b final DoubleArray y = f.apply(x); assertEquals(0.5 * Math.sinh(-2.0), y.get(0), 1e-14); assertEquals(0.0, y.get(1), 1e-14); assertEquals(0.5 * Math.sinh(2.0), y.get(2), 1e-14); final DoubleMatrix jac = f.calculateJacobian(x); final DoubleMatrix fdJac = (new VectorFieldFirstOrderDifferentiator().differentiate(f)).apply(x); AssertMatrix.assertEqualsMatrix(fdJac, jac, 1e-9); } }