DoublesVectorFunctionProvider implements VectorFunctionProvider<Double> { @Override public VectorFunction from(final List<Double> x) { ArgumentChecker.notNull(x, "x"); return from(x.toArray(new Double[0])); }  @Override VectorFunction from(final List<Double> x); @Override VectorFunction from(final Double[] x); abstract VectorFunction from(double[] x);  }
@Test public void test() { final ParameterizedCurve curve = new ParameterizedCurve() { @Override public Double evaluate(final Double x, final DoubleMatrix1D parameters) { return parameters.getEntry(0) + parameters.getEntry(1) * x + parameters.getEntry(2) * x * x; } @Override public int getNumberOfParameters() { return 3; } }; final DoublesVectorFunctionProvider pro = new DoublesVectorFunctionProvider() { @Override public VectorFunction from(final double[] x) { final ParameterizedCurveVectorFunction vf = new ParameterizedCurveVectorFunction(x, curve); return vf; } }; final DoubleMatrix1D parms = new DoubleMatrix1D(-2.0, 1.0, 0.5); VectorFunction f = pro.from(new Double[] {-1.0, 0.0, 1.0 }); DoubleMatrix1D y = f.evaluate(parms); AssertMatrix.assertEqualsVectors(new DoubleMatrix1D(-2.5, -2.0, -0.5), y, 1e-15); final List<Double> l = new ArrayList<>(3); l.add(0.0); l.add(2.0); l.add(4.0); f = pro.from(l); y = f.evaluate(parms); AssertMatrix.assertEqualsVectors(new DoubleMatrix1D(-2.0, 2.0, 10.0), y, 1e-15); }