@Test public void testListToArray() { final List<Double> dl = new ArrayList<Double>(); dl.add(-1.0); dl.add(2.0); final double[] expectedArray = { -1.0, 2.0 }; assertArrayEquals("listToArray() failed!", expectedArray, FunctionUtil.listToArray(dl), 0.0001); }
public static double[] listToArray(final List<Double> a) { final double[] x = new double[a.size()]; int i = 0; for (double d : a) x[i++] = d; return x; }
FunctionUtil { public static double[] listToArray(final List<Double> a) { final double[] x = new double[a.size()]; int i = 0; for (double d : a) x[i++] = d; return x; } }
FunctionUtil { public static double[] listToArray(final List<Double> a) { final double[] x = new double[a.size()]; int i = 0; for (double d : a) x[i++] = d; return x; } private  FunctionUtil(); }
FunctionUtil { public static double[] listToArray(final List<Double> a) { final double[] x = new double[a.size()]; int i = 0; for (double d : a) x[i++] = d; return x; } private  FunctionUtil(); static double getArgAsDouble(final Object arg); static String getArgAsString(final Object arg); static long getArgAsLong(final Object arg); static boolean getArgAsBoolean(final Object arg); static double numericallySafeSum(final double a[]); static String getOrdinal(final int i); static double calcSampleVariance(final double[] x); static double[] listToArray(final List<Double> a); static boolean isScalarArgType(final Class type); static boolean isTypeOfList(final Class listClassCandidate); static void addScalarArgumentTypes(final List<Class> argTypes); static double[] getDoubles(final Object[] args); static long[] getLongs(final Object[] args); static String[] getStrings(final Object[] args); static boolean[] getBooleans(final Object[] args); static Object translateObjectType(final Object input); }
FunctionUtil { public static double[] listToArray(final List<Double> a) { final double[] x = new double[a.size()]; int i = 0; for (double d : a) x[i++] = d; return x; } private  FunctionUtil(); static double getArgAsDouble(final Object arg); static String getArgAsString(final Object arg); static long getArgAsLong(final Object arg); static boolean getArgAsBoolean(final Object arg); static double numericallySafeSum(final double a[]); static String getOrdinal(final int i); static double calcSampleVariance(final double[] x); static double[] listToArray(final List<Double> a); static boolean isScalarArgType(final Class type); static boolean isTypeOfList(final Class listClassCandidate); static void addScalarArgumentTypes(final List<Class> argTypes); static double[] getDoubles(final Object[] args); static long[] getLongs(final Object[] args); static String[] getStrings(final Object[] args); static boolean[] getBooleans(final Object[] args); static Object translateObjectType(final Object input);  }