public static void setVals(double[] val, Param p) {
        Object o = p.getValue();
        if (o.getClass() == double[].class) {
            p.setValue(val);
        } else if (o.getClass() == Double.class) {
            p.setValue(val[0]);
        }
        throw new IllegalArgumentException(p.toString());
    }