public static int argMin(double[] v) {
		int minI = -1;
		double minV = Double.POSITIVE_INFINITY;
		for (int i = 0; i < v.length; i++) {
			if (v[i] < minV) {
				minV = v[i];
				minI = i;
			}
		}
		return minI;
	}